Skip to content
sobolewski.proAI today, every eveningSubscribe

Once a day. Unsubscribe with one click. Privacy policy

What is MCP? Connect your first server step by step

What is MCP (Model Context Protocol)? I explain hosts, servers and tools, then we connect an MCP server to Claude Code and the Claude app, step by step.

6 min read

This article in other languages:العربيةDeutschEspañolFrançaisItaliano日本語Polski简体中文

In this article
  1. What is MCP in practice?
  2. Where did MCP come from?
  3. How does MCP work under the hood?
  4. Step 1: how do I connect a remote MCP server to Claude Code?
  5. Step 2: how do I run a local MCP server?
  6. Step 3: how do I manage MCP servers?
  7. Step 4: how do I add an MCP server in the Claude app?
  8. What should you watch out for?
  9. FAQ

What is MCP? MCP (Model Context Protocol) is an open standard that lets an AI app such as Claude, ChatGPT or Cursor connect to outside systems: files, databases, your calendar, Notion or GitHub. Its creators compare it in the official documentation to a USB-C port: one plug that fits many devices.

In this tutorial I explain how MCP works under the hood, and then we connect a first MCP server in Claude Code (remote and local) and in the Claude app. The commands come from the Claude Code documentation and the MCP reference servers repository.

What is MCP in practice?

On its own, a language model can’t see your files or your calendar. For an AI agent to actually do something in the world, it needs tools (I covered what an agent is in What is an AI agent). Without a shared standard, every app would have to wire up every tool in its own way.

MCP changes that: someone writes an MCP server for a service once, and every app that speaks the protocol can use it. The documentation gives examples of what that makes possible:

  1. an agent with access to your Google Calendar and Notion,
  2. Claude Code building an entire web app from a Figma design,
  3. a company chatbot hooked up to several databases at once,
  4. a model that designs a 3D object in Blender and sends it to a printer.

Where did MCP come from?

Anthropic released MCP as open source on November 25, 2024. A year later, on December 9, 2025, the company handed the protocol over to the Agentic AI Foundation, a fund under the Linux Foundation that OpenAI and Block also co-founded. So MCP no longer belongs to a single company.

Today the protocol is supported by Claude, ChatGPT, Visual Studio Code and Cursor, among others, so a server you write once works in a lot of places.

How does MCP work under the hood?

According to the architecture overview, MCP has three roles:

  1. Host: the AI app you use (for example Claude Code or Claude Desktop),
  2. Client: a component inside the host. The host creates a separate client for each server,
  3. Server: the program that provides data and tools.

A server can run locally (on your machine, talking over standard input and output, known as “stdio”) or remotely (on the internet, over “Streamable HTTP”). Messages use the JSON-RPC 2.0 format.

A server exposes three kinds of things:

  1. tools: functions the model can call, such as a database query or writing a file,
  2. resources: data for context, such as a file’s contents or a database schema,
  3. prompts: ready-made templates for interacting with the model.

The flow is simple: the client asks the server for its list of tools (tools/list), the model picks one, and the client calls it (tools/call) and hands the result back to the model. Here’s the interesting part: in the current version of the spec (2026-07-28) the protocol is stateless, meaning every request carries everything the server needs to handle it.

Step 1: how do I connect a remote MCP server to Claude Code?

I’m assuming you already have Claude Code installed (if not, start with my Claude Code tutorial). The documentation recommends a remote HTTP server as the preferred option. The basic syntax looks like this:

claude mcp add --transport http <name> <url>

The example from the documentation, connecting Notion:

claude mcp add --transport http notion https://mcp.notion.com/mcp

Most remote servers require you to sign in. In that case, type /mcp in a Claude Code session and complete the login in your browser. The same command also shows the status of all connected servers.

If the server uses a token instead of a login, add a header:

claude mcp add --transport http secure-api https://api.example.com/mcp \
  --header "Authorization: Bearer your-token"

Step 2: how do I run a local MCP server?

A local server runs on your computer as an ordinary process. A good first example is the reference filesystem server, which gives the model access only to the directories you choose. You’ll need Node.js (for npx).

The server command goes after --, and everything after that marker is passed to the server unchanged:

claude mcp add --transport stdio filesystem -- npx -y @modelcontextprotocol/server-filesystem ~/notes

The last argument is the directory the server can access (you can list several). The server provides tools such as read_text_file, write_file, edit_file, list_directory and search_files. Now you can ask Claude Code something like “find everything about MCP in my notes and turn it into a list”.

If the server needs an API key, pass it with --env. An example from the documentation:

claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
  -- npx -y airtable-mcp-server

Step 3: how do I manage MCP servers?

Three simple commands handle management:

claude mcp list          # list servers
claude mcp get notion    # details of one server
claude mcp remove notion # remove a server

The scope also matters, meaning where the server is saved:

Scope Where it works Shared with the team Where it’s stored
local (default) current project only no ~/.claude.json
project current project only yes, via the repository .mcp.json in the project directory
user all your projects no ~/.claude.json

You pick the scope with the --scope flag, for example --scope user. With the project scope, keep API keys in environment variables (${VAR} in .mcp.json) so they don’t end up in the repository.

Step 4: how do I add an MCP server in the Claude app?

In the Claude app (web and desktop), MCP servers are called connectors. You’ll find ready-made ones in the connector directory, and you can add your own remote server as a “custom connector”. According to the Claude Help Center:

  1. go to Customize > Connectors,
  2. click “+ Add”, then “Add custom connector”,
  3. enter a name and the URL of the remote MCP server,
  4. check the authentication settings and click “Add”.

Connectors work on every plan, but on the free plan you can add only one custom connector. Note: Claude connects to the server from Anthropic’s cloud, so the server has to be reachable from the internet. Other Claude features use connectors too, for example the Claude Duet agent.

What should you watch out for?

First, who you trust. An MCP server gives the model real power to act, and the Claude Code documentation warns plainly that servers fetching outside content expose you to prompt injection. The Help Center adds that malicious servers can contain hidden instructions that try to trick Claude into unintended actions. Only connect servers from companies and authors you trust.

Second, permissions. Click “Allow always” only for tools you trust enough to run unsupervised. The good news: a cloned repository can’t approve its own servers from .mcp.json, because Claude Code asks for your consent first.

Third, the scope of access. Give the filesystem server one specific directory, not your whole drive. I wrote more about securing keys and agents in AI agent security.

FAQ

What is MCP in simple terms?

It’s a shared standard that AI apps use to connect to tools and data. An MCP server written once works in many apps, just like a USB-C device works with many computers.

Does MCP only work with Claude?

No. Anthropic created the protocol, but today the Agentic AI Foundation develops it under the Linux Foundation, and it’s supported by ChatGPT, Visual Studio Code and Cursor, among others.

What’s the difference between a local and a remote MCP server?

A local server runs on your computer and communicates over stdio, usually with a single app. A remote server runs on the internet (Streamable HTTP) and usually serves many clients at once, and the spec recommends OAuth for authentication.

Is MCP free?

The protocol itself is open and free. You pay for the AI app you use and possibly for the service the server connects to.

  • AI
  • AI agents
  • Claude Code
  • tutorial

AI today, every evening

The day's biggest AI news and new posts from the blog, every evening. Short, with sources.

Once a day. Unsubscribe with one click. Privacy policy

7 min read

What is an AI agent and how to test one, step by step

What is an AI agent and how is it different from a chatbot? I explain the agent loop, tools and permissions, then a first task in Claude Code and Codex. Step by step.

  • AI
  • AI agents
  • Claude Code
  • tutorial