sd2k/MCP Token Analysis
Analyze token usage of MCP servers and compare against baselines
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| command | Command to start the MCP server | yes | — |
| baseline | Path to baseline JSON file for comparison | no | — |
| threshold-percent | Maximum allowed percentage increase in tokens | no | 5 |
| threshold-absolute | Maximum allowed absolute increase in tokens | no | — |
| anthropic-api-key | Anthropic API key for accurate token counting (falls back to tiktoken if not provided) | no | — |
| provider | Token counting provider (anthropic or tiktoken). Auto-detects if not specified. | no | — |
| model | Model to use for token counting | no | — |
| all-providers | Generate baseline with all available providers for cross-environment compatibility | no | false |
| output | Path to save the report JSON | no | — |
| timeout | Timeout in seconds for server startup | no | 30 |
| version | Version of mcp-tokens to use | no | latest |
| comment | Post a PR comment with results (requires github-token for PRs) | no | false |
| comment-on-pass | Post a comment even when the check passes (only applies when comment is true) | no | false |
| max-tool-changes | Maximum number of tool changes to show in PR comment (0 for all) | no | 5 |
| github-token | GitHub token for posting PR comments (required if comment is true) | no | — |
Outputs
| name | description |
|---|---|
| total-tokens | Total token count |
| tool-tokens | Token count for tools only |
| provider | Token counting provider used |
| diff | Token difference from baseline |
| diff-percent | Percentage difference from baseline |
| passed | Whether the threshold check passed |
| failure-reason | Human-readable failure reason if threshold exceeded |
| baseline-tokens | Token count from baseline (for comparison) |
| tool-changes | JSON array of tool changes (added/removed/modified tools with token diffs) |
| tool-changes-count | Number of tools that changed |