Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
CALLGRAPH_LANGNoSet to hu for Hungarian output; English is the default.en
CALLGRAPH_NEXTNoSet to 1 to allow results to end with a suggested next-step line; equivalent to callgraph mcp --next.0
CALLGRAPH_COUNTNoSet to 0 to turn off the anonymous daily usage count (version, platform and new/weekly/monthly flags; no ID, no IP stored). DO_NOT_TRACK=1 does the same.1
CALLGRAPH_STATSNoSet to 0 to turn off local usage statistics.1
CALLGRAPH_STRICTNoSet to 1 to make show, locate and profile exit with code 3 when a file they read has a syntax error.0
CALLGRAPH_NO_GRAPHNoSet to 1 to run without the project map for layer classification.0
CALLGRAPH_GITIGNORENoSet to 0 to map files that .gitignore excludes for the MCP server and the hook; .callgraphignore and the built-in skipped folders still apply.1
CALLGRAPH_TELEMETRYNoSet to 0 as a hard off switch for telemetry (telemetry is opt-in and off unless you turn it on).
CALLGRAPH_SIGNATURESNoSet to 1 to print the signature (params, return type) on outline method lines.0
CALLGRAPH_UPDATE_CHECKNoSet to 0 to turn off all update checks, including the MCP server's update check.1

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Which tool for what: plain text search (an exact string, log message, config value) → Grep, it is the best at that; "where do I start with this task?" → locate; definitions, structure, callers, impact → callgraph (outline, method_body, find_callers, depth). The first call of a task: give locate the names and domain terms of the task in ONE call: function, class, property and file names, columns, routes, translation keys, and for a non-English domain word its English code name too (e.g. visszatérítés → refund). It answers from the project map without reading files: the top 5 files (all: true: every match), each with its reasons (exact definition, file name, name part, string, call, callers: N). Continue on those files with the outline / method_body / find_callers. Recipes: bug fix = locate → outline of the top file → method_body of the method. "Who calls it / what breaks" = the name pattern with find_callers and depth 2 → method_body of the calling method. Unfamiliar project = project_profile → locate → outline. "Where is this text / constant" = search (strings) / search (constants) (exact text: Grep).

callgraph (callgraph mcp): AST-based, token-efficient code map (PHP, Rust, JS / TS / Vue, Swift, Python, Go, SCSS); the CLI's queries as read-only tools, with the same output. Use it before reading a code file. Paths are relative to the project root: a registered alias (project, list: projects) or the server's working directory. Typical flow: locate (where to start) → outline → method_body for just the method you need → find_callers with the name pattern.

  • locate {terms}: where to start with a task (see above): ranked files with reasons, from the names and terms of the task in one call; all: true = every match, not just the top 5.

  • outline {path}: structure of a file or directory: classes / components, methods with line ranges, calls by category. Start here. method: one method's call graph; format: api, flow (branches), summary, hotspots.

  • method_body {path, method}: line-numbered source; method is a name or a list (["store", "update"]). Compact by default (docblock above and blank lines dropped, comments kept, line numbers exact); doc: true adds the docblock, raw: true gives the exact text.

  • find_callers {pattern}: who calls it (file, method, line range, call line); path narrows the scope, depth 2–5 = impact analysis (callers of callers), guess: true adds name-only matches. JS / TS / Vue keys: useForm.js::submit (export), route::orders.show, i18n::orders.title, vue::emit:save, Atoms/AtomButton.vue.

  • search {kind: strings | constants, pattern}: where a string literal (error message, key) or a constant is.

  • framework_view {view, path}: routes, middleware, validation, jobs, events, providers, magic, di, views of a directory.

  • notes: notes left on files / methods (📝, read-only). guide: this manual in full (CLI examples, languages).

  • next {result_id, choice}: when the server runs with callgraph mcp --next, some results end with ↪ r7 possible next: [1] … [2] … (read-only navigation); run one by number (choice: 1 or [1, 3]), only if it fits your task; otherwise ignore the line. Output is capped at 400 lines (directory → summary, file → method index, search → 1 line per match): narrow path, method or pattern first; full: true only when justified.

Finding callers: start with the name pattern (^|::|\.|->)name$. It catches every call, also where the receiver type is unknown, inherited or comes from a trait. Type::method finds only the calls resolved to that type (plus calls through its interface / parent / trait), so it can miss callers; use it to narrow a noisy common name (save, find, get).

Reading search output (find_callers, depth, search (strings), search (constants), directories):

  • First line root: /abs/path: every path after it is relative to that project root; pass them back as they are (with the same project).

  • L25 │ $this->repo->find($id): the call's own source line. You don't need method_body just to see how something is called, only for the full logic.

  • via Resolver: the call goes through an interface, parent class or trait of the searched type.

  • L12, L40 │ …: the same call on several lines; at most 3 rows per caller, then … +2 more: L55, L61.

  • ? / ?::name: the receiver type is unknown, a name-only match; it may be wrong, check the line.

  • 🔒 after a file path: the file is protected; read it, don't edit it.

Static analysis: dynamic calls ($this->$method(), obj[key]()), magic methods and class names / registered components assembled at runtime cannot be resolved. They are marked dynamic_call in the outline (PHP, JS / TS / Vue, Python; listed last, the target is the called expression): not a caller edge, so find_callers / depth / locate ignore it — depth only notes how many callers contain one ("check them by hand"). By default depth follows only the certain (resolved) callers; name-only matches are shown by guess: true with a "?" mark. For the exact control logic you need method_body (compact, comments kept; raw: true gives the exact text). A ⚠ syntax error line means a file did not parse fully: the result may be incomplete — read that file directly.

Project profile of the working directory (from folder and file names; details: project_profile; narrow a query to one layer with layer): profile: SwiftUI MVVM (Views → ViewModels) · confidence: medium layers (files): command src/cli/commands (+2 more) 27 model src/model (+2 more) 15 component golden/samples/js 2 view (rust) src/notes (+1 more) 2 handler golden/samples/rust/src 1 route src/query/format/framework 1 store golden/samples/swift 1 view (swift) golden/samples/swift 1 viewmodel golden/samples/swift 1 … +3 more layers (profile --full) patterns: Command / Handler (28: src/cli/commands), Adapter (3), Strategy (2), Builder (1) unknown: src/query/format (22 files), src/profile (19 files), src/lang/js (15 files), +63 more folders

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
find_callersA

Who calls it: file, method, line range and the call's own line (L25 │ code) of each caller; paths are relative to the root: line. Start with the name pattern (regex) (^|::|\.|->)cancel$: it finds every call, also with an unknown/inherited receiver. Order::cancel lists only calls resolved to that type (via <Type> = through its interface/parent/trait), so it can miss callers; ?::name = name-only match. depth 2–5 = impact analysis (callers of callers); guess adds name-only matches (?). Example: {"pattern": "(^|::|\.|->)cancel$", "path": "app"}.

framework_viewA

Framework view of a directory: routes, middleware, validation, jobs, events, providers, magic, di, views. Example: {"view": "routes", "path": "routes"}. Run it on the directory that holds the definitions (a file works too).

guideA

The full callgraph manual (the skill's SKILL.md in the configured language): every query with CLI examples, JS/TS/Vue, Rust, Swift, Python and Go specifics, formats, limits. Call it once when the server instructions are not enough; the CLI flags map to these tools (see its MCP section).

locateA

Where to start with a task: give the names and domain terms from the task in ONE call; answers from the project map (no file reading) with a short ranked list of files (top 5; all: true = every match), each with its reasons: exact definition, file name, name part, string literal, call, callers: N. Example: {"terms": ["RefundController", "processRefund", "refund", "payment_status", "checkout.vue"]}. Pitfall: pass code names, not a sentence; translate non-English domain words to their English code names (visszatérítés → refund); one call with all terms, not one call per term. For exact text (log message, config value) use Grep.

method_bodyA

Line-numbered source of one or more methods/functions, compact: the docblock above the method and blank lines dropped, comments inside the body kept (line numbers stay exact; the header says when a docblock was omitted; doc: true adds it, raw: true = exact, unfiltered text, e.g. before editing). Use after outline instead of reading the whole file. Example: {"path": "app/Order.php", "method": ["cancel", "refund"]} (method may be a string or a list).

nextA

Run a suggested next step by its number instead of composing the call: some results end with ↪ r7 possible next: [1] … [2] … (only when the server runs with --next). Use it only if a suggestion fits your task; otherwise ignore the line. Example: {"result_id": "r7", "choice": 1} or {"result_id": "r7", "choice": [1, 3]}. Ids are per project and expire after 24 hours.

notesA

Notes (pilot) attached to files or methods by people/agents: path[::method] time 📝 text, [orphaned] if the method is gone. Read-only (notes are written with the CLI callgraph note add). Example: {"pattern": "refund", "path": "app"}; without pattern: all notes.

outlineA

Structure of a code file or directory without reading it: classes/components, methods with line ranges, calls by category. With method: that one method's call graph. Start here once you know the file (else locate). Example: {"path": "app/Order.php", "method": "cancel"}. Pitfall: give the method in method, not as path::method; on a large directory use format: summary or a subdirectory.

project_profileA

Project profile from folder and file names, checked against the code graph: architecture (Laravel/Yii layered MVC, DDD/hexagonal, Vue/React frontend, SwiftUI MVVM, Rust web), layers with their folders and file counts, design patterns, the call direction between layers, unknown folders (~15 lines). Call it first in an unfamiliar project, then pass layer (e.g. "service") to outline / search / find_callers. Example: {} or {"project": "shop", "full": true}. Pitfall: a layer name comes from this list (controller, service, repository, model, component, store…), not a folder path.

projectsA

Registered project aliases and their roots (for the project parameter). Call it when the server's working directory is not the project (e.g. Claude Desktop), then pass project to every tool.

searchA

Where a string literal (error message, key) or a constant is used/defined (substring match). Example: {"kind": "strings", "pattern": "Order not found"} or {"kind": "constants", "pattern": "STATUS_ACTIVE"}. For calls of a function use find_callers.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.9/5.0

Scored across 11 tools

Disambiguation4/5

Most tools target a clearly distinct question (who calls X vs. what's inside X vs. where do I start), and descriptions explicitly cross-reference each other ('For calls of a function use find_callers', 'Start here once you know the file (else locate)'). The residual overlaps are directory-level inspection (outline vs. framework_view) and symbol lookup (locate vs. search by strings/constants), which a careful agent could still confuse on a first pass.

Naming Consistency3/5

Names are readable but mix conventions: verb-style (find_callers, locate, search) alongside bare nouns (outline, notes, next, guide, projects) and compound nouns (framework_view, project_profile, method_body). There is a loose theme but no predictable verb_noun pattern, and closely related tools (projects vs. project_profile) differ only by a suffix.

Tool Count5/5

Eleven tools is well within a comfortable range and each maps to a real step in code exploration (project setup, orientation, localization, structure, bodies, callers, text search, help). No obvious filler tools; guide and next are thin but justified as meta-helpers.

Completeness4/5

The exploration lifecycle is largely covered: project registration/profile, symbol location, structural outline, method bodies, caller/impact analysis, and literal search, plus framework-specific views. Gaps are minor: no explicit callees/downstream-call tool (partly covered by outline with method), and notes are read-only with writes only via the CLI.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues