Tutorial MCP

OpenClaw MCP Servers Guide: Model Context Protocol Integration

Learn about MCP (Model Context Protocol) servers in OpenClaw. What is MCP, how to connect servers, available servers, and building custom MCP servers.

Updated: February 1, 2026 10 min read

Quick Answer

MCP (Model Context Protocol) servers give OpenClaw access to external tools and APIs. Connect servers for GitHub, databases, Notion, Slack, and more to extend what your assistant can do.

OpenClaw’s power comes from its ability to connect to external tools and services. While skills extend OpenClaw’s capabilities, MCP (Model Context Protocol) servers provide a standardized way to connect to external APIs, databases, and services. This guide covers everything about MCP servers in OpenClaw.

What Is MCP?

MCP (Model Context Protocol) is a protocol that allows AI assistants to securely connect to external tools and data sources. Think of MCP servers as bridges between OpenClaw and external services.

Without MCP:

  • OpenClaw can only use built-in capabilities
  • External integrations require custom code
  • Each integration is unique and complex

With MCP:

  • Standardized way to connect external tools
  • Reusable servers for common services
  • Easy to add new capabilities
  • Secure and well-defined interface

Why MCP Matters

MCP servers enable OpenClaw to:

  • Access external APIs (GitHub, Notion, Slack, etc.)
  • Query databases (PostgreSQL, MySQL, MongoDB)
  • Interact with services (email, calendar, cloud storage)
  • Extend capabilities without modifying core code
  • Share integrations across the community

Instead of building custom integrations for each service, you can use (or create) MCP servers that follow a standard protocol.

How MCP Works

Architecture

MCP follows a client-server model:

  • OpenClaw = MCP Client (requests actions)
  • MCP Server = Service connector (executes actions)
  • Protocol = Standardized communication

When you ask OpenClaw to do something that requires an external service, OpenClaw:

  1. Identifies which MCP server can handle the request
  2. Sends a request to that server
  3. Server executes the action (API call, database query, etc.)
  4. Server returns results to OpenClaw
  5. OpenClaw presents results to you

Connection Types

MCP servers can connect via:

  • stdio: Standard input/output (local servers)
  • HTTP: REST API endpoints
  • WebSocket: Real-time connections
  • SSH: Remote server connections

Most MCP servers use stdio for local connections, which is simple and secure.

Available MCP Servers

The MCP ecosystem includes servers for many popular services:

Development Tools

GitHub MCP Server

  • Access repositories
  • Create issues and pull requests
  • Manage code
  • Review changes

GitLab MCP Server

  • Similar to GitHub
  • GitLab-specific features
  • CI/CD integration

Jira MCP Server

  • Manage tickets
  • Track projects
  • Update issues

Productivity Tools

Notion MCP Server

  • Read and write pages
  • Query databases
  • Manage content
  • Sync data

Slack MCP Server

  • Send messages
  • Read channels
  • Manage workspace
  • Handle notifications

Google Workspace MCP Server

  • Gmail access
  • Calendar management
  • Drive integration
  • Docs and Sheets

Data Sources

PostgreSQL MCP Server

  • Query databases
  • Execute SQL
  • Manage schemas
  • Data analysis

MySQL MCP Server

  • Database queries
  • Table management
  • Data operations

MongoDB MCP Server

  • Document queries
  • Collection management
  • Aggregation pipelines

Cloud Services

AWS MCP Server

  • EC2 management
  • S3 operations
  • Lambda functions
  • CloudWatch metrics

Google Cloud MCP Server

  • Compute Engine
  • Cloud Storage
  • BigQuery
  • Cloud Functions

Installing MCP Servers

Method 1: Built-in Servers

Some MCP servers come with OpenClaw or are easily installable:

openclaw mcp install github
openclaw mcp install notion
openclaw mcp install postgres

Method 2: Manual Installation

  1. Install the MCP server (usually via npm or package manager)
  2. Configure OpenClaw to use it
  3. Add credentials (API keys, tokens, etc.)
  4. Test connection

Example configuration in ~/.openclaw/config.json:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "your-token-here"
      }
    },
    "notion": {
      "command": "node",
      "args": ["/path/to/notion-mcp-server"],
      "env": {
        "NOTION_API_KEY": "your-key-here"
      }
    }
  }
}

Method 3: Community Servers

Browse the MCP server directory for community-maintained servers:

  • GitHub: github.com/modelcontextprotocol/servers
  • Community contributions
  • Custom servers

Using MCP Servers

Once installed, MCP servers are available automatically. OpenClaw knows what capabilities each server provides and uses them when appropriate.

Example: GitHub Integration

You: "Create a new issue in my openclaw project titled 'Add feature X'"
OpenClaw: [Uses GitHub MCP server to create issue]

OpenClaw:

  1. Identifies GitHub MCP server can handle this
  2. Connects to GitHub API via MCP server
  3. Creates the issue
  4. Confirms creation

Example: Database Query

You: "Query my PostgreSQL database and show me all users created this month"
OpenClaw: [Uses PostgreSQL MCP server to query database]

OpenClaw:

  1. Uses PostgreSQL MCP server
  2. Executes SQL query
  3. Formats results
  4. Presents data

Example: Notion Integration

You: "Add a new page to my Notion workspace with today's meeting notes"
OpenClaw: [Uses Notion MCP server to create page]

Building Custom MCP Servers

You can build custom MCP servers for services that don’t have one yet.

MCP Server Structure

An MCP server is a program that:

  1. Listens for MCP protocol messages
  2. Executes actions (API calls, queries, etc.)
  3. Returns results in MCP format
  4. Handles errors gracefully

Simple MCP Server Example

Here’s a minimal MCP server in Node.js:

#!/usr/bin/env node

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',
}, {
  capabilities: {
    tools: {},
  },
});

// Define a tool
server.setRequestHandler('tools/list', async () => ({
  tools: [{
    name: 'custom_action',
    description: 'Performs a custom action',
    inputSchema: {
      type: 'object',
      properties: {
        param: {
          type: 'string',
          description: 'A parameter',
        },
      },
    },
  }],
}));

// Handle tool execution
server.setRequestHandler('tools/call', async (request) => {
  const { name, arguments: args } = request.params;
  
  if (name === 'custom_action') {
    // Perform your custom action here
    const result = await performCustomAction(args.param);
    return {
      content: [{
        type: 'text',
        text: JSON.stringify(result),
      }],
    };
  }
  
  throw new Error(`Unknown tool: ${name}`);
});

// Start server
async function main() {
  const transport = new StdioServerTransport();
  await server.connect(transport);
  console.error('MCP server running');
}

main().catch(console.error);

MCP Server Best Practices

  1. Follow the protocol: Implement MCP specification correctly
  2. Handle errors: Return clear error messages
  3. Validate input: Check parameters before execution
  4. Document tools: Provide clear descriptions
  5. Secure credentials: Store API keys securely
  6. Test thoroughly: Ensure reliability

MCP vs Skills

You might wonder: when to use MCP servers vs skills?

Use MCP Servers when:

  • Connecting to external APIs/services
  • Need standardized protocol
  • Want reusable integrations
  • Building for community use

Use Skills when:

  • Creating custom workflows
  • Combining multiple capabilities
  • Need OpenClaw-specific logic
  • Building user-facing features

Often, skills use MCP servers under the hood. For example, an email skill might use a Gmail MCP server to access email.

Security Considerations

Credential Management

MCP servers need credentials (API keys, tokens, etc.):

  • Store securely in environment variables
  • Never commit to version control
  • Use OpenClaw’s credential management
  • Rotate credentials regularly

Access Control

Control what MCP servers can do:

  • Review server capabilities
  • Limit permissions when possible
  • Monitor server usage
  • Audit server actions

Network Security

For remote MCP servers:

  • Use HTTPS/WSS connections
  • Verify server certificates
  • Use authentication
  • Monitor network traffic

Troubleshooting

Server Not Connecting

  1. Check server is installed: openclaw mcp list
  2. Verify configuration in ~/.openclaw/config.json
  3. Check credentials are correct
  4. Review logs: openclaw logs

Server Errors

  1. Check server logs for errors
  2. Verify API credentials are valid
  3. Test server independently
  4. Check MCP protocol version compatibility

Performance Issues

  1. Monitor server response times
  2. Check for rate limiting
  3. Optimize queries/requests
  4. Consider caching

Development Workflow

Connect GitHub MCP server to:

  • Create issues from chat
  • Review pull requests
  • Manage repositories
  • Track projects

Data Analysis

Connect database MCP servers to:

  • Query data naturally
  • Generate reports
  • Analyze trends
  • Export data

Productivity

Connect Notion/Slack MCP servers to:

  • Manage workspace from chat
  • Sync information
  • Automate workflows
  • Coordinate teams

Next Steps

Now that you understand MCP servers:

  1. Browse available servers: Find servers for services you use
  2. Install a server: Try GitHub or Notion MCP server
  3. Use in conversations: Ask OpenClaw to use MCP capabilities
  4. Build custom server: Create one for a service you need
  5. Share with community: Contribute your servers

For more information:

MCP servers extend OpenClaw’s capabilities in powerful ways. Start connecting external tools today and unlock new possibilities for your AI assistant.

Need help?

Join the OpenClaw community on Discord for support, tips, and shared skills.

Join Discord →