Skip to main content

Analyze MCP servers and see how much context window each tool consumes

Project description

mcp-diet

CLI tool that analyzes MCP servers and shows how much of your AI agent's context window each tool consumes, then grades efficiency.

Install

pip install mcp-diet
# or
uvx mcp-diet

Usage

# Analyze a running MCP server via stdio
mcp-diet analyze -- npx @modelcontextprotocol/server-filesystem /tmp

# Analyze via SSE
mcp-diet analyze --sse http://localhost:3000/sse

# Auto-detect from Claude config (.mcp.json or ~/.claude/settings.json)
mcp-diet auto

# Output formats
mcp-diet analyze --format json -- npx @modelcontextprotocol/server-filesystem /tmp
mcp-diet analyze --format markdown -- npx @modelcontextprotocol/server-filesystem /tmp

# Optimization suggestions
mcp-diet suggest -- npx @modelcontextprotocol/server-filesystem /tmp

What it shows

For each tool in the MCP server:

Column Description
Tool name The tool's registered name
Tokens Estimated token count of the full tool definition
% of budget Percentage of a configurable context budget (default: 200k)
Schema depth Max nesting depth of the JSON schema
Desc length Character count of the description
Grade A-F rating based on token efficiency

Grading

Grade Tokens per tool
A < 200
B 200-500
C 500-1000
D 1000-2000
F > 2000

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_diet-0.1.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_diet-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file mcp_diet-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_diet-0.1.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.3

File hashes

Hashes for mcp_diet-0.1.0.tar.gz
Algorithm Hash digest
SHA256 15c1d7a905a78760dac27e5014a7a6c1e2794df8ef3c97703a0bdd56d0a630d7
MD5 14a8978357d96a300bc9a0976a49ee4c
BLAKE2b-256 1049f0590b40fe816a48ee004742ccdc4b98311646c577432921e88f62470d40

See more details on using hashes here.

File details

Details for the file mcp_diet-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_diet-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.3

File hashes

Hashes for mcp_diet-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54a041039bf91681456702dde166c14c13147466a5650d7b7247cb1af116dd4a
MD5 a484b9f395a0f896d0e3d835ddbe19f1
BLAKE2b-256 4f7093cdae05fc38b5addd2666f8a9a19c5eef84e886263fa7a70ce1ed5aed4b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page