Artifacts

What Is an MCP Server? A Guide for Claude Code and Codex Users

MCP servers explained in plain language: what the Model Context Protocol is, remote and local servers, how Claude Code and Codex connect to them, scopes and trust, sign-in, limits, and how to keep agents safe.

The Artifacts teamUpdated 6 min read

An AI agent on its own can read and write the files in front of it. Everything else it touches (an issue tracker, a database, a design file, a team's documents) reaches it through an MCP server. If you use Claude Code or Codex, MCP servers are how the agent goes from working in your project to working with the rest of your tools.

This guide explains what MCP is, what a server does, and how Claude Code and Codex connect to one, without the command-line detail.

Key takeaways

  • The Model Context Protocol (MCP) is "an open-source standard for connecting AI applications to external systems." An MCP server is the piece that exposes a system's actions and data to an agent.
  • Servers are either remote, reached at a web address, or local, started as a program on your computer.
  • Claude Code and Codex both connect to the same servers. Each keeps its own list, and each lets you choose whether a server is available everywhere or in one project.
  • Every server adds context to the agent's requests, so OpenAI advises turning off servers you do not need.
  • Treat a server as part of your security boundary: approve shared servers, limit which tools an agent can use, and keep keys out of shared files.

What MCP is

MCP's documentation describes the protocol as "an open-source standard for connecting AI applications to external systems" and compares it to a USB-C port for AI applications: one standard way to plug in many different things.

The standard has two sides:

  • An MCP client is the AI application, such as Claude Code, Codex, Claude, ChatGPT, Visual Studio Code or Cursor.
  • An MCP server is a program that offers actions and data from one system, such as "create an issue," "run a query" or "create a spreadsheet."

Once a client is connected to a server, the server's actions show up for the agent as tools, and the agent uses them alongside its built-in abilities.

Remote and local servers

Remote servers run as a service on the internet and are reached at a web address; Claude Code's documentation uses Notion and Sentry as examples. Many cloud servers ask you to sign in through your browser the first time (OAuth), or to provide an API key.

Local servers are programs that the agent starts on your own computer and talks to directly.

A third transport, Server-Sent Events, is marked as deprecated in Claude Code's documentation; recent versions of Claude Code switch to it automatically for services that still only offer it.

How Claude Code connects to MCP servers

You add a server to Claude Code once, with a name you choose and the server's address (or, for a local server, the program to start). Servers that use a browser sign-in are completed from Claude Code's MCP menu. After a new session starts, the server's tools are available.

Claude Code lets you decide where a server applies:

ScopeWhere it is availableShared with your team
Local (the default)Only the project where you added itNo
ProjectThat project, for everyone who works on itYes, through a settings file kept in the repository
UserEvery project you openNo

A few practical details from Anthropic's documentation:

  • Shared servers need approval. Before Claude Code uses servers added by a project's shared settings, it asks you to approve them.
  • Keys can stay out of the repository. The shared settings file can refer to keys stored in your environment instead of containing them.
  • Large results are limited. Claude Code warns when a tool returns more than 10,000 tokens and limits results to 25,000 tokens by default; the limit can be raised.

How Codex connects to MCP servers

Codex keeps its MCP servers in its settings. You can add a server from the command line or write it into the settings directly, and remote servers can sign you in with OAuth.

  • Personal and project servers. Servers in your personal settings are available everywhere. A project can also define its own servers, which Codex loads only when you have marked that project as trusted.
  • Tool lists. For a server with many tools, Codex can allow only some of them, or block specific ones such as tools that write or delete.
  • Time limits. By default a server has 10 seconds to start and each tool call 60 seconds to finish. Both can be raised.
  • Required servers. A server can be marked as required, so Codex stops at startup if it cannot reach it, instead of working without it.

What MCP servers are used for

Examples of what MCP servers give an agent access to:

  • Work tracking: reading and updating issues and tasks.
  • Data: querying databases and analytics tools.
  • Documentation and design: reading specs, notes and design files.
  • Monitoring: reading errors and incidents.
  • Shared workspaces: creating spreadsheets, documents, slides and pages where a team can review them. Artifacts works this way: Claude Code, Codex and other agents connect to it as an MCP server and publish files that the team edits and comments on.

MCP servers and skills

MCP servers and skills are often mentioned together and do different jobs. Anthropic's help center puts it this way: "MCP connects Claude to external services and data sources. Skills provide procedural knowledge." A server gives the agent the ability to act in a system; a skill teaches it how your team wants that work done. Both Claude Code and Codex support skills alongside MCP.

Keeping agents safe with MCP

Every server you add extends what an agent can do, so treat it like any other access you grant:

  1. Add servers you trust. A server can see the requests the agent sends to it and return content the agent will read.
  2. Approve shared servers deliberately. Claude Code asks before using servers from a project's shared settings; Codex loads project servers only in trusted projects.
  3. Limit tools. Allow only the tools a task needs, especially for servers that can write or delete.
  4. Keep keys out of repositories. Both agents can read keys from your environment instead of a committed file.
  5. Prune unused servers. OpenAI notes that "every MCP server adds more context to your messages and uses more of your limit," and recommends disabling servers you do not need.

Frequently asked questions

Is MCP only for Claude?

No. MCP is an open standard. Its documentation lists Claude, ChatGPT, Visual Studio Code and Cursor among the applications that support it, and Codex connects to MCP servers as well.

Does the same MCP server work in Claude Code and Codex?

Yes. The protocol is the same, so a server added to one agent can be added to the other. Each agent keeps its own list of servers and its own settings.

Do MCP servers cost anything to use?

The server's own pricing depends on the service. On the agent side, each server adds context to every request, which uses more of your plan's limits, according to OpenAI's Codex documentation.

What is the difference between an MCP server and an API?

An API is how software talks to a service. An MCP server presents a service's actions to an AI agent in a standard way, as tools the agent can find and use without custom code for each service.

Sources

  1. What is the Model Context Protocol? (modelcontextprotocol.io)
  2. Connect Claude Code to tools via MCP (Claude Code docs)
  3. Model Context Protocol, Codex CLI (OpenAI)
  4. Codex pricing and usage (OpenAI)
  5. What are skills? (Claude Help Center)

Keep reading