MCP Server
An MCP server exposes tools, resources, and prompts to AI agents over the Model Context Protocol, so any MCP client can call them mid-session.
An MCP server is a program that exposes capabilities to AI agents through the Model Context Protocol. An agent connected to it can discover its tools and call them mid-session: fetch an issue, query analytics, read a design, search the web.
What a server can expose
- Tools: functions the agent can call, such as
search_issuesorget_design_context. - Resources: data the server makes available to read.
- Prompts: reusable prompt templates.
Local vs remote
| Local server | Remote server | |
|---|---|---|
| Runs | On your machine | On the vendor's infrastructure |
| Transport | stdio, started with a command like npx | HTTP |
| Auth | Whatever the local process can reach | Usually OAuth with your account |
| Example | Playwright, the reference Memory server | GitHub, Linear, Figma, Stripe, Vercel |
In Claude Code, add a remote server with claude mcp add --transport http <name> <url> and authenticate with /mcp. Scopes and the .mcp.json file are covered in Claude Code MCP setup.
How many to connect
In clients that load every tool definition at session start, each server costs context, and agents choose tools less reliably as the list grows. Claude Code reduces this with tool search: only tool names and server instructions load at start, and full definitions load when Claude needs them. Either way, connect the few servers that cover the work. For the security side, see MCP security. For a ranked list, see the best MCP servers for product engineers and dev teams, and for memory specifically, the best MCP memory server for Claude Code.
- What is an MCP server?
- A program that exposes tools, data, or prompts to AI applications through the Model Context Protocol. Any MCP-speaking client, such as Claude Code, Cursor, or Codex, can discover and call its tools during a session.
- What is the difference between a local and a remote MCP server?
- A local server runs on your machine and talks to the client over stdio, started by a command like npx. A remote server runs on the vendor's infrastructure and is reached over HTTP, usually with OAuth sign-in.
- How do I add an MCP server to Claude Code?
- Run claude mcp add. For a remote server: claude mcp add --transport http <name> <url>, then /mcp in a session to authenticate. For a local server, put its launch command after a double dash.
Related