Core Features ⚡ Intermediate

MCP Protocol: AI's USB Port — Plug-and-Play Tools

Model Context Protocol lets AI connect to any tool. Learn how MCP works and why it's the backbone of OpenClaw.

📝 建立:2026年2月24日 ✅ 最後驗證:2026年2月24日
鴨編 卡住很正常——點段落旁的 😵 卡關 讓我們知道,或直接往下滾到問答區發問。 也可以用 👍 看懂 / 😢 看不懂 告訴我們哪裡寫得好、哪裡要改。

An Annoying Problem

Have you ever had this experience?

You want AI to “search for a document in Google Drive → summarize it → send it to Slack.”

Sounds simple in theory. But in practice:

  • Google Drive’s API → one authentication method, one format
  • Slack’s API → another authentication method, another format
  • Notion’s API → yet another authentication method, yet another format

Every tool speaks its own “dialect.” You (or your AI) have to learn each one.


What Is MCP? One Analogy Is All You Need

MCP = The USB standard for AI tools.

Remember the world before USB?

  • Printers used LPT ports
  • Mice used PS/2 ports
  • Cameras had their own proprietary cables
  • Phones had Micro USB, Mini USB, Lightning…

USB-C unified everything.

MCP does the same thing for AI. It defines a standard “communication protocol” that lets AI talk to all tools using the same language.

Before: AI → various different APIs → Google / Slack / Notion / …
Now:    AI → MCP protocol → Google / Slack / Notion / …

The Full Name and Origin of MCP

MCP = Model Context Protocol

Proposed by Anthropic (the company behind Claude) in late 2024, it’s now adopted by major AI frameworks, including OpenClaw.

Why “Context Protocol”?

Because its core function is to feed external tool information (Context) into AI’s decision-making process in a standardized way.


MCP Architecture: Three Roles

┌──────────┐     MCP Protocol    ┌──────────────┐     Actual Tools
│          │ ←─────────────────→ │              │ ←──────────→  Google Drive
│  MCP     │                     │  MCP Server  │               Slack
│  Client  │                     │  (Bridge)    │               Notion
│ (OpenClaw)│                     │              │               Any API
└──────────┘                     └──────────────┘
RoleWhat It IsExample
MCP ClientThe side that uses toolsOpenClaw Agent
MCP ServerThe bridge that provides tool capabilitiesgoogle-drive-server, slack-server
ToolThe actual functionalitySearch files, send messages, query databases

An Analogy

You (MCP Client) → Translator (MCP Server) → Foreign Client (Tool)

You only need to speak English to the translator (MCP protocol), and the translator will communicate in the other party’s language (various APIs).

Duck Editor Duck Editor says: To put it even more simply — MCP is like an internal phone system in an office. Whether you need to reach the finance department (Google Drive) or the marketing department (Slack), just dial the extension number. No need to walk to their office and learn their jargon.


How Does MCP Work?

1. Discovery

The Client asks the Server: “What can you do?“

// Client → Server
{ "method": "tools/list" }

// Server → Client
{
  "tools": [
    {
      "name": "search_files",
      "description": "Search files in Google Drive",
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": { "type": "string", "description": "Search keyword" }
        }
      }
    },
    {
      "name": "read_file",
      "description": "Read the contents of a specific file"
    }
  ]
}

2. Invocation

Once the Client knows what tools are available, it can use them:

// Client → Server
{
  "method": "tools/call",
  "params": {
    "name": "search_files",
    "arguments": { "query": "weekly meeting notes" }
  }
}

// Server → Client
{
  "content": [
    {
      "type": "text",
      "text": "Found 3 files:\n1. 2024-02 Weekly Meeting Notes\n2. ..."
    }
  ]
}

3. AI Decision-Making

After receiving the results, the Agent decides what to do next. This is the Agent’s ReAct workflow:

Observe: Found 3 weekly meeting notes
Think:   User wants the most recent one, pick the first
Act:     Call read_file to get its contents
Observe: Got the content
Think:   Summarize it
Act:     Call LLM to generate a summary

Using MCP in OpenClaw

Installing an MCP Server

OpenClaw has a built-in MCP Client. You just need to start the corresponding MCP Server.

Using Google Drive as an example:

# Install Google Drive MCP Server
npm install -g @anthropic/mcp-server-google-drive

# Or use OpenClaw's built-in command
openclaw mcp install google-drive

Configuring the Connection

In OpenClaw’s config file config.yaml:

mcp_servers:
  google-drive:
    command: mcp-server-google-drive
    args:
      - --credentials=/path/to/credentials.json
    env:
      GOOGLE_API_KEY: ${GOOGLE_API_KEY}

  slack:
    command: mcp-server-slack
    env:
      SLACK_TOKEN: ${SLACK_TOKEN}

  notion:
    command: mcp-server-notion
    env:
      NOTION_TOKEN: ${NOTION_TOKEN}

After starting, your Agent can operate Google Drive, Slack, and Notion all at once.

Duck Editor Not sure how to set up a Google API Key? Check the Google API Key Setup Guide.

Confirming the Connection

# List all connected MCP Servers
openclaw mcp list

# Test a specific Server
openclaw mcp test google-drive

What MCP Servers Are Available?

The ecosystem is growing fast. Here are the major Servers as of early 2026:

Productivity Tools

MCP ServerFeaturesDifficulty
Google DriveSearch, read/write files⭐ Easy
Google CalendarSchedule management⭐ Easy
GmailSend/receive emails⭐⭐ Medium
NotionKnowledge base operations⭐ Easy
SlackSend/reply messages⭐ Easy
TelegramChatbot⭐⭐ Medium

Developer Tools

MCP ServerFeaturesDifficulty
GitHubRepo / Issue / PR management⭐⭐ Medium
Database (PostgreSQL)Database queries⭐⭐ Medium
DockerContainer management⭐⭐⭐ Advanced
KubernetesCluster management⭐⭐⭐ Advanced

Data Sources

MCP ServerFeaturesDifficulty
Web SearchWeb search⭐ Easy
Web ScraperWeb scraping⭐⭐ Medium
RSSRSS feeds⭐ Easy

Duck Editor You can find the full list on ClawHub.


Why MCP Matters to You

1. No Need to Learn Every Tool’s API

Before: You had to read Google API docs + Slack API docs + Notion API docs…

Now: Install an MCP Server, and it works out of the box.

2. The Agent Automatically Selects Tools

You don’t need to specify “first search with Google, then save to Notion.” The Agent automatically determines which MCP Server’s tools to use based on your goal.

This is the power of an Agent.

3. Switch Tools Without Changing Your Workflow

Using Notion today but want to switch to Obsidian tomorrow? Just swap out one MCP Server — your Skills and Agent logic remain completely unchanged.

Duck Editor In other words: Before, switching from Notion to Obsidian was like moving house — packing, dismantling, reorganizing everything. With MCP, switching tools is like swapping a light switch cover plate — the wiring stays the same, you just replace one component.

4. Built-in Security

MCP has standard authentication and permission mechanisms:

# Restrict Agent to read-only, no writing
mcp_servers:
  google-drive:
    permissions:
      - search_files: allow
      - read_file: allow
      - write_file: deny   # No writing
      - delete_file: deny  # No deleting

Advanced: Build Your Own MCP Server

If you need to connect internal systems or custom APIs, you can write your own MCP Server.

Minimal Example (Node.js)

import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

const server = new Server({
  name: "my-custom-server",
  version: "1.0.0"
});

// Define a tool
server.setRequestHandler("tools/list", async () => ({
  tools: [{
    name: "get_weather",
    description: "Query weather for a specific city",
    inputSchema: {
      type: "object",
      properties: {
        city: { type: "string", description: "City name" }
      },
      required: ["city"]
    }
  }]
}));

// Implement tool logic
server.setRequestHandler("tools/call", async (request) => {
  if (request.params.name === "get_weather") {
    const city = request.params.arguments.city;
    // Call weather API...
    return {
      content: [{ type: "text", text: `${city}: Currently 25°C, Sunny` }]
    };
  }
});

// Start the Server
const transport = new StdioServerTransport();
await server.connect(transport);

Duck Editor The MCP SDK is currently available for Node.js and Python. If you can code, you can easily extend it.


Frequently Asked Questions

What’s the difference between MCP and OpenAPI (Swagger)?

OpenAPI is a specification for defining REST APIs. MCP is a tool connection protocol specifically for AI. MCP is higher-level — it includes tool descriptions, authentication flows, and result formats that AI needs.

Are all MCP Servers free?

MCP Servers themselves are mostly open-source and free. However, the services they connect to (like Google API) may require an API Key and incur costs.

How many MCP Servers can I connect at once?

There’s no limit. OpenClaw can manage dozens of MCP Servers simultaneously, and the Agent will automatically select the right one based on the task.


Next Steps

Now that you understand MCP, you can:

這篇文章對你有幫助嗎?

💬 問答區

卡關了?直接在這裡問,其他讀者和作者都能幫忙解答。

載入中...