MCP in Daily Work: Practical Architecture, Token Costs and Security Reality
Model Context Protocol connects AI assistants to local files, databases, and APIs without manual copy-pasting. Here is how it works, what it costs in tokens, and its real security trade-offs.
Hi folks. Lately, I've noticed more and more articles and discussions about MCP and the tooling ecosystem growing around it. That made me curious enough to look back through my own blog archive to see if I had ever covered it! Turns out I hadn't. Despite writing extensively about AI and coding agents, MCP was still missing. But it is never too late to start, right?
Model Context Protocol (MCP) is an open standard that connects AI assistants to external tools, local files, and data sources through JSON-RPC instead of manual copy-pasting. It solves the N-by-M integration bottleneck by giving models a uniform way to discover and call capabilities. However, connecting dozens of servers can consume tens of thousands of context tokens before you type a prompt, and tool descriptions represent untrusted input that requires strict execution boundaries.
The Tuesday Problem: Stop Being the Cable
Take an ordinary Tuesday morning workflow. You have a team sync on your calendar, a bug report in your error tracker, and a design document from last week. To resolve the bug with a standard chatbot, you copy the stack trace from your tracker, paste database schemas from your terminal, copy notes from your wiki, and explain how they relate.
Tomorrow, you repeat the same routine. In that workflow, you are acting as an expensive human patch cable between your applications and the language model.
MCP replaces that manual integration loop with a standardized protocol. Instead of custom code for each tool or manual pasting, your AI assistant connects to servers that expose context and actions. Anthropic introduced MCP in late 2024 and donated it to the Agentic AI Foundation under the Linux Foundation in December 2025. By late 2025, Anthropic reported over 10,000 active public MCP servers and 97 million monthly SDK downloads.
The Architecture: Three Roles and Three Primitives
MCP operates on a client-server architecture built on JSON-RPC 2.0. The protocol divides responsibilities across three roles:
- Host: The user-facing AI application where the conversation happens, such as Claude Desktop, Claude Code, Cursor, or VS Code.
- Client: An internal adapter maintained by the host. A client establishes a dedicated 1:1 connection with an individual server.
- Server: A lightweight program that exposes specific data, resources, or executable actions to the client.
Local servers run as child processes using standard input and output (stdio). Remote servers connect over Streamable HTTP with Server-Sent Events (SSE) and OAuth 2.1 authentication. The 2026-07-28 protocol revision dropped the initial negotiation handshake. Each request carries protocol versioning and capabilities inside its metadata block.
Servers expose capabilities through three core primitives:
- Tools (Model-Controlled): Executable functions that the model chooses to call based on the user's intent. Examples include executing a SQL query, querying an issue tracker, or creating a calendar event.
- Resources (Application-Driven): Passive, read-only data attachments such as file contents, system logs, or database schemas. The host application decides how and when to attach resources to the prompt.
- Prompts (User-Controlled): Pre-packaged prompt templates and recipes triggered by user slash commands.
Tools grant execution power to the model, while resources and prompts supply context to the application and user.
The Context Window Tax
MCP eliminates manual data copying, but schema definitions consume tokens quickly.
To let a model know what tools exist, the host must supply each tool's name, description, and JSON schema inside the model's context window. When you connect five or ten feature-rich servers (such as GitHub, Slack, Postgres, and Google Drive), their schema definitions accumulate.
According to official MCP documentation, loading full definitions for dozens of servers upfront can consume up to 150,000 tokens before the user enters a single character. That volume crowds out actual working context, increases request latency, and can degrade tool selection accuracy.
To reduce this context tax, hosts implement progressive tool discovery:
- Meta-tools: The host exposes a compact
search_toolsfunction, deferring complete schemas until needed. - On-demand inspection: The model queries the catalog, inspects only the matching tool schemas, and executes them. The MCP documentation reports that this approach cuts initial tool definitions to ~2,000 tokens.
- Code execution mode: Instead of piping large data payloads back into the conversation history, the model writes a script that runs in a sandbox and returns only the final summary.
These fixes require host-level engineering. Adding or removing tool schemas mid-conversation invalidates prompt caches. A cache miss on a long conversation costs more in latency and tokens than keeping tool definitions resident. For related background on managing agent context, see our guide on Context Compression for Coding Agents.
The Security Reality: Tool Descriptions Are Untrusted Input
MCP standardizes communication; the host application remains responsible for sandboxing and execution boundaries.
Local MCP servers run as child processes under the exact operating system permissions of your user account. If you add a malicious or unverified local server with a command like npx bad-server, that process has full access to read your local files, access your SSH keys, and reach your network.
{
"mcpServers": {
"local-filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "C:\\Projects"],
"env": {}
}
}
}Legitimate servers also carry a subtler risk through tool poisoning. In April 2025, security researchers proved that language models treat tool descriptions and tool results as prompt instructions. A compromised server or an untrusted external data source (such as an email or calendar invite containing prompt injection) can instruct the model to misuse another connected tool, such as reading private configuration files and sending them to an external endpoint.
The MCP specification requires hosts to treat tool results from one server as untrusted input to another. To protect your workflow:
- Review startup commands: Do not run unvetted
npxor shell commands from community snippets without inspecting their source. - Enforce human approval: Keep confirmation dialogs enabled for destructive actions and parameter inspections.
- Grant minimal scopes: Connect servers strictly to required project directories or read-only database roles.
- Separate sensitive sessions: Do not connect servers that handle production credentials in the same chat session where you process untrusted web pages or external emails.
Practical Verification: Testing with MCP Inspector
To test a server before connecting it to your daily workspace, use the official MCP Inspector. I tested @modelcontextprotocol/inspector (version 2.13.0) on Windows 11 with Node.js 24.14.
Run the inspector via npx in CLI mode to verify that tools return valid JSON schemas without launching an interactive chat:
npx -y @modelcontextprotocol/inspector --cli --helpYou can query methods like tools/list or invoke specific tools with the inspector CLI:
npx -y @modelcontextprotocol/inspector --cli \
--transport stdio \
node ./dist/index.js \
--method tools/listUsing the inspector isolates protocol bugs from model hallucinations. When a tool fails in an IDE, testing it in the inspector reveals whether the error comes from transport or an unexpected schema.
When Should You Use MCP Over Your Terminal CLI?
A standard terminal command outperforms an MCP server for core engineering workflows.
| Criterion | Standard Terminal CLI / Scripts | Model Context Protocol (MCP) |
|---|---|---|
| Context Overhead | Zero tokens until invoked; --help loads on demand |
Requires schema definitions in context upfront |
| Authentication | Local environment credentials or SSH agent | Standardized OAuth 2.1 or managed process env |
| Tool Execution | Deterministic shell pipelines (grep, git, jq) |
Model-mediated parameter generation and tool calls |
| Best Used For | Fast local file searches, git workflows, builds | Cross-app data flows, remote APIs, non-CLI services |
| Safety Posture | Standard OS terminal permissions | Local user privileges plus model prompt injection risks |
For developers working inside coding agents like Claude Code or Cursor, tools like git, ripgrep, and local compilers already have well-defined command line interfaces. Wrapping routine CLI tools in MCP servers adds schema parsing overhead without measurable benefits. For a broader look at how skills and tools compare, read our analysis on Are Agent Skills the New npm? and review the current landscape in Top AI Coding Agents in 2026.
Reserve MCP for cases where protocol boundaries help most: connecting proprietary databases with read-only schemas, linking project management tools, or letting an assistant query remote platforms like Sentry without exposing raw production tokens to your terminal history.
Sources
- Model Context Protocol Specification (2026-07-28) - Official architecture specification and JSON-RPC lifecycle.
- MCP Client Best Practices - Context window consumption, progressive discovery, and prompt caching.
- MCP Security Best Practices - Threat modeling, token passthrough rules, and scope minimization.
- Agentic AI Foundation Announcement - Linux Foundation donation details and ecosystem statistics (December 2025).
- Invariant Labs Security Research - Security analysis on tool poisoning and prompt injection risks in MCP.