What is MCP? The Model Context Protocol explained for developers
How the Model Context Protocol connects AI agents to your tools, how to add a server, and how to keep it safe.

Key takeaways
- MCP is an open standard that lets any supporting AI app use any MCP server, instead of one plugin per app and service.
- A host such as Claude Code opens one client per server; servers offer tools, resources and prompts.
- Local servers run as processes over stdio; remote servers run over Streamable HTTP, usually with OAuth sign-in.
- Only add servers you trust, give them minimal access, and keep the list short because tool descriptions cost context.
MCP, the Model Context Protocol, is an open standard that lets AI applications connect to outside tools and data in one common way. Anthropic introduced it in November 2024, and it is now supported by Claude, ChatGPT, VS Code, Cursor and many other apps. The official site compares it to a USB-C port for AI: build a connector once, and any app that speaks MCP can plug it in.
For a coding agent, that means it can read your issue tracker, query a database, check error reports or open a browser, instead of only seeing the files in your folder. This article explains how MCP works, what a server can offer, how to add one, and what to watch out for.
The problem MCP solves
Before MCP, every AI app needed its own plugin for every service. Five apps and twenty services meant up to a hundred separate integrations, each built and maintained by someone. Most never got built, so assistants stayed boxed in.
MCP turns that into a shared plug. A company like Sentry, Notion or GitHub publishes one MCP server, and every app that supports the protocol can use it. App makers implement the client side once and get access to the whole catalogue of servers.
How MCP works: hosts, clients and servers
The MCP architecture has three roles:
- Host: the AI application you use, such as Claude Code, Claude Desktop or VS Code.
- Client: a connection the host creates for each server. Three servers means three clients inside the host.
- Server: a program that offers context or actions. It can run on your computer or on the provider's infrastructure.
Messages between client and server use JSON-RPC 2.0. They travel over one of two transports. Stdio is for local servers: the host starts the server as a process on your machine and talks to it through standard input and output. Streamable HTTP is for remote servers: the host talks to a web address, usually after you sign in with OAuth.
What a server can offer: tools, resources and prompts
MCP defines three building blocks a server can expose:
- Tools are actions. A database server might offer "run query"; an issue tracker might offer "create issue" and "search issues". The model decides when to call them.
- Resources are data the app can read for context, such as a database schema or the contents of a document.
- Prompts are ready-made templates that structure a common task.
Each tool comes with a name, a description and a schema for its inputs. The host collects the tool lists from all connected servers and shows them to the model, which is how the model knows that it can, for example, look up the last ten errors in Sentry before suggesting a fix.
MCP servers worth adding for coding
A few kinds pay off quickly for developers:
- Up-to-date library docs, so the agent reads the current API instead of guessing from old training data.
- A browser (for example Playwright), so the agent can open your page, click through it and check the result.
- Your issue tracker (GitHub, Linear, Jira), so a task can start from the ticket text.
- Error monitoring (Sentry and similar), so the agent sees the real stack trace.
- Your database, ideally with a read-only user, for questions about data and schema.
Prefer the official server published by the company behind the service. The protocol's maintainers also keep reference servers on GitHub.
How to add an MCP server in Claude Code
In Claude Code, servers are added from the terminal with claude mcp add, as described in the Claude Code MCP docs:
# a remote server over HTTP
claude mcp add --transport http notion https://mcp.notion.com/mcp
# a local server started as a process (everything after -- is the command)
claude mcp add --transport stdio airtable --env AIRTABLE_API_KEY=YOUR_KEY -- npx -y airtable-mcp-server
# see what is configured, then sign in from inside a session
claude mcp list
/mcp
The --scope flag decides who gets the server: local (the default, only you in this project), project (shared with the team through a .mcp.json file in the repository) or user (you, in every project). A shared .mcp.json looks like this:
{
"mcpServers": {
"notion": { "type": "http", "url": "https://mcp.notion.com/mcp" }
}
}
Other hosts use their own settings screens or config files: see the MCP pages for VS Code and Cursor. The server itself is the same everywhere.

Security: treat every server as code you run
An MCP server can act on your behalf, so be choosy:
- Only add servers you trust. Anthropic's docs warn that servers which fetch outside content can expose you to prompt injection: a web page or ticket can contain text written to steer the model.
- Give the smallest access that works. A read-only database user and a token limited to one repository do far less damage if something goes wrong.
- Review shared configs. Claude Code asks for approval before it uses project servers from a
.mcp.jsonsomeone else committed. Read that file before you approve it. - Keep the list short. Every connected server adds its tool descriptions to what the model reads. A dozen servers you rarely use cost context on every turn; see how to reduce AI coding token usage.
MCP in Ninja Builder
Ninja Builder puts MCP behind a settings page instead of the terminal. Settings › MCPs has an Installed tab and a Library of official servers, including GitHub, Linear, Notion, Sentry, Slack, Supabase, Figma, Stripe and Vercel. Click Add, approve the sign-in in your browser, and the server works in new chats on all your Claude accounts. Anything else goes through Add your own with a name, type and URL or command. You can also just ask in chat, for example "connect to Linear". The connect your tools docs cover each step.
Try it free for 14 days, then It costs $4.99 a month: download Ninja Builder.
Frequently asked questions
Who created the Model Context Protocol?
Anthropic introduced MCP in November 2024 as an open standard. It is now supported by many AI apps, including ChatGPT, VS Code and Cursor.
What is the difference between an MCP server and an API?
An API is built for programs that already know how to call it. An MCP server wraps actions and data in a standard format with descriptions, so an AI model can discover what is available and call it without a custom integration.
Are MCP servers safe?
They are as safe as the code and the access you give them. Use official servers from the service's own company, grant the smallest permissions that work, and be careful with servers that fetch outside content because of prompt injection.
Do MCP servers use up tokens?
Yes. The descriptions of every connected server's tools are part of what the model reads, so many idle servers add cost and take context on each turn.
Keep reading

How to write CLAUDE.md and AGENTS.md files that agents follow
Write project instruction files that coding agents actually follow, with a copyable template and one setup for every tool.

How to reduce token usage when coding with AI
Where AI coding tokens really go, and seven habits that cut them without slowing you down.

Security Checklist for AI-Built Apps: What to Check Before Launch
Six checks that catch the usual leaks in AI-written apps, written so you can run them without reading code.