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
Available Tools
5 toolsget_classA
Get a complete reference card for a class — all public members.
Shows every method, property, field, and event with signatures. Replaces reading the entire source file.
Args: class_name: Class name, e.g. "BlastBoardModel", "IMergeService", "CampGridService" file_path: Optional path prefix to scope the lookup include_tests: If true, include test files in results (default false)
| Name | Required | Description | Default |
|---|---|---|---|
| class_name | Yes | ||
| file_path | No | ||
| include_tests | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It explains what the tool returns but does not disclose any side effects, permissions, or performance traits. The tool is inherently read-only, but this is not explicitly stated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, with a brief front-loaded statement of purpose followed by a clear Arguments block. Every sentence serves a purpose without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema, the description appropriately focuses on input parameters and overall purpose. However, it lacks details on error handling, permissions, or performance, which would be helpful given no annotations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description adds significant value: it provides concrete examples for class_name, explains file_path as an optional scope prefix, and clarifies include_tests defaults. This compensates for the lack of schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns a complete reference card of a class's public members, including methods, properties, fields, and events. It distinguishes from siblings like get_signature (which likely targets a single member) by emphasizing the full class overview.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description mentions it 'replaces reading the entire source file,' implying a use case for quick class overview, but does not explicitly compare to alternatives like get_signature or specify when not to use this tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_signatureA
Look up the exact signature of an API member by name or FQN.
Use when you need exact parameter types, return types, or method signatures without reading the full source file.
Args: name: Member name or FQN, e.g. "TryMerge", "CampGame.Services.IMergeService.TryMerge" file_path: Optional path prefix to scope the lookup include_tests: If true, include test files in results (default false)
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| file_path | No | ||
| include_tests | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full burden. It describes a read-only lookup but does not disclose behavioral traits like error handling (e.g., if member not found), authentication requirements, or side effects. The description is adequate but lacks depth.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise: a one-line purpose, a usage recommendation, and a well-structured args list. It could be slightly more streamlined, but it is efficient and free of fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 3 parameters and an output schema (so return values are documented elsewhere), the description covers the essential context: arguments, usage guidance, and scope (FQN examples). It lacks details on error states but is otherwise complete for a lookup tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% coverage for parameter descriptions. The description compensates by providing detailed explanations for all three parameters: 'name' (with examples), 'file_path' (optional path prefix), and 'include_tests' (default false). This adds significant meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Look up the exact signature of an API member by name or FQN.' This is a specific verb+resource, and it distinguishes itself from sibling tools like 'get_class' (likely for class definitions) and 'search' (general search).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides usage context: 'Use when you need exact parameter types, return types, or method signatures without reading the full source file.' While it does not explicitly list alternatives or when-not-to-use, the context is clear and the sibling tools list helps.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_statsA
Get a quick overview of the indexed codebase.
Shows file count, record counts by type, and namespace breakdown.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It mentions the kind of data returned but does not disclose any behavioral traits like side effects, rate limits, or authentication requirements. For a simple read-only tool with no parameters, this is minimally adequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences long, front-loaded, and every sentence adds value. There is no fluff or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema (not shown but flagged), the description does not need to detail return format. It provides a complete overview of what the tool does, and the tool's simplicity (no params, no side effects) means nothing is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are no parameters, so the input schema is fully covered (100%). Per guidelines, a baseline of 4 is appropriate since the description adds no param-specific info beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses specific verbs ('Get') and resources ('quick overview'), and lists the specific metrics returned (file count, record counts by type, namespace breakdown). It clearly distinguishes from siblings like get_class and get_signature which are more specific.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage as a top-level summary tool, but does not explicitly state when to use or when not to use it versus alternatives. The sibling tools provide context, but no exclusions are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
reindexA
Incrementally update the index by re-parsing only changed, new, or deleted files.
Uses file modification times to detect changes. Fast on large codebases — only touches files that actually changed since the last index.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses key behavioral traits: incremental, uses file modification times, only touches changed files. However, it omits details like whether the operation is idempotent, locks the index, or has any side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise: three sentences, front-loaded with the purpose. Every sentence adds value without unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no parameters and an existing output schema, the description provides adequate context for a mutation tool. It explains the mechanism and efficiency, but could briefly mention the output format or return value.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has no parameters, and schema coverage is 100% (trivially). The description does not need to add parameter info; it is sufficient as is.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it incrementally updates the index by re-parsing only changed, new, or deleted files. It uses a specific verb ('Incrementally update') and resource ('index'), distinguishing it from sibling read-only tools like get_class and search.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides context on when to use (fast incremental updates based on file modification times) but does not explicitly state when not to use or mention alternatives like a full reindex. No preconditions are listed.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
searchA
Search the indexed API by keyword.
Find classes, methods, properties, fields, and events. Returns ranked results with signatures.
Args: query: Search terms (e.g. "MergeService", "BlastBoard", "GridCoord") n_results: Max results to return (default 5, max 20) member_type: Optional filter — "type", "method", "property", "field", or "event" file_path: Optional path prefix or exact file to scope results (e.g. "src/services/" or "src/services/foo.ts") include_tests: If true, include test files in results (default false)
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| n_results | No | ||
| member_type | No | ||
| file_path | No | ||
| include_tests | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It mentions 'Returns ranked results with signatures,' which adds behavioral context, but does not disclose performance, error handling, or what happens with empty results. It is adequate but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured. It starts with the core purpose, then lists what is found, and uses a clear bullet-like format for parameters. Every sentence adds value without unnecessary verbosity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool complexity (5 parameters, 1 required) and the presence of an output schema, the description is complete. It covers input parameters, their defaults, and the nature of the output (ranked results with signatures). No further information seems necessary for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description provides detailed explanations for each parameter beyond the schema. For example, 'file_path: Optional path prefix or exact file to scope results (e.g. 'src/services/' or 'src/services/foo.ts')' adds valuable context. All five parameters are clearly described.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Search the indexed API by keyword.' It lists specific resources found (classes, methods, properties, fields, events) and distinguishes from sibling tools like get_class and get_signature, which focus on specific lookups.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use the tool (keyword search) and details optional filters (n_results, member_type, file_path, include_tests). It implicitly differentiates from siblings by focusing on search vs. direct retrieval, but lacks explicit 'when not to use' or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
v0.8.0- First observed
get_class - First observed
get_signature - First observed
get_stats - First observed
reindex - First observed
search
TDQS
Each tool has a clearly distinct purpose: get_class for full class reference, get_signature for specific member signatures, get_stats for overview statistics, reindex for incremental indexing, and search for keyword-based discovery. No functional overlap exists.
All tool names follow a consistent verb_noun pattern using snake_case (get_class, get_signature, get_stats, reindex, search). The naming is predictable and intuitive.
Five tools are well-scoped for a code indexing server: providing search, member details, class overview, statistics, and index maintenance. This count is neither too sparse nor too heavy.
The tool set covers all essential operations for code exploration and indexing: searching, retrieving member signatures, getting full class documentation, viewing codebase statistics, and incremental reindexing. No obvious gaps for the stated purpose.
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 Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceAgent-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.3,448,4193AGPL 3.0
- AlicenseAqualityDmaintenanceLocal-first MCP server for semantic + keyword hybrid code search. Zero external services, no API keys required.2MIT
- AlicenseNot gradedqualityDmaintenanceUniversal MCP server that analyzes any codebase and provides structured context to AI assistants. Dynamic, accurate, and token-efficient.14MIT
- FlicenseNot gradedqualityDmaintenanceGive your AI coding agents superpowers — a local MCP server for fast, token-efficient code navigation, search & analysis.-
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