codebase-rag-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| CODEBASE_RAG_URL | No | local-codebase-rag 後端位址 (local-codebase-rag backend address). | http://localhost:8000 |
| CODEBASE_RAG_TOP_K | No | 模型沒指定時的片段數 (number of excerpts returned when the model does not specify top_k). | 8 |
| CODEBASE_RAG_TIMEOUT | No | 等待 /search 的秒數 (seconds to wait for /search; only embedding, so no long LLM timeout needed). | 30 |
| CODEBASE_RAG_MAX_CHARS | No | 每個片段最多保留的字元數,控制 tool 結果佔用的 context (max characters kept per excerpt, controlling context usage of the tool result). | 4000 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Searches a game front-end codebase (TypeScript / JavaScript / Markdown) indexed by local-codebase-rag. Use search_codebase before answering questions about where something is defined, configured or handled. Cite results as path:start-end. If nothing relevant comes back, say so instead of guessing.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_codebaseA | Search the indexed game front-end codebase and return the most relevant excerpts (code and docs) with file paths and line ranges. Use it to find where a value is configured, where a class / function / constant is
defined, or which files take part in a flow. Queries can be natural language
(English or Chinese) or identifiers (e.g. Returns excerpts only, not an answer: read them, then answer and cite path:start-end. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 1 tool
There is only one tool, so there is no possibility of misselection between competing tools. Its purpose (semantic/identifier search over an indexed codebase returning excerpts) is stated unambiguously, including when to re-query.
The single name `search_codebase` follows a clear verb_noun snake_case convention. With only one tool there is no cross-tool inconsistency to penalize.
This is a focused RAG retrieval server, so a single search entry point is a defensible, well-scoped surface rather than a mismatch. It is on the thin side — one tool must serve every retrieval need — but nothing is redundant.
Search-and-return-excerpts is covered well, but the surface has notable gaps for a codebase-navigation domain: no way to read a full file by path, list indexed files, or check index freshness/scope. Agents hitting an off-target query have only the re-query loop to fall back on.