MCP (Model Context Protocol) is an open standard created by Anthropic that connects AI coding assistants to external tools, APIs, and data sources. Think of it as a USB-C port for AI — one standardized protocol that lets any AI app connect to any tool, instead of building custom integrations for every combination.
MCP is supported by Claude Code, Cursor, VS Code (via GitHub Copilot), Windsurf, and many other editors. This guide walks you through connecting your first MCP server in any of these tools.
MCP is an open-source protocol that standardizes how AI applications communicate with external systems. Before MCP, every AI tool needed its own custom integration for every service — creating an N-by-M problem. MCP reduces this to N+M: any MCP-compatible AI app can connect to any MCP server.
An MCP server exposes three types of capabilities to your AI assistant:
The protocol uses JSON-RPC 2.0 over standardized transports, with stateful connections and capability negotiation between client and server.
The architecture has three parts:
When you add an MCP server, your editor creates a client that connects to that server. The server tells the client what tools it offers, and those tools become available to your AI assistant. When the AI decides it needs a tool, it calls it through the client, and the server executes the action.
MCP supports three transport methods:
| Transport | How it works | Best for |
|---|---|---|
| stdio | Editor spawns the server as a local process; communicates via stdin/stdout | Local tools, filesystem access, CLI wrappers — fastest option |
| Streamable HTTP | Server runs independently; communicates over HTTP with optional SSE streaming | Remote/cloud services, multi-user setups, production deployments |
| SSE (legacy) | Older HTTP+SSE transport from the original spec | Legacy servers only — use Streamable HTTP for new servers |
Most MCP servers you install locally use stdio. Cloud-hosted servers (like GitHub's official MCP endpoint) use Streamable HTTP.
Head to machina.directory/mcp to browse available MCP servers. Popular choices for getting started:
| Server | What it does |
|---|---|
| GitHub | Create PRs, manage issues, search repos, review code |
| Filesystem | Read, write, and search files on your local machine |
| PostgreSQL (Neon) | Query databases, inspect schemas, run migrations |
| Sentry | View error reports, analyze crash data |
| Fetch | Make HTTP requests to any URL |
| Memory | Persistent key-value storage across sessions |
When evaluating a server, check what tools it exposes, whether it requires API keys or authentication, and which transport it uses.
Configuration differs by editor. Each section below shows exact commands and config formats.
Claude Code has built-in MCP support via the CLI:
Add an HTTP server:
claude mcp add --transport http my-server https://example.com/mcp
Add a stdio server (local process):
claude mcp add --transport stdio my-server -- npx -y @example/mcp-server
Add a server with environment variables:
claude mcp add --transport stdio --env API_KEY=sk-123 my-server -- npx -y @example/mcp-server
Scopes control where the server is available:
--scope local (default) — private to you and the current project--scope project — creates a .mcp.json file in your repo root, shared with the team--scope user — available in all your projectsManage servers: claude mcp list, claude mcp get <name>, claude mcp remove <name>. Inside a session, type /mcp to see connected servers and trigger OAuth flows.
Cursor reads MCP config from JSON files:
Project-level (shared with team): .cursor/mcp.json
Global (personal): ~/.cursor/mcp.json
{
"mcpServers": {
"my-server": {
"command": "npx",
"args": ["-y", "@example/mcp-server"],
"env": {
"API_KEY": "sk-123"
}
}
}
}
For HTTP servers:
{
"mcpServers": {
"my-server": {
"url": "https://example.com/mcp"
}
}
}
Cursor supports variable interpolation: ${env:API_KEY} for environment variables, ${workspaceFolder} for the project root.
VS Code (with GitHub Copilot) uses a similar JSON format, but with a different top-level key:
Workspace-level: .vscode/mcp.json
{
"servers": {
"my-server": {
"command": "npx",
"args": ["-y", "@example/mcp-server"],
"env": {
"API_KEY": "sk-123"
}
}
}
}
Important: VS Code uses "servers" as the top-level key — not "mcpServers" like every other editor. This is a common source of confusion.
You can also add servers via the Command Palette (MCP: Add Server) or the Extensions View (search @mcp).
Windsurf reads config from ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"my-server": {
"command": "npx",
"args": ["-y", "@example/mcp-server"],
"env": {
"API_KEY": "sk-123"
}
}
}
}
Note: Windsurf has a 100 tool limit across all connected servers. If you hit this, prioritize the servers you use most.
After adding a server, confirm it's connected:
Claude Code: Type /mcp in a session. You'll see a list of connected servers and their available tools. If a server failed to connect, the error message appears here.
Cursor: Open Settings and check the MCP section. Connected servers show a green status indicator. You can also ask the agent "what MCP tools do you have?" to list available tools.
VS Code: Look for MCP tools in the Copilot Chat tools panel. Connected servers appear with their tool list.
Windsurf: The MCP status appears in the Cascade panel. Check for tool count against the 100-tool limit.
If a server fails to connect, common fixes:
npx, node, etc.)MCP_TIMEOUT=10000 claudeOnce connected, MCP tools work transparently. Your AI assistant discovers available tools and uses them when relevant.
Example workflow with GitHub MCP:
create_pull_request tool automaticallyThe agent treats MCP tools like any other capability — it decides when to use them based on your request. You don't need to explicitly mention MCP or tool names.
MCP servers can execute arbitrary code and access external systems. Keep these practices in mind:
Yes. Each editor supports multiple simultaneous server connections. Your AI assistant sees all tools from all connected servers and can use them in combination. For example, you could use a GitHub MCP server and a database MCP server in the same conversation.
The servers themselves are interchangeable — the same MCP server works with Claude Code, Cursor, VS Code, and Windsurf. However, the configuration format differs by editor (see Step 2 above), so you need to set up each editor separately.
You can build an MCP server in any language. The Model Context Protocol SDK provides official SDKs for TypeScript and Python. A minimal server defines its tools, implements their handlers, and exposes them over stdio or HTTP.
If a stdio server crashes, the editor typically shows an error in its MCP status panel. HTTP servers that become unreachable will cause tool calls to fail with timeout errors. In both cases, other MCP servers and the AI assistant itself continue working normally — a single server failure doesn't affect the rest of your setup.