What Is Model Context Protocol (MCP)? A Developer's Guide

Model Context Protocol (MCP) standardizes how AI agents discover and call external tools. Here's how it works, what it solves, and where it ends — and what fills the gap.

by AnyCap

The hardest part of building with AI agents was never the reasoning. It was getting the agent to reliably call the right external tool at the right time.

Before MCP, every integration was a one-off: custom prompts, fragile JSON schemas, different auth patterns for every service. Your agent could reason brilliantly and still fail because it couldn't figure out how to talk to your database, your GitHub repo, or your web search service.

Model Context Protocol (MCP) fixes this. Here's what it actually is, how it works, and where it fits in a real agent stack.


What Is Model Context Protocol (MCP)?

Model Context Protocol (MCP) is an open standard that defines how AI agents discover and call external tools.

That's the one-sentence answer. The slightly longer version: MCP gives agents a consistent way to connect to external services — databases, APIs, file systems, code repositories, web browsers — without requiring custom integration code for every combination of agent and tool.

MCP was introduced by Anthropic in late 2024 and has since been adopted across the ecosystem. Claude, Cursor, Windsurf, GitHub Copilot Agent, and most major AI coding environments support it today.

The core insight: if every tool speaks the same language, any agent can use any tool without special-purpose glue code.


Why MCP Was Necessary

Before MCP, extending an AI agent required:

  • Writing custom prompt instructions for each tool
  • Manually defining input/output schemas the model could understand
  • Handling authentication separately for every integration
  • Rebuilding the same infrastructure whenever you switched agent frameworks

That was manageable when an agent had two or three tools. It became unsustainable when real workflows needed ten, twenty, or more.

MCP replaces that sprawl with a single protocol. Tools expose themselves through a consistent interface. Agents discover what tools are available and call them using a standard schema. The same MCP server works with any MCP-compatible agent — no rewrites.


How MCP Works: The Three Components

MCP defines three roles that work together:

MCP Hosts — the agent environment. Claude Desktop, Cursor, Windsurf, Claude Code, and similar tools act as MCP hosts. They discover available servers and give the model access to their tools.

MCP Servers — individual services that expose capabilities. A GitHub MCP server exposes tools like create_issue, list_repos, get_file_contents. A PostgreSQL server exposes run_query, list_tables. A web search server exposes search.

MCP Clients — the connector built into the host that talks to MCP servers, relays tool schemas to the model, and forwards tool calls to the right server.

The flow:

  1. You add a server to your host environment
  2. The host asks: "what tools do you have?"
  3. The server returns a list of tool schemas (names, descriptions, input parameters)
  4. The model now knows those tools exist and how to call them
  5. When the agent decides to use a tool, it formats a call per the schema — the client routes it to the server, which executes and returns structured output

Setting Up Your First MCP Server

The most common setup is Claude Code. Two approaches:

Quick add via CLI:

# GitHub integration
claude mcp add github -- npx -y @modelcontextprotocol/server-github

# Web search
claude mcp add brave-search -- npx -y @modelcontextprotocol/server-brave-search

# PostgreSQL database
claude mcp add postgres -- npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb

Team-wide with .mcp.json (commit this to your repo):

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token"
      }
    },
    "brave-search": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-brave-search"],
      "env": {
        "BRAVE_API_KEY": "your_brave_key"
      }
    }
  }
}

Essential management commands:

claude mcp list              # see connected servers
claude mcp remove github     # disconnect a server
claude doctor                # diagnose connection issues

Once connected, Claude knows the tools exist. Ask it to "check my open GitHub PRs" and it will discover and call the right tool automatically.

Cursor setup: Open Settings → Features → MCP Servers in the Cursor UI, or configure servers in .cursor/mcp.json.

Windsurf setup: MCP servers are configured in Windsurf's Cascade environment via Settings → AI Tools.


What MCP Does Well

Universal tool compatibility

Any MCP server works with any MCP host. A GitHub server built for Claude works in Cursor without modification. This cross-compatibility is MCP's most valuable property — it created a real ecosystem.

Standardized schemas

Every tool in every server uses the same schema format. Agents don't need custom instructions for each integration — they read the schema and understand how to call the tool.

Open ecosystem with hundreds of servers

MCP is open source with a growing registry. Official servers from Anthropic cover GitHub, file systems, databases, web search, Slack, and Notion. Community servers cover thousands more services.

Team sharing via version control

Commit .mcp.json to your repo and every team member gets the same tool configuration without separate setup steps. Agent tooling becomes a version-controlled team artifact.


What MCP Doesn't Solve

MCP is a protocol — a connection standard. It handles how agents connect to tools. It doesn't handle the operational complexity of running multiple integrations at scale.

Token overhead grows with each server. Every MCP server registers its tool schemas in the agent's context window. A typical server adds 3,000–8,000 tokens. Five servers means up to 40,000 tokens of overhead before the agent writes a single line of code — 20% of a 200K context window gone.

Auth fragmentation stays. Each server requires its own credentials: a GitHub token, a Brave API key, a Postgres connection string, a Notion integration key. MCP doesn't unify authentication — it still requires one credential per service.

Maintenance multiplies. Every server has its own release cycle, schema changes, and failure modes. As your stack grows, maintenance overhead grows with it.

No built-in capability coverage. The protocol handles discovery and invocation, but whether you can actually generate an image, produce a video, host a file, or publish a page depends entirely on whether someone has built and maintains a reliable MCP server for that capability. Many common agent capabilities don't have production-grade MCP servers.

This is why teams that need a broad set of capabilities — especially media generation, cloud storage, and publishing — often reach for a capability runtime alongside their MCP servers. More on that difference →


MCP, Skills, and Capability Runtimes: Different Layers

These three pieces of agent infrastructure get confused constantly. They work together — not as substitutes:

Layer What it is What it solves
MCP Open protocol for tool discovery and invocation How agents connect to tools and understand their schemas
Skills Instruction files that teach agents how to use tools How agents learn workflow sequences, edge cases, and conventions
Capability runtime Unified execution layer for common real-world capabilities How agents do search, media generation, storage, and publishing without separate integrations

The pattern most production agent stacks land on:

  • MCP servers for narrow custom integrations (internal database, company Slack, proprietary APIs)
  • A capability runtime for common capabilities every agent needs (web search, image generation, video, file hosting, publishing)
  • Skill files for team-specific workflows and conventions

Collapsing these into one concept leads to over-engineered setups. Keeping them separate makes the architecture much easier to reason about.

See the full breakdown: MCP vs Skills vs Capability Runtime →


Decision Framework: MCP vs Capability Runtime

Use MCP when:

  • The integration target is a specific internal or proprietary system
  • The capability is narrow and specialized (your database, your Slack workspace)
  • You have resources to maintain individual server configurations
  • Protocol standardization is the primary challenge

Use a capability runtime when:

  • Your agent needs multiple common capabilities (search, image, video, storage, publish)
  • You want one consistent execution surface instead of five separately configured servers
  • Reducing auth sprawl and maintenance overhead matters
  • The workflow crosses multiple output types — code, media, delivery

Use both when:

  • Internal tools need MCP servers for proprietary data access
  • Common external capabilities run through a unified runtime
  • This hybrid is the honest answer for most serious agent teams

Common MCP Troubleshooting

Problem Fix
Server not showing in agent Quit and restart the agent (full restart required)
"Connection closed" errors nvm install 22 && nvm use 22 (Node version mismatch is common)
Auth fails silently Regenerate the API key; check env var names exactly
Tool schemas missing Run claude doctor before manual debugging — catches most config issues
Token overhead too high Consider replacing multiple servers with a capability runtime for common capabilities

FAQ

Is MCP only for Claude?

No. MCP is an open standard introduced by Anthropic but adopted industry-wide. Cursor, Windsurf, GitHub Copilot Agent, and other agent environments support it. Any MCP server you build works across all of them.

Do I need to write code to set up an MCP server?

For most use cases, no. Official MCP servers install via npx without custom code. Custom integrations for proprietary systems require writing a server, but the boilerplate is minimal and well-documented.

How much context does an MCP server consume?

Each server typically adds 3,000–8,000 tokens via its tool schema definitions. Adding multiple servers compounds that overhead. This is why teams with many required capabilities often use a capability runtime to cover the common ones without stacking schemas.

Can I use MCP servers and AnyCap together?

Yes. They solve different problems. MCP servers handle narrow internal integrations. AnyCap is a capability runtime that gives agents a unified execution surface for common external tasks — web search, image generation, video, cloud storage, publishing — through one CLI with one auth flow.

Is AnyCap an MCP server?

No. AnyCap is a capability runtime and stronger agent CLI. It gives agents a unified execution surface without the token overhead or auth fragmentation of stacking separate MCP servers. See the full comparison →