Skip to content

MCP β€” Model Context Protocol

Model Context Protocol (MCP) is an open standard developed by Anthropic that defines how AI models communicate with external tools, data sources, and services. It gives AI agents a standardised way to reach beyond their training data β€” querying live databases, reading files, calling APIs, and executing actions.

Think of MCP as USB for AI. Just as USB standardised how devices connect to computers, MCP standardises how AI agents connect to the world.

Without MCP:

Each AI tool β†’ custom integration β†’ each data source
Claude Desktop needs custom code for GitHub, Jira, Slack, databases... separately

With MCP:

Any MCP-compatible AI tool β†’ MCP protocol β†’ any MCP server
One standard. Write it once, works with Claude, Kiro, Cursor, and any future AI tool.

LLMs are powerful but isolated. Out of the box, an AI assistant only knows what’s in its training data and the current conversation. For real-world work, it needs:

  • Your database schema β€” to write accurate queries
  • Your Jira tickets β€” to implement the right feature
  • Your codebase β€” to make consistent changes
  • Live APIs β€” to take actions, not just describe them

Before MCP, every AI tool built its own proprietary integration for each data source. The result: fragmented tooling, no reuse, constant duplication.

MCP introduces one protocol, enabling a marketplace of reusable servers that work with any compliant AI client.


MCP has three roles:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” MCP Protocol β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ MCP Host β”‚ ◄──────────────────► β”‚ MCP Client β”‚ ──► β”‚ MCP Server β”‚
β”‚ β”‚ β”‚ (embedded) β”‚ β”‚ β”‚
β”‚ Claude β”‚ β”‚ β”‚ β”‚ GitHub β”‚
β”‚ Kiro β”‚ β”‚ β”‚ β”‚ Jira β”‚
β”‚ Cursor β”‚ β”‚ β”‚ β”‚ SQL Server β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • MCP Host β€” the AI application the user interacts with (Claude Desktop, Kiro, Cursor)
  • MCP Client β€” the protocol client built into the host, manages connections to servers
  • MCP Server β€” a lightweight process that exposes capabilities (tools, resources, prompts) from a specific data source or API

Functions the AI can call to perform actions:

{
"name": "create_issue",
"description": "Create a new GitHub issue",
"parameters": {
"title": { "type": "string" },
"body": { "type": "string" },
"labels": { "type": "array" }
}
}

Data the AI can read for context:

github://repos/myorg/myrepo/contents/README.md
jira://projects/PROJ/issues/PROJ-42
file:///home/user/project/schema.sql

Pre-built prompt templates the AI can invoke:

"code-review" β€” structured code review prompt
"bug-report" β€” extract a structured bug report from a description

MCP servers communicate via two transport mechanisms:

stdio β€” the host launches the server as a subprocess, communicating via stdin/stdout. Most common for local tools:

{
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
}

HTTP + SSE β€” for remote servers. The AI connects to an HTTP endpoint. Used for hosted services:

{
"url": "https://mcp.yourservice.com/sse",
"headers": { "Authorization": "Bearer ${API_TOKEN}" }
}

ServerWhat it providesPackage
GitHubIssues, PRs, repos, files@modelcontextprotocol/server-github
GitLabMRs, pipelines, issues@modelcontextprotocol/server-gitlab
AtlassianJira tickets, Confluence pages@atlassian/mcp-atlassian
SQL ServerDatabase schema, queriesmcp-server-mssql
PostgreSQLDatabase schema, queries@modelcontextprotocol/server-postgres
FilesystemRead/write local files@modelcontextprotocol/server-filesystem
FetchWeb page content@modelcontextprotocol/server-fetch
SlackMessages, channels@modelcontextprotocol/server-slack
AWS KB RetrievalAWS Bedrock knowledge bases@modelcontextprotocol/server-aws-kb-retrieval

ToolMCP SupportConfig location
Claude Desktopβœ… Full~/Library/Application Support/Claude/claude_desktop_config.json
AWS Kiroβœ… Full.kiro/mcp.json in project
Cursorβœ… Full.cursor/mcp.json or global settings
Windsurfβœ… FullSettings β†’ MCP
VS Code (Copilot)βœ… (via extensions)settings.json
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "your_token" }
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/projects"]
}
}
}

The MCP SDK makes it straightforward to build a custom server in Python or TypeScript:

# Python β€” using the MCP SDK
from mcp.server import Server
from mcp.server.models import InitializationOptions
import mcp.types as types
server = Server("my-custom-server")
@server.list_tools()
async def handle_list_tools() -> list[types.Tool]:
return [
types.Tool(
name="get_product",
description="Fetch a product by ID from our internal catalog",
inputSchema={
"type": "object",
"properties": {
"product_id": {"type": "string"}
},
"required": ["product_id"]
}
)
]
@server.call_tool()
async def handle_call_tool(name: str, arguments: dict) -> list[types.TextContent]:
if name == "get_product":
product = await fetch_product(arguments["product_id"])
return [types.TextContent(type="text", text=str(product))]
// TypeScript
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
const server = new Server({ name: "my-server", version: "1.0.0" });
server.setRequestHandler(ListToolsRequestSchema, async () => ({
tools: [{
name: "get_order",
description: "Fetch an order from our system",
inputSchema: {
type: "object",
properties: { orderId: { type: "string" } },
required: ["orderId"]
}
}]
}));
const transport = new StdioServerTransport();
await server.connect(transport);

  • MCP servers run locally by default β€” credentials go from your machine to the target service, not through the AI provider’s servers
  • Use environment variable references (${TOKEN}) instead of hardcoding secrets in config files
  • Add MCP config files to .gitignore if they contain org-specific URLs
  • Scope tokens to the minimum required permissions β€” prefer read-only where possible
  • Review third-party MCP servers before installing β€” they run code on your machine

ApproachWhen to use
MCPStandardised, reusable tool connections. Cross-tool compatibility. Best for production AI workflows.
Function callingAd-hoc tools in a single application. Simpler but proprietary to each provider.
RAGSearching large document collections. Semantic search over embeddings. Complements MCP.

MCP and RAG are complementary: an MCP server can expose a RAG pipeline as a tool, giving the AI a single interface for both structured queries and semantic search.