Skip to main content

MCP Tools

ArchGraph exposes 21 tools via the Model Context Protocol. Every tool is a POST on the MCP endpoint (https://mcp.archgraph.dev/mcp) carrying an Authorization: Bearer ag_… header. Request/response bodies are JSON.

Plan tiers

TierTools available
Free8 core code-intelligence tools
ProAll 21 tools (Free + 13 Pro)
EnterpriseSelf-hosted deployment with all 21 tools + audit log + SSO

If your plan does not cover a tool, the gateway returns a 403 with a tier hint.


Free tier (8)

Search code across repositories with rich query syntax. Use when an agent needs to locate a symbol, enumerate files of a type, or run repo:/lang:/file:/type: filters.

ParameterTypeDescription
querystringRich query string (e.g. lang:python type:function validate)
namestringSymbol name pattern (legacy; prefer query)
typestringNode type: function, class, struct, interface, enum, module, file
file_patternstringFile path pattern
limitnumberMax results (default 20)
workspace_idstringWorkspace ID for cross-repo search (Pro)
Request
{ "query": "lang:python type:function validate", "limit": 10 }

stats

Graph-level node counts by type for the active repo (or workspace).

ParameterTypeDescription
workspace_idstringOptional — workspace-scoped stats
Response
{ "nodes": 12843, "by_type": { "function": 7120, "class": 842, "file": 1231 } }

impact

Blast radius — trace upstream callers and downstream callees for a symbol.

ParameterTypeDescription
symbol_idstringSymbol identifier (e.g. func:src/auth.py:validate:42)
directionstringupstream, downstream, or both
max_depthnumberMax traversal depth (default 5)
workspace_idstringOptional — cross-repo impact (Pro)

context

360° view of a symbol — callers, callees, file, security flags, surrounding nodes.

ParameterTypeDescription
symbol_idstringSymbol identifier
workspace_idstringOptional — cross-repo context (Pro)

source

Source code body for a symbol.

ParameterTypeDescription
symbol_idstringSymbol identifier
workspace_idstringOptional — cross-repo source lookup (Pro)

search_calls

Search function call relationships (CALLS edges).

ParameterTypeDescription
callerstringCaller name pattern
targetstringTarget/callee name pattern
filestringFile path filter
resolved_onlybooleanOnly return resolved edges
max_depthnumberMax chain depth (default 1)
limitnumberMax results (default 20)
workspace_idstringOptional — cross-repo (Pro)

detect_changes

Recently changed files with downstream impact.

ParameterTypeDescription
sincestringTime window (e.g. 7d, 30d)

import_tree

Module-level import/dependency graph; detects circular imports.

ParameterTypeDescription
modulestringOptional — start from a specific module

Pro tier (13)

query

Execute read-only Cypher queries against the code graph. Writes are blocked at the engine level.

ParameterTypeDescription
cypherstringCypher query (MATCH ... RETURN ...)
Request
{ "cypher": "MATCH (f:Function) WHERE f.name CONTAINS 'auth' RETURN f.name, f.file LIMIT 5" }

find_vulnerabilities

CVE/GHSA matches on the dependencies extracted from the repo.

ParameterTypeDescription
severitystringFilter by critical, high, medium, low

taint_paths

Taint propagation source→sink chains. Backed by the Joern CPG taint engine for high-confidence findings.

ParameterTypeDescription
source_typestringFilter source category (http_input, file_read, env_var)
sink_typestringFilter sink category (sql_query, command_exec, file_write)
max_depthnumberMax chain length (default 10)
workspace_idstringOptional — cross-repo

data_flow

Track data flow through assignments, parameter passing, and return values.

ParameterTypeDescription
symbol_idstringFunction or variable node ID
directionstringforward, backward, or both
max_depthnumberMax depth (default 5)
workspace_idstringOptional — cross-repo

clusters

Functional clusters (Leiden community detection) with cohesion and coupling scores.

ParameterTypeDescription
min_sizenumberMinimum cluster size to include

churn

File modification hotspots from git history. Surfaces the top-N most-edited files and pairs them with structural complexity.

ParameterTypeDescription
sincestringTime window for churn (e.g. 90d)
topnumberNumber of hotspots (default 20)

cfg

Control flow graph for a function — basic blocks and branch edges.

ParameterTypeDescription
symbol_idstringFunction symbol ID

processes

Execution flow traces from entry points (CLI mains, HTTP handlers, cron jobs) through their call chains.

ParameterTypeDescription
entry_typestringFilter by cli, http, cron, etc.

diff_summary

Compare the current state of the repo against the stored graph — surfaces drift, deleted files, and new symbols.

ParameterTypeDescription
againststringComparison target (stored, branch:main)

workspaces

List workspaces — repo groups used for cross-repo analysis. Returns id, name, description, and repo_count. Pass the returned id to cross_repo_impact, cross_repo_taint, or dependency_graph.

Response
[
{ "id": "ws_…", "name": "Production Backend", "description": "Auth + billing services", "repo_count": 5 }
]

cross_repo_impact

Cross-repository blast radius. Shows which functions in OTHER repos in the workspace are affected when you change a symbol.

ParameterTypeDescription
symbol_idstringSymbol identifier
directionstringupstream, downstream, or both
max_depthnumberMax traversal depth (default 5)
workspace_idstringWorkspace whose repos define the cross-repo scope

cross_repo_taint

Cross-repository taint flow. Tracks data from input sources in one repo to dangerous sinks in another.

ParameterTypeDescription
workspace_idstringWorkspace defining the cross-repo scope

dependency_graph

Repo-level dependency graph for a workspace — which repos depend on which, with edge weights.

ParameterTypeDescription
workspace_idstringWorkspace ID
Response
{
"nodes": [{ "repo_tenant_id": "tenant_…__auth-service" }],
"edges": [{ "source": "…__auth-service", "target": "…__shared-libs", "type": "DEPENDS_ON_REPO", "weight": 12 }],
"truncated": false,
"total_available": 7
}

Session helpers

In addition to the 21 tools above, the gateway provides two session helpers (no plan gate):

  • repos — list all repositories your account has access to
  • use_repo — set the active repository for the current session; subsequent tools scope to it