Skip to main content
Claude Code integrates with the Model Context Protocol (MCP) to extend its capabilities with external servers. This page covers the built-in tools that bridge Claude Code to MCP servers, plus the web-access tools WebFetchTool and WebSearchTool.

MCPTool

Execute tools provided by connected MCP servers

ListMcpResourcesTool

Enumerate resources available on MCP servers

ReadMcpResourceTool

Read a specific resource by URI from an MCP server

McpAuthTool

Initiate OAuth authentication for an MCP server

WebFetchTool

Fetch and process content from a URL

WebSearchTool

Execute a web search and retrieve results

MCPTool

MCPTool is the generic wrapper that exposes every tool registered by a connected MCP server as a first-class Claude Code tool. Each MCP server tool becomes individually callable under the naming convention:
mcp__<server-name>__<tool-name>
For example, a server named github providing a create_issue tool is exposed as mcp__github__create_issue. Tool name: mcp__<server>__<tool> (dynamic, per connected server)
Read-only: determined by the MCP server
Concurrency-safe: determined by the MCP server
Destructive: determined by the MCP server

Dynamic schema

MCPTool’s input schema is passthrough — it accepts any JSON object and forwards it verbatim to the MCP server. The actual schema for each tool is defined by the server and reported via the MCP tools/list RPC. Claude Code displays the server-provided description and parameter documentation in the UI.
// Internal schema definition (passthrough)
const inputSchema = z.object({}).passthrough()
When Claude Code connects to an MCP server, it calls tools/list, receives the tool definitions, and registers a concrete tool instance for each one — replacing the passthrough schema with the server’s actual JSON Schema.

Tool naming convention

ComponentSource
mcp__Fixed prefix indicating MCP origin
<server-name>The name field from the server’s config in settings.json
<tool-name>The name field from the server’s tools/list response

Permission model

MCP tool calls go through the same permission system as built-in tools. You can configure always_allow rules for specific MCP tools in settings.json:
{
  "permissions": {
    "allow": [
      "mcp__github__list_issues",
      "mcp__filesystem__read_file"
    ]
  }
}

Usage example

Calling a GitHub MCP tool to list open issues:
{
  "tool": "mcp__github__list_issues",
  "input": {
    "owner": "anthropics",
    "repo": "claude-code",
    "state": "open",
    "limit": 10
  }
}

ListMcpResourcesTool

Lists all resources (data sources) available across connected MCP servers, or scoped to a specific server. Resources are persistent, addressable data items (files, database tables, API endpoints, etc.) that an MCP server exposes for reading. Tool name: ListMcpResourcesTool
Read-only: yes
Concurrency-safe: yes
Destructive: no

Parameters

server
string
Optional server name to filter results. When omitted, returns resources from all connected servers. Pass the exact server name from your MCP configuration.

Return value

An array of resource descriptors:
[].uri
string
Resource URI (e.g. file:///path/to/file, db://mydb/table/users).
[].name
string
Human-readable name for the resource.
[].mimeType
string
Optional MIME type of the resource content.
[].description
string
Optional description of the resource.
[].server
string
Name of the server that provides this resource.

Usage example

{
  "tool": "ListMcpResourcesTool",
  "input": {
    "server": "filesystem"
  }
}

ReadMcpResourceTool

Reads the contents of a specific resource from an MCP server by URI. Binary content is saved to a local file; text content is returned inline. Tool name: ReadMcpResourceTool
Read-only: yes
Concurrency-safe: yes
Destructive: no

Parameters

server
string
required
The MCP server name that hosts the resource.
uri
string
required
The resource URI to read, as returned by ListMcpResourcesTool.

Return value

contents
array
Array of content items from the resource:
  • uri — the resource URI
  • mimeType — optional MIME type
  • text — text content (present for text resources)
  • blobSavedTo — local path where binary content was saved (present for binary resources)

Usage example

{
  "tool": "ReadMcpResourceTool",
  "input": {
    "server": "filesystem",
    "uri": "file:///home/user/project/config.json"
  }
}

McpAuthTool

A pseudo-tool that is automatically injected in place of an MCP server’s real tools when that server requires OAuth authentication. Calling it starts the OAuth flow and returns an authorization URL for the user to complete in their browser. Tool name: mcp__<server>__authenticate (one per unauthenticated server)
Read-only: no
Concurrency-safe: no

Authentication flow

1

Server needs auth

Claude Code connects to the server and receives an HTTP 401. The server’s real tools are replaced with a single mcp__<server>__authenticate pseudo-tool.
2

Initiate OAuth

Claude calls mcp__<server>__authenticate with no parameters. Claude Code starts the OAuth flow in the background with skipBrowserOpen: true.
3

Share URL

McpAuthTool returns { status: "auth_url", authUrl, message }. Claude presents the URL to the user.
4

Browser callback

The user opens the URL and completes authorization. The OAuth callback fires in the background.
5

Reconnect

Claude Code calls reconnectMcpServerImpl, clears the auth cache, and swaps the pseudo-tool out for the server’s real tools. This happens automatically — no further action is needed.

Parameters

McpAuthTool accepts no parameters ({}).

Return value

status
string
"auth_url" — OAuth URL was obtained and should be shown to the user.
"unsupported" — The server’s transport does not support programmatic OAuth (e.g. stdio). Direct the user to run /mcp manually.
"error" — The OAuth flow failed. Includes an error message.
message
string
Human-readable instructions or error message.
authUrl
string
The authorization URL to open in a browser (present when status is "auth_url").
McpAuthTool only supports sse and http MCP transports. Servers using stdio or claudeai-proxy transports must be authenticated manually via the /mcp command.

WebFetchTool

Fetches content from an HTTP(S) URL, converts it to Markdown, and applies a prompt to extract or summarise the relevant parts. Useful for reading documentation, API references, or any web page. Tool name: WebFetch
Read-only: yes
Concurrency-safe: yes
Destructive: no

Parameters

url
string
required
The fully-formed URL to fetch (must be a valid https:// or http:// URL).
prompt
string
required
A natural-language prompt describing what to extract or summarise from the fetched content. The tool fetches the page, converts it to Markdown (up to ~100 000 characters), and applies this prompt to focus the output.

Return value

url
string
The URL that was fetched.
code
number
HTTP response status code (e.g. 200, 404).
codeText
string
HTTP response status text (e.g. "OK", "Not Found").
bytes
number
Size of the fetched content in bytes.
result
string
Processed output after applying the prompt to the fetched content.
durationMs
number
Wall-clock time to fetch and process the content in milliseconds.

Pre-approved hosts

Certain hosts (e.g. docs.anthropic.com) are pre-approved and do not require user permission. All other hosts prompt for permission on first use unless configured in settings.json.

Usage example

{
  "tool": "WebFetch",
  "input": {
    "url": "https://docs.anthropic.com/en/api/getting-started",
    "prompt": "What are the rate limits for the Messages API?"
  }
}

WebSearchTool

Executes a web search using Anthropic’s built-in search capability (web_search_20250305) and returns a list of matching pages with titles and URLs. Tool name: WebSearch
Read-only: yes
Concurrency-safe: yes
Destructive: no
WebSearchTool is only available when the active model supports the web_search_20250305 beta tool (currently Claude models on Anthropic’s API). It is automatically disabled on Bedrock, Vertex, and other providers that do not support this capability.

Parameters

query
string
required
The search query (minimum 2 characters).
allowed_domains
string[]
Restrict results to pages from these domains only. For example ["docs.anthropic.com", "github.com"].
blocked_domains
string[]
Exclude results from these domains. Takes precedence over allowed_domains.

Return value

query
string
The search query that was executed.
results
array
Mixed array of search result objects and text commentary from the model. Each search result has:
  • tool_use_id — identifier of the search invocation
  • content[] — array of { title, url } search hits
durationSeconds
number
Total time to complete the search operation.

Usage example

{
  "tool": "WebSearch",
  "input": {
    "query": "Claude Code MCP integration tutorial",
    "allowed_domains": ["docs.anthropic.com"]
  }
}
Combine WebSearchTool with WebFetchTool: use WebSearchTool to identify relevant pages, then WebFetchTool to read the content in detail.

Build docs developers (and LLMs) love