Skip to main content
Back to blog

OpenClaw, Claude Code, and MCP: Building the AI Agent Stack for Infrastructure

How to combine OpenClaw, Claude Code, and Clanker Cloud MCP into a coordinated AI agent stack for infrastructure and DevOps.

Most AI-assisted DevOps setups treat each agent as a standalone tool. You run Claude Code for coding sessions, OpenClaw for async monitoring, and you accept that neither one knows what the other knows about your infrastructure. The result is fragmented context and duplicate configuration.

There is a better approach. When Claude Code, OpenClaw, and Clanker Cloud MCP share a single infrastructure layer, they form a coherent system: one agent handles synchronous coding sessions with live infra context, another runs scheduled and async ops in the background, and both pull from the same live data source. This guide walks through how the three pieces fit together and how to set them up.


The Full Stack Picture

The OpenClaw Claude Code MCP AI agent stack has three distinct roles, and the roles do not overlap.

Claude Code is a synchronous coding agent. You open a session, you work, the session ends. Its strength is deep, interactive work: reading your codebase, writing and running code, asking follow-up questions. Connected to Clanker Cloud MCP, it gains live infrastructure context during those sessions — what version is deployed, what env vars are set, what pods are running.

OpenClaw is an asynchronous, multi-channel, scheduled operations agent. It runs whether you are at the keyboard or not. Its HEARTBEAT.md mechanism executes a task checklist every 30 minutes. Connected to the same Clanker Cloud MCP server, it monitors service health, posts Slack summaries, and responds to infrastructure questions on WhatsApp, Discord, or Telegram.

Clanker Cloud MCP is the shared infrastructure data layer. It exposes your connected cloud providers — AWS, GCP, Azure, Kubernetes, Cloudflare, Hetzner, DigitalOcean, GitHub — as a live MCP server. Any MCP-compatible agent connects to it and gets real-time infrastructure state as tool responses. This is what makes the stack coherent: both Claude Code and OpenClaw query the same server, so they always have the same view of your infrastructure.

This is what an AI-native DevOps setup looks like in practice. Not a single magic agent, but a coordinated system where each component does what it is built for.


Claude Code's Role: Synchronous Coding with Infra Context

Claude Code is the right tool when you are actively working: debugging a service, writing a configuration change, tracing a deployment issue. On its own, it has deep knowledge of your codebase but no knowledge of your live infrastructure state. Clanker Cloud MCP closes that gap.

When you connect Claude Code to your Clanker Cloud MCP endpoint, the agent can check what version of a service is currently deployed before writing a patch, read live environment variables before generating a config file, and query Kubernetes pod status mid-session without leaving your terminal. That context is not static documentation — it is the live state of your infrastructure at the moment you ask.

The MCP configuration goes into ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "clanker-cloud": {
      "type": "http",
      "url": "https://mcp.clankercloud.ai/v1",
      "headers": {
        "Authorization": "Bearer YOUR_MCP_API_KEY"
      }
    }
  }
}

Restart Claude Code after saving the config. You can verify the connection by asking Claude Code to list your active Kubernetes namespaces or describe a running service — it should return live data from your connected cloud providers.

From this point, every Claude Code session has infrastructure awareness. When you ask it to write a database migration, it can first query the current schema version from your live environment. When you ask it to generate a Kubernetes deployment manifest, it can check existing resource limits and current node capacity. The openclaw claude code integration pattern starts here, at the shared data layer.


OpenClaw's Role: Async, Scheduled, Multi-Channel Ops

Claude Code is valuable during focused work sessions. OpenClaw covers everything else.

OpenClaw (68K+ GitHub stars, MIT license, built on Node.js/TypeScript) was designed for ambient infrastructure operations. Its HEARTBEAT.md mechanism is a plain markdown checklist that the agent executes autonomously every 30 minutes. You define what to check; OpenClaw runs it on schedule and reports results across whatever channels you have configured — Slack, Telegram, WhatsApp, Discord.

Connecting OpenClaw to Clanker Cloud MCP takes one command:

openclaw mcp set clanker-cloud --url https://mcp.clankercloud.ai/v1

Set the API key as an environment variable:

export CLANKER_CLOUD_MCP_API_KEY=YOUR_MCP_API_KEY

From this point, any HEARTBEAT.md task can query your live infrastructure. A minimal health-check heartbeat looks like this:

# HEARTBEAT

- [ ] Query Clanker Cloud for service health across all production namespaces
- [ ] Flag any service with error rate above 2% and post to #infra-alerts in Slack
- [ ] Report any pods in CrashLoopBackOff or OOMKilled state
- [ ] Summarize recent deployments in the last 60 minutes

OpenClaw executes this checklist, queries Clanker Cloud MCP for live data, and posts the output to Slack — without you initiating anything. When someone sends a question on Discord about whether the payments service is healthy, OpenClaw queries Clanker Cloud MCP and responds with a live answer, not a cached one.

This is the async dimension of the MCP AI agent infrastructure stack. OpenClaw runs at its own cadence, using the same infrastructure source of truth as your interactive sessions.


How Claude Code and OpenClaw Interact

Neither agent replaces the other. They occupy different time horizons.

Claude Code handles deep work with immediate context. When you are in a session, you have the agent's full attention, it can run code, and you can iterate interactively. OpenClaw handles ambient awareness and async operations. It runs continuously, monitors thresholds, and delivers information to wherever your team is paying attention.

The critical property of this stack is that both agents query the same Clanker Cloud MCP server. When OpenClaw's HEARTBEAT detects a problem and surfaces it to Slack, you can open a Claude Code session seconds later and immediately have the same infrastructure context OpenClaw was looking at. There is no stale data problem, no context reconciliation, no "OpenClaw saw X but Claude Code doesn't know about X."

The information flow goes in one direction: Clanker Cloud MCP is the source of truth, and both agents read from it. Neither agent updates the other — they update themselves from the shared layer. This architecture scales cleanly to additional agents.

For teams already using the vibe coding to production workflow, this stack adds the monitoring and async ops layer that makes it production-ready.


Setup Walkthrough

Here is the complete setup sequence for the full stack.

Step 1: Set up Clanker Cloud

Download the Clanker Cloud desktop app from clankercloud.ai. Connect your cloud providers (AWS, GCP, Azure, Kubernetes, or any combination) through the provider configuration screen. Navigate to Settings → MCP and generate an MCP API key. Your endpoint will be https://mcp.clankercloud.ai/v1.

Step 2: Connect Claude Code

Install Claude Code via Anthropic's documentation. Create or edit ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "clanker-cloud": {
      "type": "http",
      "url": "https://mcp.clankercloud.ai/v1",
      "headers": {
        "Authorization": "Bearer YOUR_MCP_API_KEY"
      }
    }
  }
}

Restart Claude Code and ask it to describe your infrastructure to verify the connection.

Step 3: Connect OpenClaw

Install OpenClaw:

npm install -g openclaw

Register the Clanker Cloud MCP server:

openclaw mcp set clanker-cloud --url https://mcp.clankercloud.ai/v1

Configure your preferred channels (Slack, Telegram, Discord, WhatsApp) via openclaw config.

Step 4: Write your first HEARTBEAT.md

Create a HEARTBEAT.md in your OpenClaw workspace:

# HEARTBEAT

- [ ] Check error rates for all services tagged production via Clanker Cloud
- [ ] Report any service with error rate above 2% to #infra-alerts
- [ ] List any Kubernetes pods not in Running state
- [ ] Report the most recent deployment across all connected providers

Run openclaw heartbeat start to activate the 30-minute schedule.

Step 5: Verify both agents see your infrastructure

In a Claude Code session: ask it to list your active Kubernetes namespaces.
In OpenClaw: run openclaw run "What services are currently deployed in the production namespace?".

Both should return live data from the same Clanker Cloud MCP server. If either fails, check the API key and endpoint URL in each agent's configuration. Full setup documentation is at docs.clankercloud.ai.


A Real Workflow Example

It is 2 AM. You are not at the keyboard.

OpenClaw's HEARTBEAT runs and queries Clanker Cloud MCP. The payments service is reporting a 4.2% error rate — the configured threshold is 2%. OpenClaw posts to Slack:

infra-alerts — Payments API error rate 4.2% (threshold: 2%). Recent deploy: 14:32 UTC. Top error: connection timeout to db-payments-prod. Pod count: 4 running, 0 failed. Memory utilization: 78%.

Your on-call engineer wakes up, sees the alert, and opens a Claude Code session on their laptop. Because Claude Code is already connected to the same Clanker Cloud MCP server, they ask: "What is the current state of db-payments-prod?"

Claude Code queries Clanker Cloud MCP and returns: the database connection pool is at 100% utilization, connections are queuing, and the pool size has not been changed since the 14:32 deploy. The deploy log shows a new query pattern was introduced that opens significantly more concurrent connections.

The engineer asks Claude Code to generate a configuration patch to increase the connection pool size and add connection timeout handling. Claude Code writes the patch, references the current configuration values from Clanker Cloud MCP, and explains what each change does.

The engineer reviews the patch, approves it through Clanker Cloud's maker mode, and the fix is applied. By the time they get back to bed, the error rate is dropping.

This workflow only works because both agents were using the same live infrastructure data source. OpenClaw detected the problem in the same infrastructure state that Claude Code then analyzed. No context-switching, no manually copying metrics from a dashboard into a chat window.


Adding More Agents: Codex, Hermes, and Local Models

The Clanker Cloud MCP server is not exclusive to Claude Code and OpenClaw. Any MCP-compatible agent can connect to it.

Codex CLI connects the same way Claude Code does, using the same ~/.claude/claude_desktop_config.json format or its own equivalent config. If your team uses Codex for OpenAI model access, it gets the same live infrastructure context.

Hermes agents connect via the MCP URL directly. OpenClaw itself supports running Hermes as one of its underlying models.

If you want to run everything locally — no external API calls — Clanker Cloud supports BYOK with Ollama-hosted models. Configure OpenClaw to use Gemma 4 via Ollama:

openclaw config set model ollama:gemma4

The Clanker Cloud MCP connection remains the same regardless of which model is running the agent. The infrastructure data layer is model-agnostic.

This is the architectural advantage of building around an AI agent MCP infrastructure stack: you add agents by connecting them to the MCP server, not by reintegrating each one with your cloud providers individually. The demo shows this with multiple agents running against a single Clanker Cloud instance.


FAQ

How do I connect OpenClaw and Claude Code to the same infrastructure?

Both connect to the Clanker Cloud MCP endpoint (https://mcp.clankercloud.ai/v1) using your MCP API key. Claude Code uses the ~/.claude/claude_desktop_config.json configuration file. OpenClaw uses openclaw mcp set clanker-cloud --url <endpoint>. Once both are connected, they are reading from the same live data source.

What is the difference between OpenClaw and Claude Code for DevOps?

Claude Code is a synchronous, session-based coding agent. You run it interactively; it reads your codebase, writes code, and executes commands. OpenClaw is an asynchronous, always-running operations agent. It monitors infrastructure on a schedule, posts to messaging channels, and responds to queries without a human initiating each interaction. For DevOps, Claude Code handles focused debugging and coding sessions; OpenClaw handles monitoring, alerting, and ambient awareness.

Can multiple AI agents share the same MCP server?

Yes. The MCP protocol is designed for this. Clanker Cloud exposes a single MCP endpoint that any number of connected agents can query simultaneously. Claude Code, OpenClaw, Codex, and Hermes can all connect to the same Clanker Cloud MCP server with the same API key. Each agent gets the same live infrastructure data independently.

What is MCP and why do I need it for AI agents?

Model Context Protocol (MCP) is a standard for exposing external data and tools to AI agents. Without MCP, each agent integration requires custom code to connect to each data source. With MCP, a single server exposes all your infrastructure as structured tool responses, and any MCP-compatible agent can consume it without additional integration work. Clanker Cloud implements MCP specifically for cloud infrastructure, which means you configure the connection once and every agent you add gets immediate access to live infra data. See the FAQ for more detail.


Get Started

The full stack is available now. Clanker Cloud is free during beta.

If you are already using Claude Code or OpenClaw and want to add live infrastructure context, the Clanker Cloud MCP connection is a five-minute setup. If you are building out a full AI DevOps stack from scratch, start with the AI DevOps for Teams guide and come back here when you are ready to add the agent layer.

Next step

Give your agent live infrastructure context

Download Clanker Cloud, expose the local MCP surface, and let coding agents work from current cloud, Kubernetes, GitHub, and cost state instead of guesses.

Download and connect MCPWatch demo