Back to Home
sd2k icon

mcp-tokens

Verified Safe

by sd2k

Overview

Analyzes the token usage of Model Context Protocol (MCP) servers to help authors understand, track, and optimize context window consumption for AI models.

Installation

Run Command
mcp-tokens analyze -- npx @modelcontextprotocol/server-everything

Environment Variables

  • ANTHROPIC_API_KEY
  • MCP_TOKENS_PROVIDER
  • MCP_TOKENS_MODEL

Security Notes

The tool is designed to execute user-provided commands to start target MCP servers, which inherently carries a risk if a malicious command is supplied by the user. However, this is part of its intended functionality to analyze local or remote MCP servers. External network requests are made to the Anthropic API for accurate token counting, using an API key managed via environment variables or CLI arguments. The source code does not contain 'eval' or similar dynamic code execution patterns, nor any hardcoded secrets. The `mcp-tokens` tool itself does not expose any network services.

Similar Servers

Stats

Interest Score0
Security Score9
Cost ClassLow
Avg Tokens1934
Stars0
Forks0
Last Update2025-12-12

Tags

token-analysismcpai-developmentci-cdrust