MCP in Claude Code

Model Context Protocol lets Claude Code use external context and tools through explicit server connections. It is the right path when repository files are not enough for the task.

Last verified
Applies to
Claude Code 2.1.x. CLI spellings were checked on local version 2.1.198; current official docs may describe newer 2.1.x behavior.
Verification method
Official documentation, CLI reference, and changelog reviewed on 2026-07-19. MCP add/get/list/remove syntax was checked in local help. Notion connectivity, OAuth, and tool execution remain official-documentation-based.
Official sources
MCP referenceCLI referenceChangelog

Reproducible practice

Evaluate one remote MCP server in local scope

Add a documented server without embedding credentials, inspect its scope and approval state, test only the needed capability, then remove it.

Prerequisites

  • A trusted scratch repository and permission to connect to the provider.
  • An understanding of the provider's data access and OAuth scopes.
  • No secrets placed directly in tracked .mcp.json files.

Steps

  1. Inspect the installed MCP CLI

    Confirm transport and scope options before changing configuration.

    Step 1
    claude mcp --help
    claude mcp add --help
  2. Add the official documented example locally

    Local scope limits the configuration to you and the current project.

    Step 2
    claude mcp add --transport http --scope local notion https://mcp.notion.com/mcp
  3. Inspect before use

    Review the URL, scope, connection or pending-approval state, and requested OAuth access.

    Step 3
    claude mcp get notion
    claude mcp list
  4. Test the smallest read-only request

    Open an interactive session, use /mcp to authenticate if required, and ask for a harmless metadata read before any write-capable task.

Expected result

The server is visible with the intended local scope, authentication state is explicit, and only the expected tools or resources are exposed.

Validation

  • Compare claude mcp get output with the URL and scope you intended.
  • Confirm the tool list before granting a write request.
  • After cleanup, claude mcp get notion should no longer find the local entry.

Failure handling

Pending approval

Open Claude Code in the trusted project and review the workspace trust and server approval prompts.

Authentication or connection error

Check server URL, provider status, OAuth scope, and proxy/TLS conditions; do not paste tokens into chat.

Cleanup or rollback

  • Run claude mcp remove --scope local notion.
  • Revoke the provider OAuth grant separately if authentication was completed.

Boundaries and when not to use it

  • MCP servers can expose external content and prompt-injection risk; trust and minimize each server.
  • SSE is deprecated in the current official reference. Prefer HTTP when the provider supports it.

What MCP adds

MCP can expose design files, tickets, internal APIs, documentation, databases, search systems, or custom tools. This reduces copy-paste context and lets Claude Code work with current external state.

Use cases

Common uses include reading product specs, looking up issue details, inspecting design components, querying internal services, and applying organization-specific actions that are not available as local shell commands.

Access boundaries

MCP servers should be treated like tool access. Keep permissions scoped, prefer read-only access for research, and only expose write operations when they are necessary and auditable.

Debugging MCP

When an MCP tool does not behave as expected, check whether the server is configured, connected, authorized, and visible inside the current Claude Code session before changing prompts.

CommandDescription
/mcpConfigure and inspect MCP servers inside a session.
claude mcpManage MCP servers from the terminal.
claude mcp login <server>Run OAuth for an MCP server without opening the UI panel.
Configure MCP from the CLI
claude mcp
claude mcp login sentry
claude mcp logout sentry

MCP server examples

Teams commonly connect issue trackers, design tools, documentation search, databases, and internal APIs. Each server should expose only the tools needed for its workflow.

MCP checklist

Related topics