MCP server for controlling HomeMatic smart home devices via the CCU JSON-RPC API
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Talk to your HomeMatic smart home from Claude, Cursor, or any MCP client.
ccu-mcp connects to the CCU's built-in JSON-RPC API and exposes your devices, rooms, programs, and system variables as MCP tools. No addons, no XML-API, no cloud โ just a direct connection to the CCU on your local network.
Works with any HomeMatic CCU: debmatic (HomeMatic on Debian), a CCU3, or OpenCCU (formerly RaspberryMatic) โ anything that exposes the standard /api/homematic.cgi endpoint.
Ask your AI assistant things like:
The MCP server handles device discovery, type resolution, session management, and value conversion โ the AI just calls the tools.
If it prints server_ready to stderr, it's working. Press Ctrl+C to stop. Now set it up in your MCP client โ see below.
A cache_save_failed โฆ mkdir '/data' line alongside it is harmless here but
worth fixing for real use: CACHE_DIR defaults to /data (the Docker layout),
so outside a container the device-type cache and the CCU session are never
persisted between runs. Point it somewhere writable:
export CACHE_DIR="$HOME/.cache/ccu-mcp" (or the same key in your .env /
env block).
Prefer a guided setup? npx ccu-mcp init probes your CCU, pins its TLS
certificate, tests the login, writes a ready-to-use .env file, and prints the
matching MCP client config โ see Command-line flags.
There are two ways to run this: stdio (the server runs as a subprocess of your MCP client) or HTTP (the server runs standalone in Docker and clients connect over the network). Pick one.
This is the easiest setup. Your MCP client (Claude Code, Cursor, etc.) starts the server as a child process โ no Docker, no network config, no auth tokens.
For Claude Code, create a .mcp.json file in your project directory (or any directory where you'll use Claude Code):
Replace your-ccu-hostname-or-ip with your CCU's hostname (like homematic-ccu3) or IP (like 192.168.1.50), and your-ccu-admin-password with the password you use to log into the CCU WebUI.
Restart Claude Code. Run /mcp to check it connected. You should see ccu-mcp in the list.
Alternatively, use the Claude Code CLI:
Use this if you want the server running independently โ for example on a home server, accessible to multiple clients, or when your MCP client supports HTTP remotes.
1. Start the container. Images are published to GHCR for linux/amd64 and
linux/arm64 (so a Raspberry Pi next to the CCU works), built natively on each
architecture and attested โ gh attestation verify oci://ghcr.io/claymore666/ccu-mcp:latest --repo claymore666/ccu-mcp
proves the image came from this repository's release workflow.
Every release also publishes its own X.Y.Z tag โ pin that instead of latest
if you'd rather upgrade deliberately. To build from source instead:
Then run it:
MCP_ALLOWED_HOSTSis required for remote clients. The server's DNS-rebinding protection rejects any request whoseHostheader isn't on the allowlist โ by default onlylocalhost/127.0.0.1/[::1]on the MCP port. Set it to every name/IP clients will use to reach the server (comma-separated,host:port). Without it, the local health check works but every remote MCP request gets 403 Invalid Host header.
2. Get the auth token. The server generates a random bearer token on first startup and saves it inside the container's data volume. You need this token to authenticate your MCP client. Grab it with:
This prints something like MCP_AUTH_TOKEN=e96suzi1iG0H-GPif6K2.... The part after = is your token.
3. Configure your MCP client. If your client uses .mcp.json, add the HTTP server:
To inject the token automatically (requires jq):
This only updates the ccu-mcp entry โ other servers in your .mcp.json are left alone.
4. Check it's healthy:
By default the HTTP server sends no CORS headers, so a random web page can't drive a local instance. To let browser-based MCP clients like MCP Inspector connect directly, set MCP_ALLOWED_ORIGINS to a comma-separated allowlist of trusted origins (e.g. https://app.example,http://localhost:6274). A request whose Origin is on the list gets that exact origin reflected in Access-Control-Allow-Origin โ never the wildcard *, which would let any site drive a local instance that controls real CCU hardware. A request from any other origin gets no CORS headers (the browser blocks it) and is rejected server-side by DNS-rebinding protection. Authentication is always enforced regardless: every MCP request needs the bearer token.
The HTTP transport also has DNS-rebinding protection on by default: it rejects requests whose Host header isn't localhost/127.0.0.1/[::1] on the configured port. If you reach the server under another hostname or IP (reverse proxy, container DNS name, the server's LAN address), list those hosts in MCP_ALLOWED_HOSTS or legitimate requests get a 403.
TLS. The bearer token travels in the request, so anything beyond loopback should be encrypted. You have two options: terminate TLS at a reverse proxy (Caddy/nginx) in front and bind the server to loopback (MCP_HOST=127.0.0.1), or let the server serve HTTPS itself by setting MCP_TLS_CERT and MCP_TLS_KEY to a PEM cert/key pair. Plain HTTP is still fully supported โ it stays the zero-config default โ but the server logs a warning at startup when it's serving the token over unencrypted HTTP on a non-loopback bind; set MCP_ALLOW_PLAINTEXT=true to acknowledge that and silence it.
Token rotation & expiry. By default the bearer token lives forever. Two optional, composable controls let you rotate it without dropping clients:
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/ccu-mcp)<a href="https://allmcps.com/mcp/ccu-mcp"><img src="https://allmcps.com/api/badge/ccu-mcp?style=directory" alt="Ccu MCP on AllMCPs" /></a>