SwiftVectorKit
On-device semantic code search and vector indexing for Swift, Xcode, and AI agents. 100% local on Apple Silicon.
Install / Use
claude mcp add alexpospekhov -- npx -y github:alexpospekhov/SwiftVectorKitIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of SwiftVectorKit
SwiftVectorKit scores 71/100 on our quality scale, 3855th of 4,698 Development & Engineering skills we index.
Its MCP Server is 9.7 KB long, well organised into 25 sections with 9 code examples: a thorough specification that gives an agent plenty to work with.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so SwiftVectorKit is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
SwiftVectorKit compared with similar skills
All 4 of these similar skills score higher than SwiftVectorKit; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| SwiftVectorKit (this skill)by alexpospekhov | 71 | 3 | 45d ago | MCP Server |
| taste-skillby Leonxlnx | 100 | 116.8k | 8d ago | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 112.3k | 8d ago | CLAUDE.md |
| rufloby ruvnet | 100 | 81.9k | today | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.8k | today | CLAUDE.md |
Frequently asked questions
- How do I install SwiftVectorKit?
- Run
claude mcp add alexpospekhov -- npx -y github:alexpospekhov/SwiftVectorKit. The install tabs above show the steps for each supported agent. - Which AI agents does SwiftVectorKit work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is SwiftVectorKit safe to use?
- It is Apache-2.0-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is SwiftVectorKit still maintained?
- The repository was last updated about 2 months ago, so SwiftVectorKit is actively maintained.
Skill content
View source on GitHubTerminal Session

The Problem: Why Keyword Search and Cloud RAG Fail Autonomous Agents
Autonomous software engineering agents (Claude Code, Cursor, Codex, Antigravity, and Xcode agents) face critical bottlenecks when navigating medium-to-large Swift repositories:
1. Context Window Exhaustion and Grep Blindness
Standard string-matching tools (grep, ripgrep, Cmd+Shift+F) match literal characters, not architectural semantics. When an agent searches for "thread-safe vector storage", keyword matching fails to locate @ModelActor final class VectorStore unless the agent already knows the exact type name. Grep-based agents compensate by dumping thousands of irrelevant lines into their context window, inducing attention degradation, token exhaustion, and hallucinated modifications.
2. Cascading Refactoring Failures
Autonomous coding agents lack visibility into symbol blast radiuses. When an agent refactors a protocol, actor isolation boundary, or public interface, it frequently breaks dependent modules across the workspace without realizing it until compiler execution fails, trapping the agent in recursive debug loops.
3. Latency, Recurring API Costs, and Intellectual Property Leakage
Cloud-based code vectorization solutions (Pinecone, Chroma, OpenAI embeddings) introduce severe operational friction:
- Every agent reasoning step incurs 500ms to 2000ms of external network round-trip latency.
- Proprietary enterprise source code is continuously transmitted to third-party model providers.
- Heavy Python-based RAG sidecars (LangChain, Docker, virtual environments) add massive foreign dependencies incompatible with native Swift developer workflows.
The Solution: On-Device Semantic Infrastructure for Agentic Coding
SwiftVectorKit provides an offline, hardware-accelerated code intelligence substrate built specifically for autonomous agents and Apple Silicon:
Sub-3ms Semantic Grounding via Model Context Protocol (MCP)
SwiftVectorKit runs a native stdio Model Context Protocol (MCP) server (swiftvectorkit mcp). Autonomous agents can issue natural language architectural intent queries ("where is actor reentrancy handled in memory stores?") and receive precise AST declaration chunks with file paths, symbol boundaries, and line ranges in under 3 milliseconds. An agent can execute hundreds of semantic retrieval passes per task with zero cloud latency and zero token costs ($0).
Swift-Aware AST Semantic Enrichment
Raw source code vectors produce noisy embeddings because compiler punctuation and compound identifiers are not natural language tokens. SwiftVectorKit parses Swift AST declaration boundaries and enriches tokens before vectorization:
- Compound identifiers are split into natural semantic phrases (
AccelerateSIMDDistance->Accelerate SIMD Distance). - Structured docstrings (
/// ...) and parameter contracts are extracted and weighted. - Boosts retrieval cosine similarity from 0.357 to 0.721 (+102%) compared to raw code embedding.
Compiler-Grade Refactoring Diagnostics
Via SwiftVectorAutoIndexPlugin (capability: .buildTool()), SwiftVectorKit incrementally parses and re-indexes AST declarations during every Xcode build (Cmd+B). When high-risk symbol blast radius is detected, the engine emits native compiler diagnostics directly into Xcode's Issue Navigator:
Sources/Core/Storage.swift:42:1: warning: [SwiftVectorKit] High blast radius: modifying 'VectorStore' impacts 14 dependent symbols across 3 targets.
100% Local Hardware Exploitation on Apple Silicon
- Apple Neural Engine (38 TOPS): Executes Core ML transformer embeddings directly on ANE via
MLComputePlan, keeping Metal GPU cores 100% free for UI and simulator rendering. - Apple Accelerate SIMD: Hardware-accelerated batch vector distance calculations (
vDSP_dotpr,vDSP_svesq) evaluating 25,000 code vectors in sub-3ms. - Dual-Tier Apple Foundation Models: Integrated support for local
SystemLanguageModel(~3B parameters) for instant symbol explanation, with seamless fallback toPrivateCloudComputeLanguageModel.
Architecture Specifications
| Module | Architectural Role | Implementation Substrate |
|---|---|---|
| SwiftVectorCore | Domain models, declaration boundaries, semantic AST enrichment | Swift 6.4 Strict Concurrency, Sendable structs |
| SwiftVectorScanner | High-throughput workspace file discovery and filtering | Pure Swift directory enumeration, extension matching |
| SwiftVectorChunker | Swift declaration boundary extraction and brace balance tracking | Deterministic lexical state machine |
| SwiftVectorTokenizer | Compound identifier splitting and docstring cleaning | Pure Swift BPE / WordPiece tokenizer |
| SwiftVectorSIMD | Batch vector cosine similarity ranking | Apple Accelerate.framework (vDSP_dotpr, vDSP_svesq) |
| SwiftVectorCoreML | Neural embedding inference on Apple Neural Engine | Core ML (MLModel, MLComputePlan, NLEmbedding) |
| SwiftVectorStorage | Actor-isolated in-memory store with Reciprocal Rank Fusion | Swift Actor, atomic JSON persistence |
| SwiftVectorFM | Apple Foundation Models bridge for automated code explanation | FoundationModels.framework (SystemLanguageModel, PCC) |
| SwiftVectorSCIP | Symbol graph resolution and refactoring blast radius analysis | SCIP symbol graph indexer, swift-subprocess |
| SwiftVectorMCP | Stdio JSON-RPC 2.0 server for AI IDEs | Claude Code, Cursor, Antigravity, xcrun mcpbridge |
| SwiftVectorAutoIndexPlugin | Incremental AST indexing during Xcode builds (Cmd+B) | Swift Package Manager BuildToolPlugin |
| SwiftVectorCLI | Standalone executable command-line interface | Universal Mach-O arm64 binary (swiftvectorkit) |
Installation
1. Homebrew (macOS CLI & MCP Server)
Install the compiled binary and MCP server on Apple Silicon:
brew install alexpospekhov/tap/swiftvectorkit
Verify installation:
swiftvectorkit status
2. Swift Package Manager (Xcode Projects & Build Plugins)
To embed SwiftVectorKit as a library or enable automatic build-time AST indexing in your Xcode target:
Add to Package.swift:
dependencies: [
.package(url: "https://github.com/alexpospekhov/SwiftVectorKit.git", from: "0.1.0")
]
Link the library:
.target(
name: "MyTarget",
dependencies: [
.product(name: "SwiftVectorKit", package: "SwiftVectorKit")
]
)
Enable automatic build-time indexing (Cmd+B):
.target(
name: "MyTarget",
plugins: [
.plugin(name: "SwiftVectorAutoIndexPlugin", package: "SwiftVectorKit")
]
)
3. Standalone Pre-compiled Binary
Download the compiled arm64 Mach-O binary directly from GitHub Releases:
curl -fsSL https://github.com/alexpospekhov/SwiftVectorKit/releases/download/v0.1.0/swiftvectorkit-macos-arm64.tar.gz | tar -xz
sudo mv swiftvectorkit swiftvector /usr/local/bin/
CLI Usage
Both swiftvectorkit and swiftvector commands are supported:
# Check Apple Silicon hardware acceleration and Foundation Models status
swiftvectorkit status
# Index a workspace or directory
swiftvectorkit index Sources/
# Execute hybrid semantic search
swiftvectorkit search "Accelerate SIMD cosine distance" --limit 3
# Explain symbol architecture via Apple Foundation Models
swiftvectorkit explain AccelerateSIMDDistance
# Launch stdio MCP server for Claude Code, Cursor, and Antigravity
swiftvectorkit mcp
Agentic IDE Configuration (Cursor, Claude Code, Antigravity)
To configure SwiftVectorKit as an MCP server for autonomous coding agents, add the following configuration:
Cursor (~/.cursor/mcp.json) / Claude Code (~/.claude/mcp.json):
{
"mcpServers": {
"swiftvectorkit": {
"command": "/opt/homebrew/bin/swiftvectorkit",
"args": ["mcp"]
}
}
}
Architecture & Technical References
- Architecture Specification (
Docs/ARCHITECTURE.md) - Release Roadmap (
Docs/ROADMAP.md) - Xcode 27 & Apple FM SDK Audit (
Docs/SDK_AUDIT.md)
License
SwiftVectorKit is released under the Apache License 2.0.
Related Skills
taste-skill
116.8kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
ruflo
81.9k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
headroom
79.8kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
