# mcp-gtags-server [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/harshithsunku/mcp-gtags-server  
**GitHub Stars:** 1  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mcp-gtags-server

## Description
Indexed C/C++ code navigation for AI agents — GNU Global (gtags) lookups over MCP, not grep scans.

## Tools
Capabilities this server exposes over MCP:

- **get_symbol_body** — Just the source of a definition.** The 271-line `tcp_v4_rcv` function — not the 3,500-line file it lives in. Handles functions, structs, and multi-line macros.
- **find_callers** — The call graph, deduplicated.** Every reference mapped to its enclosing function with call counts: 245 raw lines for `ext4_mark_inode_dirty` collapse to 62 callers. Iterate it to walk the caller graph as deep as you need.
- **find_callees** — The outgoing call graph.** What does this function call? Body-extracted call sites, each verified against the index, split into in-tree (with locations) and external.
- **reachability** — "Can this function end up in that one?"** — BFS over the caller graph returns the *shortest* call chain from A to B with the file:line of every call site (`ksys_read → vfs_read → rw_verify_area`), or an honest "no static path" that names the function-pointer caveat. One call instead of a dozen find…
- **find_definition** — Where is this defined, and what is it?** Definitions with `#ifdef` guards and ctags metadata, plus a usage summary (reference/file counts, hottest files, `EXPORT_SYMBOL*` status). Falls back to macro-family resolution (`sys_*`, `trace_*`, `DEFINE_*` names) and suggests prefix matches on a miss
- **find_references** — Every usage site, each with its guard stack. Above 200 references it returns a **per-file distribution** instead of a wall of lines (`kmalloc`'s 2,744 references become one screen); `path_prefix` drills into one directory, `group_by` forces either view. Falls back to symbol-usage records (libc call…
- **list_file_symbols** — A file's API surface — every symbol it defines
- **update_index** — Synchronous freshness barrier after edits; `full=true` rebuilds from scratch (rarely needed — indexing is automatic)

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "mcp-gtags-server": {
    "command": "uvx",
    "args": ["mcp-gtags-server"]
  }
}
```

## Documentation

## What mcp-gtags-server MCP server does

The mcp-gtags-server MCP server gives MCP clients indexed navigation for C and C++ repositories. It uses GNU Global as the primary index and adds ctags and symbol-usage data for cases where ordinary tagging or parsing is insufficient. Results are intended to identify actual definitions and usage sites instead of returning every textual match in a source tree.

The server is particularly suited to large or difficult codebases, including trees that do not currently compile. Its output can include `#ifdef` guard stacks, macro-generated definitions, and recovery through `EXPORT_SYMBOL*` locations. The README reports benchmark results on a full Linux kernel checkout, but those measurements should not be treated as a guarantee for every repository or machine.

## How it works

On the first tool request, the server creates or obtains an index for the repository. Later requests refresh it automatically, while `update_index` provides a synchronous freshness barrier after edits. A full rebuild is available through the tool but is described as an uncommon operation.

Queries operate on indexed symbols rather than scanning all source text. Callers are grouped by their enclosing functions and include call counts. Callees are extracted from function bodies and checked against the index, with in-tree and external calls separated. Reachability uses breadth-first search over the caller graph and can return the shortest static path with source locations. If no path is found, the result identifies the limitation around function pointers.

## Setup and configuration

The documented quick-start configuration runs the server with `uvx`:

```json
{
  "mcpServers": {
    "gtags": {
      "command": "uvx",
      "args": ["mcp-gtags-server"]
    }
  }
}
```

The mcp-gtags-server MCP server requires `uv` for this setup. Automatic setup can be disabled with `--no-auto-setup` or `GTAGS_MCP_AUTO_SETUP=0`.

The repository also documents a one-line installer that starts a shared HTTP server at `http://127.0.0.1:8383/mcp`, plus client-specific installation through Claude Code and Codex plugins. The manual configuration and plugin should not be installed together, because that registers duplicate server instances.

## Tools and capabilities

- `get_symbol_body` returns the source body for a function, struct, or multiline macro.
- `find_definition` reports definition locations, metadata, guards, usage counts, hot files, and export status. It can resolve macro families and suggest prefix matches.
- `find_references` lists usage sites with guard information. Large result sets can be grouped by file, and `path_prefix` narrows searches to a directory.
- `find_callers` maps references to enclosing functions and deduplicates them with counts.
- `find_callees` reports verified outgoing calls, separating in-tree calls with locations from external calls.
- `reachability` searches for a shortest static call chain between functions.
- `list_file_symbols` shows the symbols defined by a file.
- `update_index` refreshes the index synchronously, with an option for a full rebuild.

## Limitations and notes

Static call-graph results cannot establish paths that depend on unresolved function-pointer behavior. GNU Global and the supporting resolvers also depend on the available source structure and index data. The documented Linux binary compatibility applies to systems with glibc 2.28 or newer; older hosts may compile GNU Global locally when `make` and a C compiler are available. The server is MIT-licensed.

_Full upstream README: https://allmcps.com/mcp/mcp-gtags-server/readme_

