by swiftlens
SwiftLens is a Model Context Protocol (MCP) server that provides deep, semantic-level analysis of Swift codebases to any AI models. By integrating directly with Apple's SourceKit-LSP, SwiftLens enables AI models to understand Swift code with compiler-grade accuracy.
# Add to your Claude Code skills
git clone https://github.com/swiftlens/swiftlensGuides for using mcp servers skills like swiftlens.
Last scanned: 5/30/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-05-30T16:24:20.790Z",
"npmAuditRan": true,
"pipAuditRan": false
}swiftlens is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by swiftlens. SwiftLens is a Model Context Protocol (MCP) server that provides deep, semantic-level analysis of Swift codebases to any AI models. By integrating directly with Apple's SourceKit-LSP, SwiftLens enables AI models to understand Swift code with compiler-grade accuracy. It has 125 GitHub stars.
Yes. swiftlens passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/swiftlens/swiftlens" and add it to your Claude Code skills directory (see the Installation section above).
swiftlens is primarily written in Python. It is open-source under swiftlens on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh swiftlens against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
SwiftLens is a Model Context Protocol (MCP) server that provides deep, semantic-level analysis of Swift codebases to AI agents. By integrating directly with Apple's SourceKit-LSP, SwiftLens enables AI models to understand Swift code with compiler-grade accuracy.
SwiftLens bridges AI models and Swift development through:
AI Agent (Claude/GPT) → MCP Protocol → SwiftLens → SourceKit-LSP → Swift Code
Add to your json configuration file mcpServers section:
{
"mcpServers": {
"swiftlens": {
"command": "uvx",
"args": ["swiftlens"]
}
}
}
SwiftLens will need proper sourcekit-lsp index in order to work properly you can either
"hey claude, run swift_build_index tool"
SwiftLens requires an index store for cross-file analysis. Build it with:
# Navigate to your Swift project
cd /path/to/your/swift/project
# Build with index store
swift build -Xswiftc -index-store-path -Xswiftc .build/index/store
Important: Rebuilding of the index is required when you:
SwiftLens provides 15 tools for Swift code analysis:
swift_analyze_file - Analyze structure and symbols in a Swift fileswift_analyze_multiple_files - Batch analyze multiple filesswift_summarize_file - Get symbol counts and file summaryswift_get_symbols_overview - Extract top-level type declarationsswift_get_declaration_context - Get fully-qualified symbol pathsswift_get_file_imports - Extract import statementsswift_validate_file - Validate syntax and types with swiftcswift_check_environment - Verify Swift development setupswift_build_index - Build index store db of current project for sourcekit-lspswift_find_symbol_references - Find all references to a symbolswift_get_symbol_definition - Jump to symbol definitionswift_get_hover_info - Get type info and documentationswift_replace_symbol_body - Replace function/type bodyswift_search_pattern - Search with regex patternsget_tool_help - Get help for any toolAsk your AI agent:
"Analyze the UserManager.swift file and find all references to the login() method"
The AI will use SwiftLens tools to:
SwiftLens includes a web dashboard for monitoring AI interactions:
Rebuild your index:
swift build -Xswiftc -index-store-path -Xswiftc .build/index/store
New files need to be indexed:
swift build -Xswiftc -index-store-path -Xswiftc .build/index/store
Ensure Xcode is properly installed:
xcode-select -p # Should show Xcode path
xcrun sourcekit-lsp --help # Should show help text
The SwiftLens MCP Server accurately reflects SourceKit-LSP's capabilities. The following are known limitations of SourceKit-LSP itself, not bugs in this tool:
object.property often don't provide hover information when inside functionsThese limitations exist because SourceKit-LSP:
For the most up-to-date status, see the SourceKit-LSP repository.
# All tests
make test
# Unit tests only (fast, no LSP required)
make test-unit
# LSP integration tests
make test-lsp
# Check environment
make check-env
# Format code
./format.sh
# Check formatting
./format.sh check
See LICENSE.md for details.
We welcome contributions! Areas where you can help:
SwiftLens - Bringing compiler-grade Swift understanding to AI development