openclaw-mcp
Enables Claude Code to communicate with an OpenClaw bot via Matrix, allowing you to send messages and read replies using natural language.
README
openclaw-mcp
A Claude Code MCP server that lets you talk to your OpenClaw bot through Matrix.
How it works
Claude Code (your terminal)
└── MCP server (this package)
└── Matrix API
└── Your shared Matrix room
└── OpenClaw bot reads and replies
Claude Code gets two tools:
openclaw_send— send a message to your bot and wait for the replyopenclaw_read— read recent messages from the room
Setup
1. Prerequisites
- An OpenClaw instance with Matrix channel enabled
- A Matrix account for Claude Code (e.g. create
@yourclaude:matrix.orgon Element) - A Matrix room with both your bot and the Claude Code account invited
2. Install
npm install -g openclaw-mcp
Or clone and build:
git clone https://github.com/elkimek/openclaw-mcp.git
cd openclaw-mcp
npm install && npm run build
3. Configure Claude Code
Run the setup script — it prompts for your credentials, verifies them, and writes the MCP config to ~/.claude/settings.json automatically:
openclaw-mcp-setup
If installed from source:
node dist/setup.js
You'll need:
- Your Matrix access token (Element: Settings > Help & About > Access Token)
- The room ID (Element: Room Settings > Advanced > Internal room ID)
- Your OpenClaw bot's Matrix user ID (e.g.
@zofka:matrix.org)
The script validates your token and room access before writing the config.
4. Restart Claude Code
After setup, restart Claude Code to activate the MCP server.
Manual configuration
If you prefer to configure manually, add to ~/.claude/settings.json:
{
"mcpServers": {
"openclaw": {
"command": "openclaw-mcp",
"env": {
"OPENCLAW_MATRIX_TOKEN": "your-matrix-access-token",
"OPENCLAW_MATRIX_ROOM": "!roomid:matrix.org",
"OPENCLAW_BOT_USER_ID": "@yourbot:matrix.org"
}
}
}
}
Environment variables
| Variable | Required | Description |
|---|---|---|
OPENCLAW_MATRIX_TOKEN |
Yes | Matrix access token for the Claude Code account |
OPENCLAW_MATRIX_ROOM |
Yes | Matrix room ID (e.g. !abc123:matrix.org) |
OPENCLAW_BOT_USER_ID |
Yes | Your OpenClaw bot's Matrix user ID (e.g. @zofka:matrix.org) |
OPENCLAW_MATRIX_HOMESERVER |
No | Matrix homeserver URL (default: https://matrix.org) |
Usage
Once configured, just talk naturally in Claude Code:
"Ask my OpenClaw bot what my vitamin D levels are" "Message Žofka about my latest lab results" "Read the last messages from my bot"
Note on encryption
This MCP server uses the Matrix HTTP API directly without E2E encryption support. For encrypted rooms, use matrix-e2ee-bridge instead.
License
GPL-3.0
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.