Skip to content

What is an MCP Tool vs an MCP Resource in Model Context Protocol?

Beginner · 2 min read · AI Agents & MCP

Open in study mode to save this question and track progress

Short answer: In the Model Context Protocol (MCP), an MCP Resource is a passive data endpoint that exposes contextual data (files, database tables, logs) for reading, while an MCP Tool is an executable function that performs active operations (writing data, triggering APIs, modifying state).

Detail

The Anthropic Model Context Protocol (MCP) standardizes how AI applications connect to external data and systems:

PrimitivesDirectionalityMode of OperationExample
MCP ResourceRead-OnlyPassive context readingReading a local schema.sql file, fetching a log file, reading a git diff
MCP ToolRead/WriteExecutable actionsend_email(), run_git_commit(), execute_query()
MCP PromptRead-OnlyPre-designed templateSystem prompt templates, workflow guidelines

Why Separation Matters

Separating passive resources from executable tools allows clients to enforce fine-grained security policies: resources can be safely auto-read into context, while tools require explicit user confirmation prior to execution.

Example

JSON-RPC schema difference in MCP:

json
// MCP Resource Definition (Read Context)
{
  "uri": "file:///logs/app.log",
  "name": "Application Logs",
  "mimeType": "text/plain"
}

// MCP Tool Definition (Executable Action)
{
  "name": "restart_server",
  "description": "Restarts target application container",
  "inputSchema": {
    "type": "object",
    "properties": {
      "server_id": {"type": "string"}
    }
  }
}

Interview tips

  • Highlight MCP's architecture: decoupling LLM clients (Claude Desktop, IDEs) from backend data servers via standardized JSON-RPC over stdio or Streamable HTTP.
  • Explain human-in-the-loop security for MCP tool calls.

⬅ Back to AI Agents and MCP · All topics