Free Guide · MCP

MCP: wiring in your own tools

By default the agent sees files. MCP is how you hand it your database, your issue tracker or an internal API — and exactly as far as you allow, no further.

The signal that you need it

You keep copying things into the chat. A stack trace out of Sentry. A ticket out of Jira. A row out of the database. Every paste is context you had to fetch by hand, and it is stale the moment you paste it.

Without MCP you look it up, copy it, paste it, and it is a snapshot
With MCP Claude queries the source itself, when it needs it

MCP (Model Context Protocol) is an open standard for connecting an agent to external tools and data. Claude Code speaks it, so anything with an MCP server — and most of the tools you already use have one — becomes something Claude can read and act on directly.

01 · Three kinds of server

stdio

Runs as a process on your machine. Good for local things: a database, a filesystem tool, something you wrote yourself.

--transport stdio
http

A remote service over HTTP. This is what most hosted tools give you.

--transport http
sse

The older remote transport. Deprecated, still supported.

--transport sse

02 · Adding one

A local server runs a command. Everything after -- is passed to that command untouched:

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

A remote one just takes a URL:

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

With a token, if the service uses one rather than OAuth:

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

03 · Scope: who gets this server

The flag that decides whether this is yours, this project's, or the team's.

ScopeLoads inSharedStored in
local (default)this project onlyno~/.claude.json
projectthis project onlyyes, via git.mcp.json in the repo
userall your projectsno~/.claude.json
terminal
claude mcp add --transport http shared-server --scope project https://example.com/mcp

04 · The committed file

Project-scoped servers land in .mcp.json at the repo root, so a teammate who clones the project gets the same tooling:

.mcp.json
{
  "mcpServers": {
    "notion": {
      "type": "http",
      "url": "https://mcp.notion.com/mcp"
    },
    "database-tools": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@example/mcp-server"],
      "env": {
        "DB_URL": "postgresql://localhost/mydb"
      }
    }
  }
}

Do not commit secrets into it.

Expand them from the environment instead: ${API_KEY}, or ${API_BASE_URL:-https://api.example.com} to supply a default.

05 · Logging in

Most hosted servers use OAuth. Add the server, then authenticate from inside a session:

terminal
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
in the session
/mcp

That opens the browser login flow. From the shell, claude mcp login sentry does the same, and claude mcp logout sentry clears the credentials again.

06 · How the tools show up

Once connected, the server's tools appear under a predictable name:

naming
mcp__<server-name>__<tool-name>

# a `query` tool from a server named `database`
mcp__database__query

Which matters, because that name is what you write in permission rules, in a skill's allowed-tools, in a subagent's tool list, and in hook matchers. A matcher of mcp__database__.* catches everything that server exposes.

So the guardrails you already know apply here unchanged: an MCP tool is just another tool call, and a PreToolUse hook can deny it like any other.

07 · Managing them

terminal
claude mcp list              # everything configured
claude mcp get notion        # details for one
claude mcp remove notion     # disconnect it
claude mcp add-from-claude-desktop   # import what you already set up

/mcp inside a session shows live connection status, which is the first thing to check when a tool silently is not there.

08 · The part to be careful about

An MCP server decides what content enters Claude's context. That makes a server you do not control a genuine attack surface, not a theoretical one.

The useful instinct: connecting an MCP server is closer to installing a dependency than to changing a setting. Apply the same suspicion you would to an unfamiliar npm package.

Verified against the official Claude Code documentation, September 2026. Claude Code moves quickly, so check the official documentation before relying on a detail here.

What's next