codesurface MCP server
✓ VerifiedMengindeks public API dari sebuah codebase dan menyediakan hasil pencarian, signature, serta lookup class yang ringkas ke client AI melalui MCP tools.
Juga dikenal sebagai Codeturion/codesurface
- Stars
- 21
- Tools
- 7
- Unduhan, 30 hari
- 275
- Versi terbaru
- 0.8.0
- Commit terakhir
- 28 Jul 2026
- Lisensi
- MIT
Apa itu codesurface MCP?
codesurface adalah MCP server. Mengindeks public API dari sebuah codebase dan menyediakan hasil pencarian, signature, serta lookup class yang ringkas ke client AI melalui MCP tools. Server ini menyediakan 7 tool, seperti search, get_signature, get_class.
Ringkasan dibuat dari README proyek
Tentang codesurface MCP server
codesurface memungkinkan Anda mengindeks public API dari sebuah codebase untuk menyediakan hasil pencarian yang ringkas bagi AI agent. Tool ini memparsing file source untuk mengekstrak class, method, property, field, dan event, lalu menyajikan data tersebut melalui tools khusus. Pendekatan ini membantu mengurangi penggunaan token dibandingkan dengan membaca seluruh file source dengan cara menyediakan informasi yang tertarget seperti signature dan anggota class.
Developer dapat menggunakan server ini dengan Claude Code, Cursor, Windsurf, atau client kompatibel MCP lainnya. Server ini mendukung berbagai bahasa termasuk C#, C++, Go, Java, Python, dan TypeScript/JavaScript. Setup dilakukan dengan mengarahkan tool ke direktori proyek menggunakan argumen --project melalui uvx atau pip. Server akan mendeteksi bahasa secara otomatis dan melewati direktori umum seperti node_modules atau .git agar index tetap efisien.
Untuk memastikan akurasi, server menyediakan tools untuk mencari berdasarkan keyword, mengambil signature yang tepat, dan melihat daftar lengkap anggota class. Server ini juga menyertakan command reindex untuk update inkremental saat file berubah. Dengan menyediakan nomor baris yang spesifik untuk setiap record, AI client dapat melakukan pembacaan terarah hanya pada segmen kode yang diperlukan saja.
Apa yang bisa Anda lakukan dengannya
- 1Menemukan anggota API tertentuAI agent dapat menemukan service atau class tertentu dengan mencari keyword di dalam codebase.
- 2Mengambil method signature yang tepatDeveloper dapat meminta AI untuk menemukan parameter dan return type yang tepat untuk fungsi tertentu.
- 3Menginspeksi struktur classAnda dapat meminta daftar lengkap dari seluruh public member yang dimiliki oleh class tertentu.
- 4Melakukan pembacaan kode secara terarahAlih-alih membaca seluruh file, AI dapat menggunakan nomor baris dari index untuk membaca baris yang relevan saja.
Ditulis berdasarkan README proyek. Setiap use case diperiksa terhadap kutipan dari README tersebut.
Cara menginstal codesurface MCP
Format diverifikasi 10 Nov 2026Tambahkan ke CursorTambahkan ke GooseInstal codesurface MCP di Claude Code
$ claude mcp add codesurface -- uvx codesurfaceInstal codesurface MCP di Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"codesurface": {
"command": "uvx",
"args": [
"codesurface"
]
}
}
}Instal codesurface MCP di VS Code
.vscode/mcp.json
{
"servers": {
"codesurface": {
"type": "stdio",
"command": "uvx",
"args": [
"codesurface"
]
}
}
}Instal codesurface MCP di VS Code CLI
$ code --add-mcp '{"name":"codesurface","type":"stdio","command":"uvx","args":["codesurface"]}'Instal codesurface MCP di Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"codesurface": {
"command": "uvx",
"args": [
"codesurface"
]
}
}
}Instal codesurface MCP di Codex
$ codex mcp add codesurface -- uvx codesurfaceInstal codesurface MCP di Codex config.toml
~/.codex/config.toml
[mcp_servers.codesurface] command = "uvx" args = ["codesurface"]
Instal codesurface MCP di Gemini CLI
$ gemini mcp add -s user codesurface uvx -- codesurfaceInstal codesurface MCP di Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"codesurface": {
"command": "uvx",
"args": [
"codesurface"
]
}
}
}Tool codesurface MCP 7
Terdeteksi dari READMEsearchget_signatureget_classget_statsreindexfile_pathinclude_tests
| search | — | |
| get_signature | — | |
| get_class | — | |
| get_stats | — | |
| reindex | — | |
| file_path | — | |
| include_tests | — |
Pengecekan otomatis
Berjalan 14 Nov 2026Laporan lengkap →Lolos checks otomatis kami. Ini bukan audit keamanan: baca kodenya dan berikan server akses paling terbatas yang dibutuhkannya. Cara kerja checks
- Source repository terhubung dan dapat dijangkaucodeturion/codesurface is public and reachablegithub.com/codeturion/codesurface ↗Lolos
- Nama paket mencantumkan repositori ini sebagai sumbernyacodesurface names codeturion/codesurface as sourcepypi.org/project/codesurface/ ↗Lolos
- Provenance build (atestasi Sigstore)Sigstore attestation for codesurfacepypi.org/project/codesurface/ ↗Lolos
- Lisensi open source (OSI)MITspdx.org/licenses/MIT.html ↗Lolos
- Ada commit atau release dalam satu tahun terakhirLast commit or release 2026-07-28github.com/codeturion/codesurface ↗Lolos
- OpenSSF ScorecardTidak diperiksa
- Nama package tidak mirip dengan package populerNo popular package one edit away from codesurfaceLolos
- Tidak ada advisory kritis pada paket atau dependensinya37 resolved dependencies checked; no critical advisoryosv.dev ↗Lolos
- Tidak ada instruksi tersembunyi untuk model7 tool descriptions and the README read; no override phrases, credential paths or hidden charactersLolos
- Tools yang bersifat destruktif telah diberi labelNo tool named like delete, drop or execLolos
- Endpoint remote merespons handshake MCPTidak diperiksa
README
Lihat di GitHubcodesurface
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?"
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 |
|---|---|---|
search |
Find APIs by keyword | "MergeService", "BlastBoard", "GridCoord" |
get_signature |
Exact signature by name or FQN | "TryMerge", "CampGame.Services.IMergeService.TryMerge" |
get_class |
Full class reference card with all public members | "BlastBoardModel" → all methods/fields/properties |
get_stats |
Overview of indexed codebase | File count, record counts, namespace breakdown |
reindex |
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 |
|---|---|---|---|---|
| vscode | TypeScript | 6,611 | 88,293 | 9.3s |
| Paper | Java | 2,909 | 33,973 | 2.3s |
| client-go | Go | 219 | 2,760 | 0.4s |
| langchain | Python | 1,880 | 12,418 | 1.1s |
| pydantic | Python | 365 | 9,648 | 0.3s |
| guava | Java | 891 | 8,377 | 2.4s |
| immich | TypeScript | 919 | 7,957 | 0.6s |
| fastapi | Python | 881 | 5,713 | 0.5s |
| ant-design | TypeScript | 2,947 | 5,452 | 0.9s |
| dify | TypeScript | 4,903 | 5,038 | 1.9s |
| crawlee-python | Python | 386 | 2,473 | 0.3s |
| flask | Python | 63 | 872 | <0.1s |
| cobra | Go | 15 | 249 | <0.1s |
| gin | 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-line
This 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 tokens
Benchmarks
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.go
Per-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
Pertanyaan tentang codesurface MCP
Bagaimana cara menambahkan codesurface MCP ke Claude Code?
Jalankan claude mcp add codesurface -- uvx codesurface di terminal Anda. Tambahkan --scope user agar tersedia di semua proyek.
Bagaimana cara menambahkan codesurface MCP ke Cursor?
Buka ~/.cursor/mcp.json dan tambahkan server di bawah mcpServers, menggunakan config Cursor yang ditunjukkan di bagian instalasi di atas.
Tool apa yang disediakan codesurface MCP?
Server ini menyediakan 7 tool, termasuk search, get_signature, get_class, get_stats, reindex.
Bahasa pemrograman apa saja yang didukung oleh codesurface?
codesurface mendukung C#, C++ headers, Go, Java, Python, dan file TypeScript/JavaScript, serta dapat mendeteksi bahasa secara otomatis di dalam direktori proyek.
Bagaimana cara mengonfigurasi codesurface sebagai MCP server?
Tambahkan ke .mcp.json Anda menggunakan command uvx dan arahkan flag --project ke direktori yang berisi file source Anda.
MCP tools apa saja yang disediakan oleh codesurface?
Terdapat lima tools yang disediakan: search, get_signature, get_class, get_stats, dan reindex.
Apakah codesurface menjaga index tetap mutakhir saat ada perubahan file?
Ya, index akan diperbarui secara otomatis saat terjadi query miss, dan Anda dapat memanggil reindex secara manual untuk update inkremental berbasis mtime.
Bisakah saya mengecualikan direktori hasil generate atau vendored dari proses indexing?
Ya, tambahkan pola glob ke file .codesurfaceignore di root proyek atau gunakan flag --exclude dengan pola glob yang dipisahkan koma.