connect mcp server to claude code
Your complete guide to connect an MCP server to Claude Code

How to Connect MCP Servers to Claude Code: A Practical Step-by-Step Guide (2026)

CONTENTS

If you have been hearing about MCP servers and wondering what they actually do for you as a developer, here is the short answer: they give Claude Code the ability to interact with real tools, real files, and real services, right inside your workflow.

By the end of this guide, you will know how to find MCP servers, add them to Claude Code, use them inside a session, and manage multiple servers at once. No guesswork, just a clear path from zero to productive.

MCP has grown fast. Since Anthropic introduced the Model Context Protocol in November 2024, over 500 public servers have been published, and every major AI company, including OpenAI, Google DeepMind, Microsoft, and Salesforce, has adopted it as a standard. It is worth understanding.

Developer working with terminal and code on a laptop

What Is MCP and Why Does It Matter for Claude Code?

MCP stands for Model Context Protocol. It is an open standard that defines how AI assistants like Claude can connect to external tools, data sources, and services in a structured, safe way. Under the hood it uses JSON-RPC 2.0 as its transport protocol, which keeps communication lightweight and predictable.

Think of it this way: without MCP, Claude only knows what it was trained on. It cannot see your files, it cannot query your database, it cannot check the latest news. With MCP, you give Claude a set of tools it can actually reach out and use. Ask it to read your README, query your users table, search GitHub for open bugs, or post a message to Slack, and it can do all of that inside the same session. The Python and TypeScript SDKs for MCP now see around 97 million monthly downloads combined, which tells you developers have found real value here.

What You Need Before You Start

The setup is minimal. Make sure you have these in place before moving on:

  • Claude Code installed and authenticated on your machine
  • Node.js 18 or higher (many MCP servers are Node-based)
  • npm or npx available in your terminal
  • A terminal you are comfortable working in

That is genuinely all you need. If you can run npx --version and see a version number, you are ready.

Step 1: Browse and Choose an MCP Server

Before you install anything, spend a few minutes browsing what is available. The three best places to look are the official Anthropic MCP server list on GitHub, the community directory at mcp.so, and a general GitHub search for “mcp server” filtered by recent activity.

Here are five servers that are immediately useful for most developers:

  • @modelcontextprotocol/server-filesystem — lets Claude read and write files on your local machine within directories you specify
  • @modelcontextprotocol/server-github — search repositories, read issues, manage pull requests, and interact with the GitHub API
  • @modelcontextprotocol/server-brave-search — gives Claude real-time web search via the Brave Search API
  • @modelcontextprotocol/server-postgres — connect to a Postgres database and run queries directly from your Claude session
  • @modelcontextprotocol/server-puppeteer — browser automation and web scraping, useful for testing or data collection tasks

💡 Note: Some servers require API keys or credentials (Brave Search needs a Brave API key, GitHub benefits from a personal access token). Check each server’s README before adding it so you have those ready.

Step 2: Add an MCP Server to Claude Code

Claude Code supports MCP natively. You add servers with the claude mcp add command. Here is the general syntax:

claude mcp add <name> -- <command> [args...]

Let’s walk through a real example using the filesystem server. This is probably the most useful one to start with.

claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /Users/yourname/projects

Here is what each part of that command does:

  • claude mcp add — the Claude Code command to register a new MCP server
  • filesystem — the name you are giving this server (you choose this, it just needs to be unique)
  • -- — separates the Claude CLI arguments from the server launch command
  • npx -y @modelcontextprotocol/server-filesystem — downloads and runs the filesystem server package via npx
  • /Users/yourname/projects — the directory path you want Claude to have access to (replace this with your actual path)

Once you have added it, verify it was registered correctly:

claude mcp list

You should see filesystem in the list with its command and status. If it shows up, you are good to go.

💡 Note: The filesystem server only has access to paths you explicitly pass as arguments. You are in full control of what Claude can and cannot read.

Step 3: Use the MCP Server Inside a Session

This is where it gets interesting. Once an MCP server is registered, Claude Code loads its tools automatically when you start a session. You do not need to enable anything manually. Just open a Claude Code session and start asking.

With the filesystem server active, you can now ask things like:

  • “Read the contents of my README.md and give me a one-paragraph summary of the project.”
  • “Look at the files in my /src directory and tell me which ones are over 200 lines long.”
  • “Find every file that imports axios and list them for me.”

If you have the GitHub server added, you can ask:

  • “Search GitHub for open issues labelled ‘bug’ in my repo and group them by component.”

With the Postgres server:

  • “Query the users table and show me the 10 most recent signups with their email and created_at date.”

One important behavior to know: Claude will ask for your confirmation before taking any action that modifies something, like writing a file or posting to an external service. Read-only operations typically proceed without prompting, but writes always pause for your approval. That is by design, and it is a good thing.

Step 4: Add a Remote MCP Server (HTTP/SSE)

Claude Code supports three transport types for MCP servers: stdio (a local process, which is what we used above), in-process, and HTTP/SSE for remote servers. Remote servers are useful when your team shares a centralized MCP service, or when you want to use a cloud-hosted tool without running it locally.

To add a remote server over HTTP/SSE, use the --transport sse flag:

claude mcp add --transport sse my-server https://mcp.example.com/sse

Breaking that down:

  • --transport sse — tells Claude Code to connect via Server-Sent Events over HTTP instead of launching a local process
  • my-server — the local name you assign this connection
  • https://mcp.example.com/sse — the URL of the remote MCP server

Use local stdio servers for personal tools and development. Use remote SSE servers when the tool needs to be shared across a team, or when it depends on infrastructure that should not run on every developer machine.

Managing Multiple MCP Servers

You can run multiple MCP servers simultaneously in a single Claude Code session without any meaningful performance issue. Five to ten servers running at once is common and works well in practice.

Here are the key commands for managing your servers:

# See all registered MCP servers
claude mcp list

# Remove a server you no longer need
claude mcp remove filesystem

Configuration is stored in two places depending on scope:

  • Global config: ~/.claude/settings.json — servers here are available in every project on your machine
  • Project-level config: .claude/settings.json in your project root — servers here are only active when you are working in that project

Project-level config is especially useful when different projects need different tools. A web scraping project might need Puppeteer, while a backend API project needs Postgres. Keep those separated and each project gets exactly the tools it needs.

💡 Note: You can edit settings.json directly if you prefer, but using the claude mcp add and claude mcp remove commands is safer since they handle JSON formatting for you.

5 MCP Servers Worth Adding Right Now

If you want a quick-reference starting point, here are five servers that cover the most common developer needs:

ServerWhat it doesInstall command
@modelcontextprotocol/server-filesystemRead and write local files in specified directoriesclaude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /your/path
@modelcontextprotocol/server-githubSearch repos, read issues, manage PRs via GitHub APIclaude mcp add github -- npx -y @modelcontextprotocol/server-github
@modelcontextprotocol/server-brave-searchReal-time web search using Brave Search APIclaude mcp add brave-search -- npx -y @modelcontextprotocol/server-brave-search
@modelcontextprotocol/server-postgresRun queries against a Postgres databaseclaude mcp add postgres -- npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb
@modelcontextprotocol/server-slackRead channels, post messages, search Slackclaude mcp add slack -- npx -y @modelcontextprotocol/server-slack

Each of these has a README in the Anthropic GitHub organization with environment variable requirements and configuration options. Spend two minutes reading the README for any server before you add it.

Frequently Asked Questions

Is MCP free to use?

Yes. The Model Context Protocol itself is an open standard, and the official MCP servers published by Anthropic are open source and free to use. Some third-party MCP servers may connect to paid APIs (like Brave Search, which has a free tier but also paid plans), but the MCP layer itself costs nothing. You pay only for Claude API usage as you normally would.

Do MCP servers slow down Claude Code?

In most cases, no. MCP servers are only invoked when Claude decides to use one of their tools, and that happens in response to your prompts. Idle servers have essentially no overhead. You might notice a small delay the first time a server is called in a session (especially with npx-based servers that need to download the package), but subsequent calls within the same session are fast. Running five to ten servers simultaneously is normal and does not cause noticeable slowdowns.

Can I build my own MCP server?

Absolutely, and it is more approachable than you might expect. Anthropic provides official SDKs for both Python and TypeScript. You define a set of tools (functions with typed inputs and outputs), register them with the MCP server framework, and Claude can discover and use them automatically. The TypeScript SDK in particular has a clean, minimal API. A basic custom server can be built in an afternoon. The official MCP documentation at modelcontextprotocol.io is the best place to start.

Is my data safe when using MCP servers?

Local stdio servers (the npx-based ones) run entirely on your machine. Your files and database queries never leave your environment except through Claude’s normal API calls, which are subject to Anthropic’s standard data handling policies. Remote SSE servers are a different story: you are sending data to an external endpoint, so review the privacy policy of any remote server before connecting sensitive data. For anything confidential, stick to local servers or self-hosted infrastructure you control.

Wrapping Up

MCP turns Claude Code from a capable assistant into an active participant in your actual development environment. The setup takes minutes, and the payoff compounds quickly once you have the right servers in place.

Here are three good next steps to take right now:

  • Add the filesystem server pointed at your current project directory and ask Claude to summarize the codebase structure
  • Browse mcp.so to find a server that connects to a tool you use daily, whether that is Notion, Linear, Postgres, or something else
  • If you want to go deeper, read through the MCP spec at modelcontextprotocol.io and consider building a simple custom server for a workflow that is unique to your team
Recent Posts
SHARE
Get the latest from Benzoic AI in your inbox.
Enter your email to receive a weekly round-up of our best posts.
icon
Scroll to Top