Skip to main content
Glama

mcp-footprint

mcp-footprint MCP server

Protocol-level MCP (Model Context Protocol) context footprint analyzer. Discovers local MCP client configs, probes live JSON-RPC 2.0 servers (stdio, Streamable HTTP, Legacy HTTP+SSE) or offline snapshots, counts exact BPE tokens (cl100k_base / o200k_base), flags schema bloat, duplicate tools, and zombie servers/tools, and generates concrete pruning diffs. Listed on Glama MCP Servers with MCP Inspector snapshot verification.

  • Zero telemetry — runs 100% locally; never phones home or sends schemas to third parties.

  • Secret-safe by design — redacts env, headers, bearer_token_env_var, URL credentials, and secret CLI flags before returning or printing any report.

  • Zero prompt retention — session log correlation reads only numeric tool-call counts (mcp__<server>__<tool>), never prompt text or tool arguments.

Quick Start

# Audit all local MCP configs (Claude Code, Cursor, VS Code, Claude Desktop, Windsurf, Codex)
npx mcp-footprint

# Audit a static tools/list or multi-server JSON snapshot offline
npx mcp-footprint --static ./snapshot.json

# Generate a concrete pruning diff & enforce a CI token budget
npx mcp-footprint --diff --max-tokens 6000

# Export GitHub PR Markdown, JSON, or a standalone SVG badge
npx mcp-footprint --markdown
npx mcp-footprint --json
npx mcp-footprint --svg-badge --output mcp-footprint.svg

Related MCP server: context-surface-analyzer

Supported Clients & Formats

Client

Global Config Paths

Workspace Configs

Format & Root Keys

Claude Code

~/.claude.json (mcpServers & projects[*].mcpServers)

./.mcp.json

JSON (mcpServers)

Cursor

~/.cursor/mcp.json, platform app data Cursor/mcp.json

./.cursor/mcp.json

JSON/JSONC (mcpServers)

VS Code

User Code/User/mcp.json, Code/User/settings.json

./.vscode/mcp.json, ./.vscode/settings.json

JSONC (servers, mcpServers, mcp.servers, inputs)

Claude Desktop

Platform app data Claude/claude_desktop_config.json

—

JSON (mcpServers)

Windsurf

~/.codeium/windsurf/mcp_config.json

./.windsurf/mcp_config.json

JSON/JSONC (mcpServers)

OpenAI Codex

~/.codex/config.toml, ~/.codex/config.json

./.codex/config.toml, ./.codex/config.json

TOML ([mcp_servers.<name>]) / JSON

CLI Options

Flag

Description

--config <path>

Explicit config file path(s), repeatable or comma-separated

--static <path>

Inspect a static JSON snapshot (tools/list, JSON-RPC result, or { servers: ... }) without spawning processes or network I/O

--no-probe, --dry-run

Discover & validate configs without probing servers

--no-global

Scan current workspace configs only

--tokenizer <name>

cl100k_base (default) or o200k_base

--days <n>

Session log lookback window in days (default: 30)

--timeout <ms>

Per-server live probe timeout in ms (default: 8000)

--max-tokens <n>

Exit code 1 if total context footprint exceeds <n>

--json

Emit structured JSON report

--markdown

Emit GitHub-flavored Markdown report

--diff

Emit concrete config pruning patch / unified diff

--svg-badge

Emit standalone SVG badge

--output <path>

Write output to a file

--mcp

Start as a lean, read-only stdio MCP server

Diagnostic Rules

  • DESC_BLOAT — Tool description exceeds 150 tokens / 600 chars (warning) or 400 tokens / 1,600 chars (error).

  • SCHEMA_COMPLEXITY — Deeply nested JSON Schema (depth >= 4), excessive anyOf/oneOf/allOf unions (>= 4), or wide parameter objects (>= 15 properties).

  • DUPLICATE_TOOL — Exact or normalized tool name collision across multiple active servers.

  • ZOMBIE_SERVER / ZOMBIE_TOOL — Active server or tool with 0 observed calls in local Claude Code / Codex session JSONL logs (skipped cleanly when no session logs exist).

  • BUDGET_EXCEEDED — Context footprint exceeds --max-tokens (or default 10k/20k thresholds).

  • CONFIG_PARSE_ERROR / PROBE_TIMEOUT / PROBE_FAILED / AUTH_REQUIRED / ENV_VAR_UNRESOLVED — Config or transport diagnostics with RFC 6901 jsonPointer coordinates.

GitHub Action (action.yml)

- uses: nodebudget/mcp-footprint@v0.1.3
  with:
    static-path: .mcp/snapshot.json
    max-tokens: "8000"
    fail-on-error: "true"
    comment-pr: "true"

Programmatic TypeScript / ESM API

import {
  discoverConfigs,
  analyzeFootprint,
  inspectStaticSnapshot,
  generatePruningDiff,
  generateSvgBadge,
} from "mcp-footprint";

const report = await inspectStaticSnapshot("./snapshot.json", {
  tokenizer: "cl100k_base",
  maxTokens: 8000,
});

const diff = generatePruningDiff(report);
const svg = generateSvgBadge(report);

Read-Only MCP Server Mode (--mcp)

mcp-footprint --mcp exposes three minimal read-only tools (inspect_mcp_snapshot, analyze_mcp_config, diff_mcp_budget) over stdio JSON-RPC 2.0 (2025-03-26).

License

MIT — see LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables analyzing and optimizing context window token usage by measuring, compressing, and eliminating waste from MCP tool definitions.
      58 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables deterministic analysis of a single Agent tool-catalog snapshot and comparison of two snapshots through read-only JSON-RPC tools, reporting digests, schema statistics, duplicates, collisions, budget checks, and diffs.
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables auditing MCP servers' tools by their estimated context token cost, ranking verbose names, descriptions, and schemas before they consume the agent window. Can run as an MCP tool so agents can budget their own context.
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Checks the MCP server you're building the way clients and agents meet its tool list. It flags what agents misread (vague parameters, writes marked read-only), what breaks clients or prompt caches (tools that appear mid-session, schemas that change on every call), and breaking changes between releases with the version bump they need. Same input, same answer: no LLM involved.
      6
      912 npm
      2
      MIT