MCP OpenClaw MCP Server

Integrate OpenClaw API for messaging, commands, calendar, and email management.

README.md

MCP OpenClaw

A Model Context Protocol (MCP) server that integrates with the OpenClaw API, enabling AI assistants to send messages, execute commands, manage calendar events, send emails, and track task status.

Features

  • Send Messages: Send messages to Telegram, WhatsApp, and Discord
  • Execute Commands: Run commands in the OpenClaw environment (sync or async)
  • Calendar Management: Create calendar events with attendees and reminders
  • Email: Send emails with support for CC/BCC
  • Task Status: Track the status of asynchronous commands

Installation

Global Installation

npm install -g mcp-openclaw

Local Installation

npm install mcp-openclaw

Configuration

Set the following environment variables:

export OPENCLAW_API_URL="https://api.openclaw.example.com"
export OPENCLAW_API_KEY="your-api-key-here"

Optional configuration:

export OPENCLAW_TIMEOUT="30000"        # Request timeout in milliseconds (default: 30000)
export OPENCLAW_MAX_RETRIES="3"        # Maximum retry attempts (default: 3)
export SERVER_NAME="mcp-openclaw"      # Server name (default: mcp-openclaw)
export SERVER_VERSION="1.0.0"          # Server version (default: 1.0.0)
export LOG_LEVEL="info"                # Log level: debug, info, warn, error (default: info)

Usage

With Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "openclaw": {
      "command": "node",
      "args": ["/path/to/mcp-openclaw/dist/index.js"],
      "env": {
        "OPENCLAW_API_URL": "https://api.openclaw.example.com",
        "OPENCLAW_API_KEY": "your-api-key-here"
      }
    }
  }
}

Available Tools

1. send_message

Send a message to a supported platform.

{
  "platform": "telegram",
  "recipient": "@username",
  "message": "Hello from OpenClaw!"
}

Supported platforms: telegram, whatsapp, discord

2. execute_command

Execute a command in the OpenClaw environment.

{
  "command": "ls -la",
  "timeout": 30,
  "async": false
}
3. create_calendar_event

Create a new calendar event.

{
  "title": "Team Meeting",
  "description": "Weekly team sync",
  "startTime": "2024-01-15T10:00:00Z",
  "endTime": "2024-01-15T11:00:00Z",
  "location": "Conference Room A",
  "attendees": ["user1@example.com", "user2@example.com"],
  "reminder": 15
}
4. send_email

Send an email.

{
  "to": "recipient@example.com",
  "subject": "Hello from OpenClaw",
  "body": "This is the email content",
  "cc": "cc@example.com",
  "bcc": "bcc@example.com",
  "html": false
}
5. get_task_status

Check the status of an asynchronous command.

{
  "taskId": "task-abc123"
}

Development

Setup

git clone https://github.com/yourusername/mcp-openclaw.git
cd mcp-openclaw
npm install

Build

npm run build

Test

npm test

Lint

npm run lint
npm run lint:fix

Format

npm run format

Project Structure

mcp-openclaw/
├── src/
│   ├── index.ts              # MCP Server entry point
│   ├── types.ts              # TypeScript type definitions
│   ├── openclaw-client.ts    # OpenClaw API client
│   └── tools/
│       ├── index.ts          # Tools registry
│       ├── send-message.ts
│       ├── execute-command.ts
│       ├── create-calendar-event.ts
│       ├── send-email.ts
│       └── get-task-status.ts
├── tests/                    # Test files
├── examples/                 # Usage examples
├── docs/                     # Documentation
└── scripts/                  # Build and utility scripts

Architecture

For detailed architecture information, see docs/ARCHITECTURE.md.

API Reference

For the complete API reference, see docs/API.md.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

MIT License - see LICENSE for details.

Changelog

See CHANGELOG.md for version history.

Support

Tools 5

send_messageSend a message to a supported platform like Telegram, WhatsApp, or Discord.
execute_commandExecute a command in the OpenClaw environment.
create_calendar_eventCreate a new calendar event with attendees and reminders.
send_emailSend an email with support for CC and BCC.
get_task_statusCheck the status of an asynchronous command.

Environment Variables

OPENCLAW_API_URLrequiredThe base URL for the OpenClaw API
OPENCLAW_API_KEYrequiredThe API key for authentication
OPENCLAW_TIMEOUTRequest timeout in milliseconds
OPENCLAW_MAX_RETRIESMaximum retry attempts
SERVER_NAMECustom server name
SERVER_VERSIONCustom server version
LOG_LEVELLog level (debug, info, warn, error)

Try it

Send a message to my team on Discord saying the deployment is complete.
Create a calendar event for a team meeting tomorrow at 10 AM in Conference Room A.
Send an email to project-leads@example.com with the weekly status update.
Run the system diagnostic command and check its status using the task ID.
Send a WhatsApp message to @manager confirming the project timeline.

Frequently Asked Questions

What are the key features of MCP OpenClaw?

Cross-platform messaging support for Telegram, WhatsApp, and Discord. Remote system command execution with sync and async support. Comprehensive calendar event management including attendees and reminders. Email sending capabilities with CC/BCC support. Asynchronous task tracking and status monitoring.

What can I use MCP OpenClaw for?

Automating team communications across multiple messaging platforms from a single AI interface. Managing complex scheduling workflows by creating calendar events directly through AI prompts. Executing remote system maintenance tasks and monitoring their completion status. Streamlining administrative email workflows by drafting and sending emails via AI.

How do I install MCP OpenClaw?

Install MCP OpenClaw by running: npm install -g mcp-openclaw

What MCP clients work with MCP OpenClaw?

MCP OpenClaw works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP OpenClaw docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare