navigation-agent-mcp
Enables the discovery and normalization of GraphQL queries and mutations within a codebase for repository analysis.
Provides comprehensive code navigation, symbol search, and text-based inspection tools for JavaScript projects.
Supports identifying and listing frontend routes, loaders, actions, and components specifically within React Router applications.
Facilitates backend endpoint discovery and symbol analysis for Java-based projects utilizing the Spring framework.
Enables advanced code analysis for TypeScript applications, including symbol tracing, caller identification, and repository tree inspection.
@navigation-agent/mcp-server
Workspace-only MCP server for structural code navigation and repository inspection. It exposes a stable public code.* tool surface for finding symbol definitions, tracing upstream callers for impact analysis, tracing downstream execution flow before logic changes, listing routes/endpoints, searching text, and inspecting workspace trees without opening files blindly.
npm: @navigation-agent/mcp-server
Installation
The server runs via npx.
Requirements
Node.js 18+
ripgrep (
rg) — optional, only needed forcode.search_text
Claude Code
claude mcp add --transport stdio navigation-agent -- npx -y @navigation-agent/mcp-serverOpenCode
Add to ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"navigation-agent": {
"type": "local",
"command": ["npx", "-y", "@navigation-agent/mcp-server"],
"enabled": true,
"timeout": 30000
}
}
}Gemini CLI
gemini mcp add navigation-agent npx -- -y @navigation-agent/mcp-serverOr add it manually to ~/.gemini/settings.json or .gemini/settings.json:
{
"mcpServers": {
"navigation-agent": {
"command": "npx",
"args": ["-y", "@navigation-agent/mcp-server"],
"timeout": 30000
}
}
}Use the hyphenated server name navigation-agent. Avoid underscores in Gemini MCP server names because Gemini derives fully-qualified tool names from the server name.
Cursor
Add to ~/.cursor/mcp.json or .cursor/mcp.json:
{
"mcpServers": {
"navigation-agent": {
"command": "npx",
"args": ["-y", "@navigation-agent/mcp-server"]
}
}
}OpenAI Codex
codex mcp add navigation-agent -- npx -y @navigation-agent/mcp-serverOr add to ~/.codex/config.toml:
[mcp_servers.navigation-agent]
command = "npx"
args = ["-y", "@navigation-agent/mcp-server"]
startup_timeout_sec = 30
tool_timeout_sec = 60Workspace root
By default the server analyzes the current working directory. To pin a specific project, set NAVIGATION_MCP_WORKSPACE_ROOT in your MCP config.
Agent usage guide
This server is built for model-controlled MCP tool use: agents should discover and invoke its tools before opening source files when the task is about workspace code structure.
It publishes both per-tool descriptions and server instructions so MCP clients can teach the model the workflow without relying on a private skill registry.
How agents learn to use it
MCP clients give the model guidance through a few standard channels:
Channel | What this server provides |
MCP | A concise workflow: use navigation before reading files, which tool to pick, supported languages/frameworks, and workspace-only limits. |
Tool descriptions and input schemas | Each |
Structured tool results | Every tool returns the stable envelope |
Optional client rules/skills | Clients such as OpenCode, Codex, Cursor, and Gemini can add project rules, but this server does not require a private registry to be useful. |
The important part: the server instructions are part of the MCP handshake, so clients that honor MCP instructions can inject them into the model before tool selection.
skills/navigation-mcp/SKILL.md is an optional portable skill template for clients that support skills. It is not required for normal MCP operation; for OpenCode specifically, skills are discovered from .opencode/skills/<name>/SKILL.md, global OpenCode skills, or Claude/agents-compatible skill directories.
Quick path for agents
Use
code.inspect_treeto orient in an unknown module or directory without reading files.Use
code.find_symbolwhen you know a class, function, method, type, enum, or annotation name but not the defining file.Pass
find_symbol's returneditems[].pathinto:code.trace_callersfor upstream impact: who calls this?code.trace_flowfor downstream behavior: what does this call or reach?
Use
code.list_endpointsbefore changing REST, GraphQL, or route surfaces.Use
code.search_textfor textual patterns, imports, decorators, or when symbol lookup is not enough.Read only the relevant files returned by the navigation tools.
Fallbacks agents should use
Situation | Correct fallback |
| Use |
A trace result is too broad or noisy | Narrow |
A route or endpoint inventory returns zero | Retry with a narrower |
A navigation result has | Narrow the query before reading files or increasing |
Do not treat an empty result as proof by itself. Use one scoped fallback, then explain the limitation if results still stay empty.
Tool naming in clients
The canonical public contract is code.*. Some clients expose MCP tools with a server prefix or normalized separators, for example navigation-agent_code_find_symbol or mcp_navigation-agent_code.find_symbol. Treat those names as aliases of the same canonical tools.
Use navigation-agent as the server name in examples. It is readable, avoids collisions, and avoids underscore-related parser issues in clients that derive fully-qualified tool names from the server id.
Client convention notes
Client | Convention checked |
Claude Code | Local stdio command uses |
OpenCode | Local MCP servers live under the |
Gemini CLI | MCP servers live under |
Cursor | MCP servers are configured in |
OpenAI Codex | MCP servers live under |
Supported filters agents should know
Languages:
typescript,javascript,go,java,php,python,rust,csharpFrameworks:
react-router,spring
Do not use this MCP for web search, external repositories, arbitrary filesystem access, or reading file contents. It is a workspace-only navigation layer.
Compatibility matrix
This table MUST stay in the README because it is the fastest way to understand the public support surface. It is intentionally organized with languages as rows and tools as columns so adding more languages grows downward instead of widening the table.
Tool columns omit the code. prefix to keep the matrix readable.
Language |
|
|
|
|
|
|
Java | ✅ | ✅ | ✅ | ✅ Spring REST/GraphQL | ✅ | ✅ |
TypeScript | ✅ | ✅ | ✅ | ✅ React Router | ✅ | ✅ |
JavaScript | ✅ | ✅ | ✅ | ✅ React Router | ✅ | ✅ |
PHP | ✅ | ✅ | ✅ | ⚠️ Public, not re-verified for endpoints | ✅ | ✅ |
Python | ✅ | ✅ | ✅ | ✅ FastAPI/Flask-style decorators | ✅ | ✅ |
Rust | ✅ | ✅ | ✅ | ⚠️ Target-dependent / non-web target returned zero | ✅ Qualified symbols | ✅ Qualified symbols |
Go | ✅ | ✅ | ✅ | ⚠️ No useful endpoint inventory in current example | ✅ | ✅ |
C# | ✅ | ✅ | ✅ | ⚠️ Stub implementation | ✅ | ✅ |
Legend:
✅ = verified in a real project during this documentation sync
⚠️ = publicly exposed, but not re-verified in this pass, not meaningful on the chosen validation project, or still has caveats
❌ = not working as public support today
code.inspect_treeandcode.search_textalso work without a language filter across general workspace files.
Important:
Public language filters are
typescript,javascript,go,java,php,python,rust, andcsharp.Go, PHP, Python, Rust, Java, TypeScript, JavaScript, and C# are part of the public contract; the matrix above shows current verification level per tool.
Rust trace tools work well, but method/impl symbols should be queried with their qualified name (for example
JavaProjectIndex::build).
Public tools
The public contract exposes exactly these six tools:
code.inspect_treecode.list_endpointscode.find_symbolcode.search_textcode.trace_flowcode.trace_callers
Use snake_case parameters such as max_depth, include_hidden, and file_pattern.
Before changing a function or method
Use this workflow whenever you need to understand behavior or impact inside the workspace:
code.find_symbol— resolve the exact defining file first.code.trace_callers— inspect upstream impact before renaming, deleting, or changing a signature.code.trace_flow— inspect downstream execution before changing logic.readonly the files returned by the trace results that actually matter.
Rule of thumb:
choose
code.trace_callersfor who depends on this?choose
code.trace_flowfor what does this reach or invoke?if you need both impact and behavior, run both before editing
Concrete workspace example:
Resolve the symbol definition:
{
"symbol": "create_order",
"language": "python",
"kind": "function",
"path": "examples/python"
}Inspect upstream impact before changing the function:
{
"path": "examples/python/app/api/endpoints.py",
"symbol": "create_order",
"language": "python",
"recursive": true,
"max_depth": 3
}Inspect downstream behavior before changing the logic:
{
"path": "examples/python/app/api/endpoints.py",
"symbol": "create_order",
"language": "python"
}Expected agent behavior:
use
code.find_symbolfirst when the defining file is not already knownuse
code.trace_callersfirst when the risk is breaking callersuse
code.trace_flownext when the risk is changing downstream behavioronly then
readthe traced files you actually need
React Router example:
{
"symbol": "action",
"kind": "function",
"framework": "react-router",
"path": "app/routes"
}{
"path": "app/routes/change-password.tsx",
"symbol": "action",
"framework": "react-router",
"recursive": true,
"max_depth": 2
}{
"path": "app/routes/change-password.tsx",
"symbol": "action",
"framework": "react-router"
}code.search_text response style
code.search_text is optimized for agents:
results are grouped by file
each match returns only
lineplus exactspanstopFileshighlights the densest files firstcontextual
before/aftertext is intentionally omitted from the public response to reduce noise and token cost
Example shape:
{
"fileCount": 3,
"matchCount": 19,
"totalFileCount": 3,
"totalMatchCount": 19,
"topFiles": [
{
"path": "examples/go/internal/http/handlers/user_handler.go",
"language": "go",
"matchCount": 11
}
],
"items": [
{
"path": "examples/go/internal/http/handlers/user_handler.go",
"language": "go",
"matchCount": 11,
"matches": [
{
"line": 28,
"spans": [{ "colInit": 23, "colEnd": 32 }]
}
]
}
]
}Quick examples
{
"symbol": "RootUserGraphQLController",
"language": "java",
"kind": "class"
}{
"path": "app/routes/change-password.tsx",
"symbol": "action",
"framework": "react-router"
}{
"path": "src/main/java/com/example/FooController.java",
"symbol": "getFoo",
"framework": "spring"
}Verified real-world behavior
These checks were verified against real projects instead of toy stubs:
Java (~/sias/app/back)
code.inspect_treeworks on real module treescode.find_symbolworks on real Spring classescode.search_textworks on real Java sourcecode.list_endpointsinventories framework-detectable Spring REST controllers and GraphQL resolvers as likely public entrypointscode.trace_flowworks on real controller/resolver entrypointscode.trace_callersworks on Java use cases and can identify probable public entrypoints
Verified example:
RootUserGraphQLController#getUsersByDependencytraced into
RootGetUserUseCase#getUsers
TypeScript / React Router (~/sias/app/front)
code.inspect_treeworks on real route treescode.find_symbolworks on route-module exportscode.search_textworks on real route filescode.list_endpointsinventories React Router route-moduleloader/actionexports as likely route entrypointscode.trace_flowworks for same-file route flow extractioncode.trace_callersworks for same-file helpers and marks route exports as probable entrypoints
Verified example:
app/routes/change-password.tsx#actionfound calls to
getUserIdAndTokenFromSession,changeMyPassword,getSession,commitSession,getRoleRoutereverse-traced
getRoleRoute <- action
Python (examples/python)
code.inspect_treeworks on Python module treescode.find_symbolworks on Python classes, functions, and methodscode.search_textworks on Python source filescode.list_endpointsinventories FastAPI-style route decorators (@router.get,@app.post, etc.) as likely public API entrypointscode.trace_flowworks end-to-end for multi-module Python scenarios, capturing deep recursive trees including branching calls, instance methods (self), and cross-file resolution.code.trace_callersworks end-to-end for impact analysis, supporting recursive reverse-tracing across the entire workspace.
Verified example (Forward Trace):
app/api/endpoints.py#create_ordertraced into
order_service.process_order(...)->_handle_payment(...)->payment_service.authorize_payment(...)deep tree captures cross-file calls to
AuditService,InventoryService,ProductRepository, etc.
Verified example (Backward Trace):
app/services/audit.py#log_actionreverse-traced to callers in
UserService,OrderServicerecursively identifies entrypoints in
app/api/endpoints.py(get_user,create_order)
PHP (examples/php)
code.inspect_treeworks on PHP project treescode.find_symbolworks on PHP classes and methodscode.search_textworks on PHP source filescode.trace_flowworks end-to-end for PHP service-to-repository callscode.trace_callersworks end-to-end for PHP impact analysis
Notes:
code.list_endpointsis publicly exposed for PHP but was not re-verified for useful endpoint inventory in the current example
Verified example:
src/Service/UserService.php#UserService::persistUsertraced
$this->repository->save($user)tosrc/Repository/MemoryUserRepository.php#save
Rust (this repository)
code.inspect_treeworks on real Rust source treescode.find_symbolworks on Rust types/functionscode.search_textworks on real Rust sourcecode.trace_flowworks on real Rust methods when queried with the correct qualified symbolcode.trace_callersworks on real Rust methods when queried with the correct qualified symbol
Notes:
code.list_endpointsreturned zero results on this repository, which is expected for the chosen validation target because it is not a Rust web app
Verified example:
crates/navigation-engine/src/capabilities/trace_flow.rs#JavaProjectIndex::buildtraced
Self::new_empty(),index.scan_project(workspace_root), andindex.is_empty()reverse-traced
JavaProjectIndex::scan_project <- JavaProjectIndex::build
C# (./examples/csharp)
code.inspect_treeworkscode.search_textworkscode.find_symbolworks for method lookup such asOrderWorkflowService.ProcessOrderAsynccode.trace_flowworks end-to-end on the example app and returns the recursive internal call treecode.trace_callersworks end-to-end on the example app
Go (./examples/go)
Real behavior today against examples/go:
code.inspect_treeworkscode.search_textworkscode.find_symbolworks for method lookup such asCreateUsercode.trace_flowworks end-to-end on the example app and returns the recursive internal call treecode.trace_callersworks end-to-end on the example app, including callback/method-value references and interface-to-implementation reverse matchescode.list_endpointsstill returns no useful entrypoint inventory for the current Go example
Public language and framework filters
Current public language filters:
typescriptjavascriptgojavaphppythonrustcsharp
Current public framework filters:
react-routerspring
Response shape
Every tool returns the same top-level envelope:
{
"tool": "code.trace_flow",
"status": "ok",
"summary": "Traced 5 callees for 'action' from 'app/routes/change-password.tsx'.",
"data": {},
"errors": [],
"meta": {
"query": {},
"resolvedPath": "app/routes/change-password.tsx",
"truncated": false,
"counts": {},
"detection": {}
}
}Status meanings:
ok— request succeeded, including zero-result successpartial— request succeeded but was truncated/prunederror— request failed and includes stable error codes
Notes:
code.trace_flowreturns a rooted recursive tree underdata.rootcode.trace_callersreturns direct callers plus recursive reverse-trace metadatacode.search_textreturns compact grouped matches andtopFiles, not full context blocks
Architecture
This repository has two main layers:
TypeScript MCP runtime (
packages/mcp-server/)validates the public
code.*contractexposes stdio / stdio-legacy transports
normalizes responses
Rust engine (
crates/navigation-engine/)parses source with tree-sitter
hosts language analyzers
includes internal AST/debug binaries under
crates/navigation-engine/src/bin/
Important:
packages/mcp-server/src/bin/contains the runtime entrypoint (navigation-mcp.ts)AST inspection/debug binaries live in
crates/navigation-engine/src/bin/, not in the TypeScript runtime
Contributing / local development
Key local commands:
npm install
npm --workspace @navigation-agent/mcp-server run check
npm --workspace @navigation-agent/mcp-server run test
cargo test --manifest-path crates/navigation-engine/Cargo.tomlUseful local runtime checks:
npx tsx packages/mcp-server/src/bin/navigation-mcp.ts --describe-tools
npx tsx packages/mcp-server/src/bin/navigation-mcp.ts --transport stdio-legacy --workspace-root /path/to/workspaceLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/j0k3r-dev-rgl/navigation-agent-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server