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
Inspect the installed MCP CLI
Confirm transport and scope options before changing configuration.
Step 1 claude mcp --help claude mcp add --helpAdd 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/mcpInspect before use
Review the URL, scope, connection or pending-approval state, and requested OAuth access.
Step 3 claude mcp get notion claude mcp listTest 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.
Issue trackers
Ground bug fixes in current ticket state and acceptance criteria.
Read guideDesign tools
Implement UI from live components, tokens, or specs.
Read guideInternal docs
Query live API metadata instead of stale pasted context.
Read guidePlugins
Ship approved MCP packs through org plugin marketplaces.
Read guideAccess 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.
| Command | Description |
|---|---|
/mcp | Configure and inspect MCP servers inside a session. |
claude mcp | Manage MCP servers from the terminal. |
claude mcp login <server> | Run OAuth for an MCP server without opening the UI panel. |
claude mcp
claude mcp login sentry
claude mcp logout sentryMCP 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.
Issue and ticket systems
Fetch issue details, labels, and acceptance criteria so Claude Code can ground fixes in current tracker state.
Read guideDesign and product context
Expose components, specs, or design tokens when implementing UI from external design sources.
Read guideInternal APIs and docs
Let Claude Code query live documentation or service metadata instead of relying on stale pasted context.
Read guideRead-only research first
Start with search and fetch tools, then add write actions only when the workflow is audited.
Read guideMCP checklist
Start read-only
Expose read access first, then add write tools only when the workflow requires audited mutation.
Read guideDocument server purpose
Each MCP server should have a clear reason, data boundary, and expected failure behavior.
Read guideVerify tool visibility
Before changing prompts, check whether the current session can see and call the intended MCP tools.
Read guideTest OAuth separately
Use CLI login/logout flows to confirm authorization before debugging prompt behavior.
Read guide