open-repo-mcp
v1.0.2
Published
CLI to run local MCP server for indexing local code repositories. Parse, search and serve your codebase to AI agents via the Model Context Protocol.
Maintainers
Readme
Open Repo MCP
Index your codebase and expose it to AI agents via the Model Context Protocol.
Open source notice
This project is part of the Open Collective project Simply Hexagonal and is open to updates by its users, we ensure that PRs are relevant to the community. In other words, if you find a bug or want a new feature, please help us by becoming one of the contributors ✌️ ! See the contributing section.
Like this module? ❤
Please consider:
- Buying me a coffee ☕
- Supporting me on Patreon 🏆
- Starring this repo on Github 🌟
AI and Compliance Notice
The ⛩️ OpenKai quality framework for AI-assisted production was used in the creation of this project, making it ISO 42001 compliant by ensuring human oversight and governance.
30% Human · 70% AI · 100% epic
Quick Start
# Install (with VS Code MCP configuration)
npx open-repo-mcp init --vscode
# Start the server
npx open-repo-mcp start
# Index your repository
npx open-repo-mcp indexOr with Bun:
bunx open-repo-mcp init --vscode
bunx open-repo-mcp start
bunx open-repo-mcp indexWhat It Does
open-repo-mcp parses your codebase using Tree-sitter AST parsing, extracts symbols (functions, classes, types, interfaces, etc.), optionally generates AI-powered summaries, and serves everything through an MCP server that AI tools can query.
Supported languages:
- TypeScript
- JavaScript
- TSX
- Python
- Go
- Rust
Planned additional language support:
- C#/.Net
- Java
- PHP
- C
- C++
- Zig
- Bash/Shell
- Terraform
- Ansible
AI Tool Configuration
VS Code / GitHub Copilot / Claude
Use the --vscode flag during init to automatically create .vscode/mcp.json:
open-repo-mcp init --vscodeThis creates (or updates) .vscode/mcp.json with:
{
"servers": {
"open-repo-mcp": {
"url": "http://localhost:3100/open-repo-mcp/mcp",
"type": "http"
}
},
"inputs": []
}If .vscode/mcp.json already exists, the open-repo-mcp server entry is upserted without affecting other servers.
Alternatively, add the configuration manually to .vscode/mcp.json.
MCP Tools
The server exposes 13 tools via MCP:
| Tool | Description |
|------|-------------|
| health | Server health check |
| index_repo | Index the full repository (incremental by default) |
| index_files | Index specific files by path |
| index_directories | Index specific directories |
| get_symbol_count | Get total indexed symbol/file count |
| delete_index | Delete the persisted index |
| search_symbols | Search symbols by name or summary |
| search_text | Full-text search across file contents |
| get_symbol | Get full details of a specific symbol |
| get_file_outline | Get all symbols in a file |
| get_file_content | Get raw file content |
| get_file_tree | Get the indexed file tree |
| get_repo_outline | Get a high-level overview of all indexed files and symbols |
Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| PORT | 3100 | Server port |
| REPO_ROOT | Parent directory | Root of the repository to index |
| INDEX_FILE_PATH | <repo>/open-repo-mcp/index.json | Where to store the persisted index |
| LOG_LEVEL | info | Log level (debug, info, warn, error) |
| ANTHROPIC_API_KEY | — | Anthropic API key for AI summaries |
| OPENAI_API_KEY | — | OpenAI API key for AI summaries |
| GOOGLE_GENERATIVE_AI_API_KEY | — | Google AI API key for AI summaries |
| AI_PROVIDER | anthropic | AI provider (anthropic, openai, google) |
| AI_MODEL | Provider default | AI model to use for summaries |
| SUMMARY_MAX_LENGTH | 500 | Maximum character length for symbol summaries |
CLI Commands
# Initialize server in current repo
open-repo-mcp init [--force] [--vscode]
# Start the MCP server
open-repo-mcp start [--port 3100] [--foreground] [--dev-mode]
# Index the repository
open-repo-mcp index [--port 3100] [--force]Supported Platforms
| Platform | Architecture | |----------|--------------| | macOS | ARM64 (Apple Silicon) | | macOS | x64 (Intel) | | Linux | ARM64 | | Linux | x64 | | Windows | x64 |
Development
# Install dependencies
bun install
# Run server in dev mode
bun run dev:server
# Run CLI in dev mode
bun run dev:cli
# Run tests
bun run test
# Build platform binaries
bun run build
# Build server asset
bun run build:server-asset
# Bump version
bun run version:bump 0.2.0Contributing
Yes, thank you! This plugin is community-driven, most of its features are from different authors.
Please update the docs and tests and add your name to the package.json file.
Contributors ✨
Thanks goes to these wonderful people (emoji key):
License
Copyright (c) 2026 open-repo-mcp Contributors. Licensed under the Apache License 2.0.
