2.8 KiB
OpenClaw MCP Server for GLaDOS
This MCP (Model Context Protocol) server exposes OpenClaw capabilities to GLaDOS, allowing GLaDOS to call OpenClaw tools and agents.
What is MCP?
MCP is a protocol for connecting AI assistants to tools and data sources. GLaDOS uses MCP to discover and call external tools dynamically.
Installation
- Install MCP package:
pip install mcp
- Verify GLaDOS MCP support:
python -c "from glados.mcp import MCPManager; print('OK')"
Tools Available
The OpenClaw MCP server exposes these tools to GLaDOS:
read_file(path)— Read file contentswrite_file(path, content, append=False)— Write filesexec_command(command, timeout=30)— Run shell commandslist_workspace_files(directory=".", pattern="*")— List filesweb_search(query, count=5)— Search the webspawn_subagent(task, model="default", timeout=120)— Spawn OpenClaw sub-agentssend_discord_message(channel_id, message)— Send Discord messagesget_openclaw_status()— Get OpenClaw gateway status
Configuration
Add to your GLaDOS config.yaml:
Glados:
# ... your existing config ...
mcp_servers:
- name: "openclaw"
transport: "stdio"
command: "python"
args:
- "C:\Users\admin\.openclaw\workspace\discord-voice-bot\openclaw_mcp_server.py"
- "stdio"
allowed_tools: null # Allow all tools, or specify a list
How It Works
- GLaDOS starts and connects to the OpenClaw MCP server via stdio
- OpenClaw server registers its tools with GLaDOS
- When you talk to GLaDOS, it can call OpenClaw tools
- Results are spoken back to you
Example Interactions
You: "GLaDOS, what's in my workspace?"
GLaDOS: calls list_workspace_files() "You have several Python files. Would you like me to read one?"
You: "Check the weather"
GLaDOS: calls OpenClaw web search "It's currently 72 degrees and sunny. Not that you go outside much."
You: "Fix the bug in main.py"
GLaDOS: calls read_file(), analyzes, calls write_file() "Fixed your sloppy code. You're welcome."
Running Standalone
Test the MCP server independently:
# Stdio mode (for GLaDOS integration)
python openclaw_mcp_server.py stdio
# HTTP mode (for external connections)
python openclaw_mcp_server.py http --port 8081
Troubleshooting
GLaDOS doesn't see the tools:
- Check GLaDOS logs for MCP connection errors
- Verify the path to
openclaw_mcp_server.pyis correct - Ensure
mcppackage is installed in the same Python environment as GLaDOS
Tools fail to execute:
- Check OpenClaw gateway is running
- Verify Discord token in
config.yaml(for messaging tools) - Review server logs for detailed errors
Permission errors:
- The MCP server runs with the same permissions as GLaDOS
- File operations are restricted to the OpenClaw workspace