Indexed C/C++ code navigation for AI agents β GNU Global (gtags) lookups over MCP, not grep scans.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Stop letting your AI agent grep. Give it an index.
mcp-name: io.github.harshithsunku/mcp-gtags-server
One user-level config entry, no sudo, no pre-installed anything β the whole toolchain installs itself into user space on first use, and every repo you open is served automatically.
Every AI coding agent β Claude Code, Cursor, Codex, you name it β answers "where is this function defined?" the same way: grep the entire tree. On a million-line C/C++ codebase that's a full scan per question, and the output is a firehose: every comment, string literal, and unrelated match, dumped straight into the model's context window.
mcp-gtags-server replaces those scans with indexed lookups powered by GNU Global (gtags) β the same tags engine kernel and systems developers have trusted for decades β exposed to agents over the Model Context Protocol. Built for the codebases LSP-based tools can't handle: kernel-scale C/C++, trees that don't currently compile, machines you can't sudo on.
#ifdef guard stacks with .config filtering, macro-generated symbols (sys_read β its SYSCALL_DEFINE3 site) that no other tagging tool resolves, and definitions the parser misses recovered from their EXPORT_SYMBOL site via ctagsMeasured on a full Linux kernel checkout β 65,163 C/C++ files, 37.1 million lines β warm page cache:
| Question an agent asks | grep -rn | gtags (this server) | Context consumed |
|---|---|---|---|
Where is tcp_v4_rcv defined? | 1.40 s | 0.01 s | 8 lines β 1 line |
Where is kmalloc defined? | 1.62 s | 0.01 s | 7,873 lines β 5 lines |
Who references kmalloc? | 1.62 s | 0.10 s | 7,873 noisy lines β 2,744 real sites (or a ranked per-file summary) |
Show me tcp_v4_rcv's implementation | read a 3,500-line file | get_symbol_body | exactly the 271-line function |
Who calls ext4_mark_inode_dirty? | 245 raw match lines | find_callers | 62 deduped caller functions, with counts |
Where is sys_read really defined? | no answer β the name is macro-generated | 0.03 s | fs/read_write.c SYSCALL_DEFINE3(read, ...), flagged resolved_via |
Where is mutex_lock defined? | 24,774 noisy match lines | 0.2 s | kernel/locking/mutex.c:314 β recovered via EXPORT_SYMBOL + ctags after gtags' parser derails on it |
Does ksys_read ever reach rw_verify_area? | N rounds of grep + reading | 0.6 s | the shortest call chain, with every call site's file:line |
| What does my uncommitted diff impact? | not answerable | 0.1 s | blast_radius: changed functions + callers, ranked by distance |
One-time index build: 66 s for the whole kernel. Incremental refresh after edits: well under a second. Reproduce it yourself with scripts/benchmark.sh:
The speed is nice. The real win is precision: an agent that gets 5 exact lines instead of 7,873 noisy ones keeps its context window for actual reasoning.
And the answers are measured, not assumed: CI runs a 65-case golden eval against pinned kernel v6.16 on every push β currently 100% recall, 100% precision@1 across definitions, macro resolution, export recovery, references, callers, callees, definition bodies, #ifdef guards, and reachability, covering all 11 tools. The full methodology, numbers, and honest limitations live in docs/capability.md.
Add the server once, at user level, and you're done β no installer, no pre-installed gtags, no per-repo setup. The only prerequisite is uv (or use Option B, which installs it for you).
Or click the Cursor one-click install badge at the top of this page.
On the very first tool call the server bootstraps everything else by itself: GNU Global (prebuilt user-space binaries β no compiler, no sudo), universal-ctags, and Pygments, all into ~/.gtags-mcp. While that one-time install runs (a few seconds on most platforms), tool calls return a "toolchain is being installed β retry shortly" status instead of failing. Opt out with --no-auto-setup or GTAGS_MCP_AUTO_SETUP=0.
The prebuilt Linux binaries run on any distro with glibc β₯ 2.28 (RHEL/Rocky 8+, Ubuntu 18.10+, Debian 10+). On older hosts β or if a downloaded binary fails its post-install execution check β setup automatically compiles GNU Global from source instead, which only needs make and a C compiler.
One command. No sudo. Works everywhere β restricted corporate machines, containers, build servers:
Everything lands in your home directory β the server (via uv), GNU Global, universal-ctags, and Pygments (in ~/.gtags-mcp). When it finishes, a shared background HTTP server is running that every client and IDE window on the machine can point at (http://127.0.0.1:8383/mcp), and the exact client configuration is printed to your console.
Re-run the same command any time:
However you install it, one user-level entry serves every repo you open β 20 repos need zero extra installs and zero extra config. Each tool call resolves its project root down this ladder:
project_root argument on the tool call (agents pass this to target any tree)--root flag / GTAGS_MCP_ROOT env varroot in a config file (note: pinning a root here defeats multi-repo)project_root.git/GTAGS β this is why stdio servers spawned by Claude Code/Cursor inside a repo just workThat's it. No indexing step, no configuration. Ask your agent "who calls tcp_v4_rcv?" β the first query in any repo builds that repo's index automatically, and every query after that is answered in milliseconds. Run mcp-gtags-server doctor any time to see what the server detects, or mcp-gtags-server config to re-print the client configuration.
The installer runs mcp-gtags-server --transport http --host 127.0.0.1 --port 8383 in the background (pid: ~/.gtags-mcp/server.pid, log: ~/.gtags-mcp/server.log). Environment overrides for the installer:
| Variable | Default | Meaning |
|---|---|---|
GTAGS_MCP_PORT | 8383 | HTTP port |
GTAGS_MCP_HOST | 127.0.0.1 | Bind address β set 0.0.0.0 to reach the server from other devices at http://<machine-ip>:8383/mcp |
GTAGS_MCP_NO_SERVER | unset | 1 = don't start a background server |
Security note: the HTTP endpoint is unauthenticated. It binds localhost by default; only bind 0.0.0.0 on networks you trust.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-gtags-server)<a href="https://allmcps.com/mcp/mcp-gtags-server"><img src="https://allmcps.com/api/badge/mcp-gtags-server?style=directory" alt="MCP Gtags Server on AllMCPs" /></a>