Metadata-Version: 2.4
Name: mcp-diet
Version: 0.1.0
Summary: Analyze MCP servers and see how much context window each tool consumes
Author: mcp-diet contributors
License: MIT
Keywords: cli,context-window,llm,mcp,token-counting
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.12
Requires-Dist: click>=8.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: rich>=13.0
Requires-Dist: tiktoken>=0.7.0
Description-Content-Type: text/markdown

# 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

```bash
pip install mcp-diet
# or
uvx mcp-diet
```

## Usage

```bash
# 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 |
