
src-to-kb
Turn any source code repo into a searchable, AI-queryable knowledge base inside Claude or Cursor.
Add to your client
Copy the config for your MCP client and paste it into its config file.
npm install -g @vezlo/src-to-kbPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"src-to-kb": {
"command": "node",
"args": [
"/Users/admin/Documents/AI-Playground/src-to-kb/mcp-server.mjs"
],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Node.js 14+ and npm
- Claude Code, Claude Desktop, or Cursor with MCP support
- The @vezlo/src-to-kb npm package installed (globally recommended)
- OpenAI API key (OPENAI_API_KEY) — optional, only needed for embeddings and AI-powered answers
About src-to-kb
src-to-kb indexes a source code repository into a knowledge base (documents, chunks, and optional embeddings) and exposes that knowledge base to AI assistants over MCP. The MCP server is started via the bundled mcp-server.mjs (or the src-to-kb-mcp command) and gives Claude/Cursor tools to generate a KB, run natural-language search with AI-generated answers, get codebase statistics, list/filter indexed files, and find similar files. The same package also ships a CLI (src-to-kb, src-to-kb-search, src-to-kb-upload) and a REST API server (src-to-kb-api) with Swagger docs, plus Notion import and optional integration with an external assistant-server for production vector search.
Tools & capabilities (7)
generate_kbGenerate a searchable knowledge base from a source code repository by chunking, cleaning, and optionally creating OpenAI embeddings. Params: repoPath (required), outputPath, chunkSize, chunkOverlap, excludePaths, includeExtensions, generateEmbeddings.
search_kbRun an intelligent natural-language search across the knowledge base with AI-generated answers. Params: query (required), kbPath, limit, includeContext.
get_kb_statsReturn comprehensive statistics about an indexed knowledge base, including document/chunk counts, total size, language distribution, and file types. Param: kbPath.
list_kb_filesList all files indexed in the knowledge base, with optional filtering by programming language or file type (code/text/config/web). Params: kbPath, filterByLanguage, filterByType.
find_similarFind files similar to a given file based on structure, language, and content patterns. Params: filePath (required), kbPath, limit.
extract_codeExtract specific code patterns from the codebase (e.g. all React component definitions).
update_kbUpdate the knowledge base with new changes from the source code.
When to use it
- Index an entire codebase so Claude/Cursor can answer questions about how it works
- Onboard new developers by letting them ask natural-language questions about an unfamiliar repo
- Investigate bugs or audit security by searching for relevant code across a large repository
- Discover related files and similar implementations when refactoring
- Prepare code as a knowledge base for RAG systems
Security notes
All processing happens locally on your machine; no code is sent to external servers except optional OpenAI calls when embeddings are enabled (set OPENAI_API_KEY). Knowledge bases are stored in your local filesystem. The software is dual-licensed (AGPL-3.0 for non-commercial use; a commercial license is required for commercial use).
src-to-kb FAQ
Do I need an OpenAI API key?
No. The server and basic keyword search work without one. An OPENAI_API_KEY is only required if you want to generate embeddings for semantic search or AI-generated answers; set it in the MCP server's env.
Is my code sent to external servers?
No. All indexing and search happen locally on your machine. The only outbound calls are optional OpenAI requests when embeddings are enabled. (Pushing to an external assistant-server is a separate, opt-in CLI feature.)
Which editors does it work with?
Any MCP-compatible client. The docs cover Claude Code (via `claude mcp add`), Claude Desktop (via an mcpServers config block), and Cursor.
How do I install and register the server?
Install the package with `npm install -g @vezlo/src-to-kb`, then either run `claude mcp add src-to-kb -- node <path>/mcp-server.mjs`, or add an mcpServers block pointing `node` at mcp-server.mjs to your client config and restart it.
What languages are supported?
JavaScript, TypeScript, Python, Java, C/C++, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, Scala, and more, plus config/markup formats like JSON, YAML, XML, Markdown, HTML/CSS, and SQL.
Alternatives to src-to-kb
Compare all alternatives →Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).
Up-to-date, version-specific library documentation injected into your coding agent.
Code intelligence engine that indexes repos into a persistent knowledge graph for AI coding agents.
Compare src-to-kb with: