loading…
Search for a command to run...
loading…
Indexes internal code libraries and exposes them via MCP for AI agents to provide context-aware assistance on company-internal libraries.
Indexes internal code libraries and exposes them via MCP for AI agents to provide context-aware assistance on company-internal libraries.
Turn your internal code libraries into AI-accessible knowledge sources.
SimpleCodeMCP is an open-source tool that indexes internal code libraries and exposes them through a Model Context Protocol (MCP) server. This enables AI coding agents (Claude, GitHub Copilot, etc.) to provide precise, context-aware assistance for company-internal libraries—even when documentation is sparse or outdated.
In many organizations:
pythonpackage1)SimpleCodeMCP scans and indexes your internal library's:
It then exposes this knowledge through an MCP server that AI agents can query to:
┌─────────────────────────────────────────────────────────┐
│ Your Library Repository │
│ ├── src/ (source code) │
│ ├── tests/ (usage examples) │
│ └── examples/ (additional examples) │
└────────────────────┬────────────────────────────────────┘
│
▼
┌──────────────────────┐
│ Indexer Component │
│ ───────────────── │
│ • AST Parser │ Extract structure
│ • Docstring Parser │ Extract documentation
│ • Test Parser │ Find usage patterns
│ • Static Analyzer │ Infer types & relationships
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ Storage Layer │
│ ───────────────── │
│ • ChromaDB │ Semantic search (embeddings)
│ • Metadata Store │ Signatures, paths, etc.
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ MCP Server │
│ (FastAPI + MCP SDK) │
│ ───────────────── │
│ Available Tools: │
│ • list_api │
│ • get_signature │
│ • search_code │
│ • get_examples │
│ • get_tests │
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ AI Agent (Client) │
│ Claude, Copilot, │
│ or any MCP client │
└──────────────────────┘
See EMBEDDING_PROVIDERS.md for detailed comparison and setup.
The server exposes the following tools to AI agents:
list_apiLists all available functions, classes, and modules in the library.
Parameters:
module (optional): Filter by specific module/namespaceReturns:
{
"functions": ["calculate_total", "validate_email"],
"classes": ["User", "Order"],
"modules": ["core", "utils", "api"]
}
get_signatureRetrieves detailed signature information for a function or class.
Parameters:
name: Function or class nameReturns:
{
"name": "calculate_total",
"signature": "calculate_total(items: List[Item], tax_rate: float = 0.19) -> Decimal",
"docstring": "Calculate the total price including tax...",
"file": "src/billing.py",
"line": 45,
"parameters": [
{"name": "items", "type": "List[Item]", "required": true},
{"name": "tax_rate", "type": "float", "default": "0.19"}
],
"return_type": "Decimal"
}
search_codeSemantic search across the codebase using natural language.
Parameters:
query: Natural language query (e.g., "How do I validate an email?")limit (optional): Maximum results (default: 10)Returns:
{
"results": [
{
"name": "validate_email",
"relevance_score": 0.92,
"signature": "validate_email(email: str) -> bool",
"docstring": "Validates email format using regex...",
"file": "src/utils/validation.py"
}
]
}
get_examplesRetrieves usage examples from tests and example files.
Parameters:
name: Function or class nameReturns:
{
"examples": [
{
"source": "tests/test_billing.py",
"code": "result = calculate_total(items=[item1, item2], tax_rate=0.19)\nassert result == Decimal('119.00')",
"description": "Basic usage with two items"
}
]
}
get_testsRetrieves all tests related to a function or class.
Parameters:
name: Function or class nameReturns:
{
"tests": [
{
"test_name": "test_calculate_total_with_default_tax",
"file": "tests/test_billing.py",
"line": 12,
"code": "..."
}
]
}
pip install simplecode-mcp
This project uses uv for fast Python package management:
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone the repository
git clone https://github.com/yourusername/simplecode-mcp.git
cd simplecode-mcp
# Install dependencies and create virtual environment
uv sync
# Activate the virtual environment
source .venv/bin/activate # On Unix/macOS
# or
.venv\Scripts\activate # On Windows
Create a configuration file simplecode_mcp.yaml:
library:
name: "my-internal-lib"
path: "/path/to/my-internal-lib"
language: "python" # python, c++, javascript, typescript, java, go
include_private: true # Index _internal functions too
indexing:
trigger: "manual" # manual | on_commit | watch
embedding_model: "local" # local (sentence-transformers) | openai
server:
host: "localhost"
port: 8000
auth: null # Optional: bearer_token for authentication
Index your library:
simplecode-mcp reindex
simplecode-mcp serve
The server will start on http://localhost:8000.
Add the MCP server to your agent's configuration:
For Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"my-internal-lib": {
"command": "simplecode-mcp",
"args": ["serve"],
"cwd": "/path/to/my-internal-lib"
}
}
}
For GitHub Copilot (mcp.json):
{
"servers": {
"my-internal-lib": {
"url": "http://localhost:8000"
}
}
}
Your AI agent can now answer questions like:
calculate_total function?"User class constructor take?"manual: Run simplecode-mcp reindex manuallyon_commit: Automatically reindex on git commits (via git hook)watch: Watch for file changes and reindex automaticallylocal: Use sentence-transformers (e.g., all-MiniLM-L6-v2)
openai: Use OpenAI's embedding API
For internal company use, you can enable bearer token authentication:
server:
auth:
type: "bearer"
token: "your-secret-token"
You maintain an internal Python package used by 10 teams. Instead of answering the same questions repeatedly:
You're implementing a new feature using an unfamiliar internal library:
New team members can explore internal libraries through their AI assistant without digging through outdated wikis or bothering senior developers.
Contributions are welcome! This project uses uv for dependency management.
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and setup
git clone https://github.com/yourusername/simplecode-mcp.git
cd simplecode-mcp
uv sync
# Run tests
uv run pytest
# Run the CLI in development mode
uv run simplecode-mcp --help
MIT License - see LICENSE for details.
Because complex internal libraries deserve simple, accessible knowledge interfaces. No more outdated docs, no more digging through source code—just ask your AI agent.
Built for teams that move fast and break things (but want to break fewer things).
Выполни в терминале:
claude mcp add simplecodemcp -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.