codex-nav-mcp-server
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"codex-nav": {
"args": [],
"command": "/absolute/path/to/codex-nav-mcp-server"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
An MCP (Model Context Protocol) server that exposes tree-sitter-based code navigation as tools for AI assistants. Instead of shelling out to grep/cat/find, AI agents can use three purpose-built tools to explore codebases via AST-level queries.
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Click any tool to inspect its schema.
codex_nav_code_searchGuidance on when and how to reach for tree-sitter-based code navigation tools instead of grep/cat/find.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in other
Pi Coding Agent extension (CLI-first) — routes bash/read/grep/find/ls through lean-ctx CLI for strong token savings. Optional MCP bridge can register advanced tools.
Autonomous spec-to-product coding-agent CLI with an MCP server exposing 34 tools over stdio.
97% token reduction for AI coding sessions — zero deps, 21 languages, MCP server
App framework, testing framework, and inspector for MCP Apps.
MCP Security Weekly
Get CVE alerts and security updates for An MCP Server That Exposes Tree Sitter Based Code Navigation As Tools For AI Assistants. and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
An MCP (Model Context Protocol) server that exposes tree-sitter-based code navigation as tools for AI assistants. Instead of shelling out to grep/cat/find, AI agents can use three purpose-built tools to explore codebases via AST-level queries.
code_nav_initInitializes or refreshes the tree-sitter symbol index for the current working directory. Must be called once at the start of a session before using code_symbols or code_query.
| Parameter | Type | Required | Description |
|---|---|---|---|
reset | boolean | no | Delete existing index and rebuild from scratch. Use after a large refactor or if the index is stale. |
code_symbolsLists all top-level symbols (functions, structs, classes, enums, traits, etc.) defined in a file or directory. Returns each symbol's name, kind, file path, and line number as JSON.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | no | File or directory to scan. Defaults to the working directory. |
lang | string | no | Language to search. Auto-detected from file extension when omitted. One of: bash, c, cpp, go, javascript, python, rust, swift, typescript. |
code_queryRuns an arbitrary tree-sitter S-expression query against source files, returning up to 500 matches with file paths and line numbers.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | yes | Tree-sitter S-expression query with named captures (e.g. (function_item name: (identifier) @name)). |
lang | string | yes | Language grammar to use (same options as code_symbols: bash, c, cpp, go, javascript, python, rust, swift, typescript). |
path | string | no | File or directory to search. Defaults to the working directory. |
The server also exposes an MCP prompt, codex_nav_code_search, containing guidance on when and how to reach for these tools instead of grep/cat/find. Hosts that surface prompts (e.g. via a slash-command picker) can load it directly; the same text is also sent as the server's instructions during initialization.
The server communicates over stdio transport, making it compatible with any MCP host (Claude Desktop, VS Code extensions, CLI tools, etc.).
The server indexes a single working directory, resolved as follows:
CODE_NAV_CWD environment variable, if set.Because MCP hosts typically launch the server with their own (often unrelated) working directory, set CODE_NAV_CWD to the absolute path of the project you want to index. All path arguments are resolved relative to this directory.
cargo build --release
The binary is at target/release/codex-nav-mcp-server.
Add to your claude_desktop_config.json (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"codex-nav": {
"command": "/absolute/path/to/codex-nav-mcp-server",
"args": [],
"env": {
"CODE_NAV_CWD": "/absolute/path/to/your/project"
}
}
}
}
Replace /absolute/path/to/codex-nav-mcp-server with the path to the binary (e.g. target/release/codex-nav-mcp-server from the project root), and set CODE_NAV_CWD to the project you want to index (see Choosing the directory to index).
Add to your MCP settings file (e.g. .vscode/mcp.json or the extension's global settings):
{
"servers": {
"codex-nav": {
"type": "stdio",
"command": "/absolute/path/to/codex-nav-mcp-server",
"args": []
}
}
}
Codex CLI discovers MCP servers from a config file. Add an entry:
{
"mcpSe
... [View full README on GitHub](https://github.com/0x1337c0d3/An-MCP-server-that-exposes-tree-sitter-based-code-navigation-as-tools-for-AI-assistants.#readme)