Get the FREE Ultimate OpenClaw Setup Guide →

Setting Up MCP Servers

Tom Lee·2026-03-17·10 min read

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.

What Is MCP?

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.

How MCP Works

The architecture has three parts:

  1. Host — your AI application (Claude Code, Cursor, VS Code)
  2. Client — a connector the host creates for each server connection
  3. Server — the external service providing tools, resources, and prompts

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.

Transport Types

MCP supports three transport methods:

TransportHow it worksBest for
stdioEditor spawns the server as a local process; communicates via stdin/stdoutLocal tools, filesystem access, CLI wrappers — fastest option
Streamable HTTPServer runs independently; communicates over HTTP with optional SSE streamingRemote/cloud services, multi-user setups, production deployments
SSE (legacy)Older HTTP+SSE transport from the original specLegacy 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.

Step 1: Choose an MCP Server

Head to machina.directory/mcp to browse available MCP servers. Popular choices for getting started:

ServerWhat it does
GitHubCreate PRs, manage issues, search repos, review code
FilesystemRead, write, and search files on your local machine
PostgreSQL (Neon)Query databases, inspect schemas, run migrations
SentryView error reports, analyze crash data
FetchMake HTTP requests to any URL
MemoryPersistent 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.

Step 2: Install and Configure

Configuration differs by editor. Each section below shows exact commands and config formats.

Claude Code

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:

Manage 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

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

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

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.

Step 3: Verify the Connection

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:

Step 4: Use MCP Tools in Practice

Once connected, MCP tools work transparently. Your AI assistant discovers available tools and uses them when relevant.

Example workflow with GitHub MCP:

  1. Connect the GitHub MCP server with your access token
  2. Ask: "Create a PR from the current branch with a summary of changes"
  3. The agent uses the GitHub MCP's create_pull_request tool automatically
  4. You approve the tool call, and the PR is created

The 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.

Security Considerations

MCP servers can execute arbitrary code and access external systems. Keep these practices in mind:

Common Questions

Can I use multiple MCP servers at once?

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.

Do MCP servers work across editors?

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.

How do I create my own MCP server?

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.

What happens if an MCP server goes down?

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.

Next Steps

Explore more

Sponsor this space

Reach thousands of developers