
Codesurface
io.github.CodeturionPublished by GitHub account Codeturionv0.8.0Updated Nov 10, 2026
Indexes your codebase's public API and serves it via compact MCP tool responses.
Overview
Indexes a local codebase's public API and serves compact class, method, and signature lookups to an AI assistant.
- What you can do
- Parses source files at startup and extracts public classes, methods, properties, fields, and events into a local index. Exposes five tools: search for APIs by keyword, get_signature for exact signatures, get_class for a full class reference card, get_stats for an index overview, and reindex for incremental updates. Results include file paths and line numbers so the assistant can do targeted reads instead of opening whole files. Supported languages are C#, C++ headers, Go, Java, Python, and TypeScript/JavaScript.
- When to use it
- Useful when an assistant repeatedly greps and reads large source trees to answer questions about a codebase's API, and you want fewer tokens spent on file reads. Best for projects in the supported languages where the assistant needs class and method lookups rather than implementation details.
- Requirements
- Runs locally as a stdio process, typically via uvx or pip install, and needs Python 3.10 or newer plus the mcp[cli] package. It requires a --project path pointing at a directory of supported source files; languages are auto-detected. No accounts, API keys, or network access are declared. Desktop-only; not available as a web executable.
Installation
In SourceWeft
- Open Codesurface in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
codesurface
[PyPI Version] [PyPI Downloads] [MCP Registry] [GitHub Stars] [GitHub Last Commit] [Languages] [License: MIT] [Python 3.10+] [Blog Post]
MCP server that indexes your codebase's public API at startup and serves it via compact tool responses, saving tokens vs reading source files.
Parses source files, extracts public classes/methods/properties/fields/events, and serves them through 5 MCP tools. Works with Claude Code, Cursor, Windsurf, or any MCP-compatible AI tool.
Supported languages: C# (.cs), C++ headers (.h, .hpp, .hxx, .h++), Go (.go), Java (.java), Python (.py), TypeScript/JavaScript (.ts, .tsx, .js, .jsx)
Quick Start
Add to your .mcp.json:
Point --project at any directory containing supported source files (a Unity Assets/Scripts folder, a Spring Boot project, a .NET src/ tree, a Node.js/React project, a Python package, etc.). Languages are auto-detected.
Restart your AI tool and ask: "What methods does MyService have?"
CLAUDE.md Snippet
Add this to your project's CLAUDE.md (or equivalent instructions file). This step is important. Without it, the AI has the tools but won't know when to reach for them.
Tools
search, get_signature, and get_class accept two optional filters:
file_path: scope results to a directory prefix or exact file (e.g."src/services/"or"src/services/MergeService.ts")include_tests: include test files in results (defaultfalse). Detects__tests__/,tests/,test/,*.test.*,*.spec.*,*_test.*,test_*
Tested On
Line Numbers for Targeted Reads
Every record includes line_start and line_end (1-indexed). Multi-line declarations span the full signature:
This lets AI agents do targeted reads instead of reading full files:
Benchmarks
Measured across 5 real-world projects in 5 languages, each using a 10-step cross-cutting research workflow.
[Total Tokens, Cross-Language Comparison]
Even with follow-up reads for implementation detail, the hybrid MCP + targeted Read approach uses 44% fewer tokens than a skilled Grep+Read agent and 87% fewer than a naive agent:
Per-question breakdown
See workflow-benchmark.md for the full step-by-step analysis across all languages.
Filtering What Gets Indexed
By default, codesurface skips common vendored, build, and VCS directories: node_modules, vendor, bin, obj, dist, build, target, .git, .venv, __pycache__, and a few dozen others. Git worktrees and submodules are also skipped.
To exclude additional paths:
Project-level (committed): create a .codesurfaceignore file at your project root with one glob per line.
Per-instance (CLI): pass --exclude with comma-separated globs.
Other indexing flags:
--include-submodules: index git submodules (skipped by default)--language <name>: pin to a single parser (e.g.--language cpp) instead of auto-detecting
Multiple Projects
Each --project flag indexes one directory. To index multiple codebases, run separate instances with different server names:
Each instance gets its own in-memory index and tools. The AI agent sees both and can query across projects.
Setup Details
Alternative installation methods
Using pip install:
Project structure
Troubleshooting
"No codebase indexed"
- Ensure
--projectpoints to a directory containing supported source files (.cs,.h,.hpp,.go,.java,.py,.ts,.tsx,.js,.jsx) - The server indexes at startup. Check stderr for
[codesurface] scanning N files...and[codesurface] done:lines
Server won't start
- Check Python version:
python --version(needs 3.10+) - Check
mcp[cli]is installed:pip install mcp[cli]
Stale results after editing source files
- The index auto-refreshes on query misses. If you add a new class and query it, the server reindexes and retries automatically
- You can also call
reindex()manually to force an incremental update
Contact
License
Source: README.md at commit 3845446
Tools
0Version history
1- v0.8.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts