📇 🏠 ☁️ - Convert source code repositories into searchable knowledge bases using chunking, OpenAI embeddings…
Source Code to Knowledge Base Generator with MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Convert any source code repository into a searchable knowledge base with automatic chunking, embedding generation, and intelligent search capabilities. Now with MCP (Model Context Protocol) support for Claude Code and Cursor integration!
📦 **Now available on npm!** Install with: npm install -g @vezlo/src-to-kb
Available Commands
After installation, you'll have access to these commands:
- **src-to-kb** - Generate knowledge base from source code
- **src-to-kb-search** - Search the knowledge base
- **src-to-kb-upload** - Upload local knowledge base to external server
- **src-to-kb-api** - Start REST API server with Swagger docs
- **src-to-kb-mcp** - Start MCP server for IDE integration
- **src-to-kb-mcp-install** - Auto-configure Claude Code/Cursor
Features
- 📁 **Multi-language Support**: JavaScript, TypeScript, Python, Java, C++, Go, Rust, and more
- 📝 **Notion Integration**: Import pages and databases directly from Notion (NEW!)
- 🎯 **Answer Modes**: Three modes for different users - End User (simple), Developer (technical), Copilot (code-focused)
- 🌐 **REST API**: Full-featured API with Swagger documentation for integration with external services
- 🔍 **Smart Chunking**: Intelligent code splitting with configurable overlap
- 🧹 **Code Cleaning**: Optional comment removal and whitespace normalization
- 🔢 **Embeddings**: Optional OpenAI embeddings for semantic search
- 📊 **Statistics**: Comprehensive analysis of your codebase
- 🚀 **Fast Processing**: Efficient file scanning and processing
- 💾 **Structured Storage**: Organized JSON output for easy integration
- 🤖 **MCP Server**: Direct integration with Claude Code, Cursor, and other MCP-compatible tools
- 💡 **AI-Powered Search**: Uses OpenAI GPT-5 (latest reasoning model) for intelligent query understanding and helpful answers
- 🔐 **API Authentication**: Optional API key authentication for secure access
- 🌐 **External Server Integration**: Send code to external servers for processing and search via REST API
Quick Start
🚀 For Existing Projects (Next.js, React, etc.)
**That's it!** Your codebase is now searchable with AI assistance.
Processing Modes & Flags
The following table shows how flags work across different sources and modes:
| Source | Mode | Default (no flags) | --chunks-only | --with-embeddings |
|--------|------|-------------------|-----------------|---------------------|
| **Codebase** | Local | Creates chunks | Same (redundant) | Creates chunks + embeddings |
| **Codebase** | Server | Sends raw content | Creates chunks → sends | Creates chunks + embeddings → sends |
| **Notion** | Local | Creates chunks | Same (redundant) | Creates chunks + embeddings |
| **Notion** | Server | Sends raw content | Creates chunks → sends | Creates chunks + embeddings → sends |
**Note**: Server mode is enabled when EXTERNAL_KB_URL environment variable is set.
External Server Integration 🌐
🚀 Try It Now with Public Demo Server
Experience external server integration immediately with our production-ready assistant-server:
**Assistant Server**: vezlo/assistant-server - Production-ready Node.js/TypeScript API server with vector search and Docker deployment
📤 Upload Local Knowledge Base
Upload an existing local knowledge base to an external server:
**Requirements:**
- EXTERNAL_KB_URL environment variable must be set
- Knowledge base must have documents/ and chunks/ directories
- For --with-embeddings: embeddings/ directory must exist
🏢 Enterprise Setup
For production deployments or custom servers:
📖 **Complete Guide**: External Server Setup Guide
Notion Integration 📝
**NEW!** Import your Notion pages and databases directly into your knowledge base! Perfect for combining documentation, project plans, and code knowledge in one searchable system.
Quick Start with Notion
With External Server