MCP Analytics: Optimizing Handshake and Token Payload Costs
Dennis Zagiansky6 min read
Here's a pattern that's easy to miss on a token bill.
A database agent gets short questions from users and sends compact results back. Still, every session starts with roughly 2,000 tokens of input before the model writes its first word.
The culprit was neither the user prompt nor the model response. It was the handshake: the automated capability discovery that occurs whenever an agent connects to a Model Context Protocol (MCP) server.
What is MCP Analytics? Unlike connectors that bridge data to agents, MCP analytics refers to the observability of the Model Context Protocol itself: monitoring token usage, payload efficiency, and server performance across agent interactions.
MCP has rapidly become the open standard for connecting AI models to corporate databases, internal APIs, and local developer tooling. By standardizing how systems expose context, MCP removes the pain of writing custom glue code for every model provider. But that standardization introduces a real architectural tradeoff: dynamic payload weight.
The Cost of Connectivity: Why You Need MCP Server Monitoring
Connecting an agent to an external system traditionally meant writing hardcoded tool declarations directly inside the system prompt. MCP replaces that brittle setup with dynamic discovery. When an agent opens an MCP connection, the client queries the server for its available tools, resources, and prompt templates.
This architectural shift solves integration management, but it shifts the cognitive burden to the model's context window. The agent must consume and process the entire tool definition menu before it can decide which tool to call.
As production teams scale agentic workflows, this payload weight creates two major problems:
- Direct compute costs: Input tokens cost real money. When every interaction begins with a heavy payload load, quiet applications rack up significant monthly bills.
- Context degradation: Large system descriptions reduce the effective context window available for actual conversation history, multi-turn reasoning, and complex user instructions.
Managing this tradeoff requires teams to go beyond basic AI agent conversation analysis and treat tool protocols with the same discipline as microservice APIs.
Key Metrics for MCP Evaluation
Evaluating the quality and performance of an MCP server requires moving beyond traditional server uptime. Teams evaluating MCP infrastructure should monitor four core metrics:
- Latency and Handshake Overhead: Wall-clock time spent negotiating server capability menus compared to actual query execution time.
- Tool Payload Efficiency: The token density of tool schemas relative to the underlying parameters required by the model.
- Reliability and Error Rate: Frequency of malformed tool calls, timeout rates, or schema parsing exceptions across model runs.
- Data Security and Context Isolation: Verification that sensitive internal API fields or administrative credentials are stripped before sending schema payloads to external model providers.
Breaking Down the Handshake: How Anthropic MCP Tokens Scale
To see how fast the menu tax adds up, look at Oracle's official SQLcl MCP server, which exposes database tools directly to AI agents. In a comparison published on the Oracle Developers blog, Nacho Martinez estimated that its tool menu alone takes about 2,139 tokens, read once per session, just to declare what the server can do.
That payload is transferred before the user enters a prompt or the agent runs a single SQL query.
His own minimal server offered the same kind of access with an 862-token menu, about 60% smaller.
Here is how the arithmetic adds up across production workloads:
- Base cost per connection: 2,139 tokens per session startup.
- Daily volume at scale: 1,000 agent sessions per day equals 2.139 million input tokens daily.
- Monthly token burn: 64.17 million input tokens per month spent exclusively on capability discovery.
- Financial impact: At Claude Sonnet 5.5's input price of $2 per million tokens, reading this one tool menu costs about $4.28 a day, or $128 a month.
If the same agent connects to three similar MCP servers (say a database, a code repository and a ticketing system), that cost roughly triples, to around $385 a month in this example, just to introduce the agent to its tools.
Two things move that number. The Messages API takes tool definitions with every request, so a multi-turn session can pay for the menu several times, not once. Prompt caching pulls the other way: cached input on Sonnet 5.5 costs $0.10 per million tokens, which would bring the single-server menu down to about $6 a month if the cache stays warm. You only know which case you're in if you measure it.
It's the same lesson we learned when we cut our own LLM cost per session: you find the waste by measuring what each session actually spends, not by guessing.
Model Context Protocol Tracing: Beyond JSON Formatting Bloat
Anthropic's OpenTelemetry trace export for the Claude Platform, in public beta since October, makes this easier to see. By default its spans record which MCP servers a call used, which helps tie a session's spend back to the connections behind it. And the overhead doesn't stop at the handshake. Once the agent picks a tool and runs a query, the format of the data that comes back sets a second payload cost.
Many database connectors return results as JSON. It's the default for web APIs, but it's an expensive way to hand rows to a model. Curly braces, quotes, colons and the same key names repeated on every record all cost input tokens without telling the model anything new.
Martinez's comparison shows the gap on a simple 96-row query result (his counts are estimates based on word count, not a model's tokenizer):
- Oracle's SQLcl MCP server: about 2,136 tokens to pass 96 rows to the agent.
- His minimal custom server: about 825 tokens for the same rows, returned as a plain table with one metadata line instead of JSON.
- Net Savings: A 61.4% reduction in token consumption for the exact same underlying dataset.
Tool descriptions are the other place to trim. Here's an illustrative before and after:
// BEFORE: Decorative Tool Description (High Token Count)
{
"name": "execute_sql_query",
"description": "This magnificent tool takes a user-supplied SQL string, executes it against our corporate database instance, cleans the output, and returns formatted records. Please ensure your query is safe, valid ANSI SQL.",
"parameters": { "type": "object", "properties": { "query": { "type": "string" } } }
}
// AFTER: Pruned Tool Description (Optimized for Context Windows)
{
"name": "sql_query",
"description": "Executes read-only SQL queries against primary database. Input must be raw ANSI SQL string.",
"parameters": { "type": "object", "properties": { "query": { "type": "string" } } }
}Multiplying a 61.4% payload reduction across thousands of database requests fundamentally alters the unit economics of an agentic application. When we worked on building our own Brizz MCP server, analyzing schema overhead allowed us to keep capabilities lean and focused.
Implementing MCP Observability: 4 Engineering Best Practices
To optimize your MCP server infrastructure and keep context window usage efficient, implement these four engineering practices:
- Audit and prune tool descriptions: Remove decorative prose from tool schema definitions. Ensure parameter descriptions are concise and focused on required constraints rather than lengthy documentation.
- Implement dynamic capability loading: Avoid loading all MCP servers globally. Use lightweight router logic to expose relevant tools to the model only when user intent requires them.
- Optimize transport data shapes: Replace verbose JSON outputs with dense, plain-text formats or minimized arrays for tabular query results returned to the agent.
- Continuous payload monitoring: Set up continuous telemetry on token payload sizes per session to catch regressions when backend server definitions or data schemas update.
The Bottom Line
Model Context Protocol solves tool integration, but unmonitored server defaults turn context windows into expensive overhead. By measuring payload weight with MCP analytics and returning results in leaner formats, teams can cut tool payload costs a lot (around 60% in the Oracle comparison) without giving up agent capabilities. Standardize your connectivity, but audit the handshake before context bloat creates silent failures in agentic workflows.