treeweft-mcp
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| INDEXER_URL | Yes | The URL of the Treeweft indexer service, e.g. http://localhost:8001. | |
| TREEWEFT_MCP_TOKEN | Yes | A Treeweft personal access token or API key used to authenticate to the indexer. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
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
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| index_fileA | Index a single code file. Parses with tree-sitter, chunks with chonkie, embeds via TEI, and stores vectors in Milvus + entities in Neo4j. Returns immediately with a job_id; poll get_index_job to track progress. Set force=true to re-index even if this file is already indexed and unchanged (otherwise the call no-ops to the prior job). |
| index_directoryA | Index all code files in a directory (recursive). Returns immediately with a job_id; poll get_index_job to track progress. Set force=true to re-index even if the directory is already indexed and unchanged (otherwise the call no-ops to the prior job). |
| index_repoA | Index a git repository. Accepts a local path (with ~/ expansion) or a remote git URL. Auto-detects current branch for local repos. Returns immediately with a job_id; poll get_index_job to track progress. Re-indexing the same source upserts (no duplicates). By default an already-indexed, unchanged source no-ops to its prior job — set force=true to force a full re-index. |
| index_graphA | Build (or rebuild) the Neo4j code graph for an already-indexed source — pass 2 of two-pass indexing. Use this when chunks/vectors exist but graph-backed tools (find_definition, find_callers, find_references, graph_explore) return empty, or after a chunks-only index (skip_graph=true). Drops the source's existing graph entities and re-extracts; safe to re-run. Returns immediately with a job_id; poll get_index_job. Get source_id from list_indexed_sources. |
| rebuild_all_graphsA | Bulk-build the Neo4j code graph for indexed sources. Lists sources, then enqueues a graph job (POST /index-graph) for each. Use this once to repair a bulk import where chunks were indexed but the graph was never built (so find_definition/graph tools are globally empty). Graph extraction is idempotent (drops + rebuilds), so rebuilding a healthy source is harmless. Defaults to rebuilding ALL sources — the graph_indexed flag is NOT a reliable signal for the empty-graph bug (jobs marked themselves indexed while writing nothing), so only_missing=true (which filters to graph_indexed=false) will skip the very sources that need repair. Returns one entry per source with its job_id (or error). Jobs run through the shared queue — this kicks them off and returns; poll list_index_jobs(status='running') to track. |
| get_index_jobB | Get the current state of an index job (queued/running/done/failed). |
| wait_for_index_jobA | Block until an index job reaches done/failed/cancelled, or until timeout_s elapses. Polls server-side. Use this when you want a synchronous index call. |
| list_indexed_sourcesA | List all indexed sources (repos, directories, files) with their stats. |
| remove_indexed_sourceA | Remove an indexed source. Drops its Milvus chunks and Neo4j entities (but preserves entities still referenced by other sources). |
| list_index_jobsA | List indexing jobs across all sources. Each entry includes status (queued/running/done/failed), kind (file/directory/repo/graph/incremental), processed_files / total_files, errors, current_file, and timing. Useful for answering 'is treeweft busy?' or 'what happened to my last index job?'. |
| list_job_errorsA | List the per-file errors recorded during a specific indexing job. Each entry includes file_path, error_kind ('timeout' or 'exception'), error_message, elapsed_s, and occurred_at. Useful for 'which files failed?' and 'why?' without grepping process logs. |
| source_stalenessA | Check whether an indexed source is out of date relative to its current upstream HEAD. For local-path sources, resolves via |
| search_codeA | PRIMARY code-search tool — use FIRST for any question about how indexed code works, to plan a change, trace a flow, or find an implementation by behavior. Prefer this over grep/Read for indexed repos: grep needs exact strings, this finds code by meaning. Embeds the query, vector-searches Milvus, expands via Neo4j graph neighbors (callers/callees/imports/inheritance) and community summaries, reranks, returns chunks with file_path, start_line, end_line, snippet, score. Each chunk carries a citation field (e.g. 'repo@sha12:path') and the response includes a top-level sources map with commit_sha and permalink_base per source for building file-level permalinks. top_k defaults to 5 (the benchmarked sweet spot) — raise it only when a first search shows the answer spans many files. Optional filter: language (e.g. 'python'). SCOPE IS REQUIRED: pass source_id (from list_indexed_sources) or path_prefix (e.g. '/repo/src/') to scope to one repo, OR cross_repo=true to search the whole multi-repo index — exactly one, not both, or the search is rejected. Set check_staleness=true to add an is_stale flag per source (does live git HEAD resolution — slightly slower). response_mode (opt-in, default 'full'): 'facet' returns ranked metadata + a one-line header per hit with NO code body (cheaper — then fetch ranges with read_file); 'summary_tail' keeps the top-2 snippets and replaces lower-ranked bodies with their indexed one-line summary. Returns compact markdown by default (~20% fewer tokens); pass response_format='json' to get the structured dict instead (for programmatic callers). |
| hydrate_chunksA | Fetch the full code bodies for facet search hits. After a search_code call with response_mode='facet' (which returns ranked metadata + headers but NO code), pass the |
| search_code_enhancedA | Use when |
| explain_codeA | Use when the user asks you to explain a specific concept or section of code and wants tight, focused context (e.g. 'explain how X works' rather than 'find everything about X'). Same as |
| graph_exploreA | Use when the user wants a structural/architectural view rather than a code-snippet view — 'what depends on X', 'what does X talk to', 'show me the call graph around Y'. Finds entities related to the query and traverses their connections (callers, callees, imports, inheritance) up to |
| find_definitionA | Find where a symbol is defined. Looks up Class/Function entities by name. Returns all matches across files (let the caller disambiguate). Optional |
| find_callersB | Find callers of a function/method. Accepts either a name (auto-resolves; returns callers across all matches with target_id set) or a full entity id. |
| find_referencesA | Find all references (any incoming relationship — CALLS, INHERITS, IMPORTS, DEFINES) to a symbol. Accepts a name or a full entity id. |
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 20 tools
Most tools have clearly distinct roles: indexing scopes, job tracking, search, and graph traversal are easy to separate. The main ambiguity is between search_code, search_code_enhanced, and explain_code, and between find_callers and find_references, but the descriptions give enough usage guidance to make the intended choice.
The set mostly follows a clean verb_noun snake_case pattern: index_*, get_*, list_*, find_*. Minor deviations like 'source_staleness' (a noun phrase instead of a verb), 'search_code_enhanced' (suffix modifier), and 'rebuild_all_graphs' (bulkier form) keep it from a perfect 5.
20 tools is on the heavy side, and several are near-variants of the same operation: three search entry points and two graph-build tools add surface area. However, the server covers distinct responsibilities—indexing, job management, search, and graph analysis—so the count is not unreasonable.
The surface covers the full indexing lifecycle—create, list, track, force-reindex, and remove—along with code search and graph navigation. Minor gaps remain, such as no dedicated source-detail tool, no scoping for find_callers, and no explicit incremental update beyond force reindexing.