codesurface
This MCP server indexes your codebase's public API and provides compact tool responses for token-efficient navigation without reading full source files. You can:
Search for API elements by keyword using the
searchtool, with optional filters for member type, file path, and test inclusion.Retrieve exact signatures using
get_signatureby name or fully qualified name, returning parameter types, return types, and file locations.Get class overviews with
get_class, listing all public members with signatures and line numbers.Monitor indexing stats via
get_stats(file count, record types, namespaces).Incrementally update the index with
reindex, re-parsing only changed files.Reduce token usage by leveraging line numbers for targeted reads.
Support multiple languages including C#, C++, Go, Java, Python, and TypeScript/JavaScript.
Index multiple projects by running separate server instances.
Auto-exclude vendored/build files and customize exclusions via
.codesurfaceignoreor--exclude.Auto-reindex on query misses to keep stale results current.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@codesurfacewhat methods does MyService have?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
codesurface
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:
{
"mcpServers": {
"codesurface": {
"command": "uvx",
"args": ["codesurface", "--project", "/path/to/your/src"]
}
}
}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?"
Related MCP server: embecode
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.
## Codebase API Lookup (codesurface MCP)
Use codesurface MCP tools BEFORE Grep, Glob, Read, or Task (subagents) for any class/method/field lookup. This applies to you AND any subagents you spawn.
| Tool | Use when | Example |
|------|----------|---------|
| `search` | Find APIs by keyword | `search("MergeService")` |
| `get_signature` | Need exact signature | `get_signature("TryMerge")` |
| `get_class` | See all members on a class | `get_class("BlastBoardModel")` |
| `get_stats` | Codebase overview | `get_stats()` |
Every result includes file path + line numbers. Use them for targeted reads:
- `File: Service.cs:32` → `Read("Service.cs", offset=32, limit=15)`
- `File: Converter.java:504-506` → `Read("Converter.java", offset=504, limit=10)`
Never read a full file when you have a line number. Only fall back to Grep/Read for implementation details (method bodies, control flow).Tools
Tool | Purpose | Example |
| Find APIs by keyword | "MergeService", "BlastBoard", "GridCoord" |
| Exact signature by name or FQN | "TryMerge", "CampGame.Services.IMergeService.TryMerge" |
| Full class reference card with all public members | "BlastBoardModel" → all methods/fields/properties |
| Overview of indexed codebase | File count, record counts, namespace breakdown |
| Incremental index update (mtime-based) | Only re-parses changed/new/deleted files. Also runs automatically on query misses |
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
Project | Language | Files | Records | Time |
TypeScript | 6,611 | 88,293 | 9.3s | |
Java | 2,909 | 33,973 | 2.3s | |
Go | 219 | 2,760 | 0.4s | |
Python | 1,880 | 12,418 | 1.1s | |
Python | 365 | 9,648 | 0.3s | |
Java | 891 | 8,377 | 2.4s | |
TypeScript | 919 | 7,957 | 0.6s | |
Python | 881 | 5,713 | 0.5s | |
TypeScript | 2,947 | 5,452 | 0.9s | |
TypeScript | 4,903 | 5,038 | 1.9s | |
Python | 386 | 2,473 | 0.3s | |
Python | 63 | 872 | <0.1s | |
Go | 15 | 249 | <0.1s | |
Go | 41 | 574 | <0.1s | |
Unity game (private) | C# | 129 | 1,018 | 0.1s |
Line Numbers for Targeted Reads
Every record includes line_start and line_end (1-indexed). Multi-line declarations span the full signature:
[METHOD] com.google.common.base.Converter.from
Signature: static Converter<A, B> from(Function<...> forward, Function<...> backward)
File: Converter.java:504-506 ← multi-line signature
[METHOD] server.AlbumController.createAlbum
Signature: createAlbum(@Auth() auth: AuthDto, @Body() dto: CreateAlbumDto)
File: album.controller.ts:46 ← single-lineThis lets AI agents do targeted reads instead of reading full files:
# Instead of reading the entire 600-line file:
Read("Converter.java") # 600 lines, ~12k tokens
# Read just the method + context:
Read("Converter.java", offset=504, limit=10) # 10 lines, ~200 tokensBenchmarks
Measured across 5 real-world projects in 5 languages, each using a 10-step cross-cutting research workflow.

Language | Project | Files | Records | MCP | Skilled | Naive | MCP vs Skilled |
C# | Unity game | 129 | 1,034 | 1,021 | 4,453 | 11,825 | 77% fewer |
TypeScript | immich | 694 | 8,344 | 1,451 | 4,500 | 14,550 | 68% fewer |
Java | guava | 891 | 8,377 | 1,851 | 4,200 | 26,700 | 56% fewer |
Go | gin | 38 | 534 | 1,791 | 2,770 | 15,300 | 35% fewer |
Python | codesurface | 9 | 40 | 753 | 2,000 | 10,400 | 62% fewer |

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.
generated/**
docs/**
**/*.pb.goPer-instance (CLI): pass --exclude with comma-separated globs.
{
"command": "uvx",
"args": ["codesurface", "--project", "src", "--exclude", "generated/**,vendor/**"]
}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:
{
"mcpServers": {
"codesurface-backend": {
"command": "uvx",
"args": ["codesurface", "--project", "/path/to/backend/src"]
},
"codesurface-frontend": {
"command": "uvx",
"args": ["codesurface", "--project", "/path/to/frontend/src"]
}
}
}Each instance gets its own in-memory index and tools. The AI agent sees both and can query across projects.
Setup Details
Using pip install:
pip install codesurface{
"mcpServers": {
"codesurface": {
"command": "codesurface",
"args": ["--project", "/path/to/your/src"]
}
}
}codesurface/
├── src/codesurface/
│ ├── server.py # MCP server with 5 tools
│ ├── db.py # SQLite + FTS5 database layer
│ ├── filters.py # PathFilter (default exclusions, .codesurfaceignore, --exclude)
│ └── parsers/
│ ├── base.py # BaseParser ABC
│ ├── cpp.py # C++ header parser
│ ├── csharp.py # C# parser
│ ├── go.py # Go parser
│ ├── java.py # Java parser
│ ├── python_parser.py # Python parser
│ └── typescript.py # TypeScript/JavaScript parser
├── pyproject.toml
└── README.md"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
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityBmaintenanceAgent-safe code retrieval MCP server that indexes repositories and provides semantic search, file navigation, call graph analysis, and bounded file reading tools for coding agents.Last updated3,814,6963MIT
- Alicense-qualityDmaintenanceLocal-first MCP server for semantic + keyword hybrid code search. Zero external services, no API keys required.Last updatedMIT
- Alicense-qualityCmaintenanceUniversal MCP server that analyzes any codebase and provides structured context to AI assistants. Dynamic, accurate, and token-efficient.Last updated12MIT
- Flicense-qualityDmaintenanceGive your AI coding agents superpowers — a local MCP server for fast, token-efficient code navigation, search & analysis.Last updated
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Codeturion/codesurface'
If you have feedback or need assistance with the MCP directory API, please join our Discord server