D3 · Claude Code › Cluster 8 · Automation, MCP & Integrations

8.3 · Using MCP in Claude Code

Resources · prompts · /mcp
🔑 8.2 was about configuring servers; this page is about using them inside a session. (Designing the tools an MCP server exposes is a D2 topic — here we stay on the Claude Code client side.)

CONCEPT An MCP server surfaces in three ways

Once a server is connected, its capabilities show up in Claude Code through three distinct UI affordances. Knowing which is which is the whole exam point:

CapabilityHow you invoke itExample
ToolsClaude calls them automatically when a task needs them"Review PR #456" → GitHub tool runs
Resources@-mention, like referencing a file@github:issue://123
PromptsSlash commands, namespaced by server/mcp__github__pr_review 456

Resources use the format @server:protocol://resource/path. Type @ and connected servers' resources appear in the autocomplete alongside your files; they're fetched and attached when referenced. Prompts appear when you type /, in the form /mcp__servername__promptname, and accept space-separated arguments. Server and prompt names are normalized (spaces become underscores).

CONCEPT /mcp is the control panel

The /mcp slash command opens the MCP management panel inside a session. From it you can:

For OAuth you can also sign in from the shell without opening a session: claude mcp login <name> (and claude mcp logout <name> to clear credentials). Tokens are stored securely and refreshed automatically.
In headless mode (claude -p) there's no /mcp panel, so Claude Code can't run the interactive OAuth flow. Authenticate first from an interactive session or with claude mcp login; otherwise the server's tools are reported as unavailable until you sign in.

DIAGRAM Three surfaces of a connected server

flowchart TD SRV["Connected MCP server
(e.g. github)"] --> TOOLS["🟢 Tools
Claude calls automatically"] SRV --> RES["🔵 Resources
@server:protocol://path"] SRV --> PR["🟠 Prompts
/mcp__server__prompt"] TOOLS --> USE["Ask in natural language:
'Review PR #456'"] RES --> AT["Type @ → autocomplete →
@github:issue://123"] PR --> SL["Type / → pick →
/mcp__github__pr_review 456"] MCP["/mcp panel"] -.->|"status · tool count ·
OAuth · enable/disable"| SRV classDef ok fill:#d4edda,stroke:#28a745,color:#155724; classDef info fill:#cfe2ff,stroke:#0d6efd,color:#084298; classDef warn fill:#ffe8cc,stroke:#ff9f40,color:#9a4a0a; class TOOLS ok; class RES info; class PR warn;

CODE Referencing resources, running prompts, authenticating

These are in-session inputs, not shell commands — what you actually type into the Claude Code prompt.

# Reference an MCP resource with @server:protocol://path (like an @file)
Can you analyze @github:issue://123 and suggest a fix?

# Reference several at once
Compare @postgres:schema://users with @docs:file://database/user-model

# Run an MCP prompt (surfaces as a slash command), with arguments
/mcp__github__pr_review 456
/mcp__jira__create_issue "Bug in login flow" high

# Open the MCP panel: status, tool counts, OAuth sign-in, enable/disable
/mcp

Sign in to an OAuth server without leaving the shell:

# From your terminal (no interactive session needed)
claude mcp login sentry        # run the OAuth flow
claude mcp logout sentry       # clear stored credentials

TRADE-OFFS Resource @-mention vs. letting Claude call a tool

✅ @-mention a resource

  • You pin exactly which data enters context
  • Deterministic — fetched and attached immediately
  • Good when you already know the issue/schema id

⚙️ Let Claude call the server's tools

  • Claude decides what to fetch and when
  • Handles multi-step work ("find, then act")
  • With tool search, tools load on demand to save context
🔑 Resources and prompts are client-driven (you reference/invoke them); tools are model-driven (Claude decides). Same server, different control surfaces.

EXAM TRAPS

Trap: "MCP prompts are typed like @server:prompt." → No. Prompts are slash commands: /mcp__servername__promptname. The @server:protocol://path syntax is for resources.
Trap: "/mcp adds a new server." → /mcp manages existing servers (status, OAuth, enable/disable). You add servers with claude mcp add (8.2).
Trap: "OAuth just works in claude -p." → Headless mode has no /mcp panel to run the browser flow. Authenticate first in an interactive session or via claude mcp login <name>.
Trap: "Resources and prompts are the same thing." → Resources are data you attach with @; prompts are reusable server-defined commands that expand into the conversation via /mcp__….

PRACTICE

Q1 · You know a GitHub issue is #123. What's the fastest way to pull it into context?

Reference it as an MCP resource with an @-mention: @github:issue://123. The format is @server:protocol://resource/path; Claude Code fetches and attaches it immediately.

Q2 · A connected server shows unauthenticated. Two ways to sign in?

(1) Run /mcp inside a session and complete the OAuth flow in the browser; or (2) from the shell, run claude mcp login <name>. Tokens are stored securely and refreshed automatically.

Q3 · How does an MCP prompt named pr_review on server github appear, and how do you pass it a PR number?

It surfaces as a slash command /mcp__github__pr_review. Pass arguments space-separated: /mcp__github__pr_review 456. Its result is injected into the conversation.