> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codealive.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw

> Connect CodeAlive with OpenClaw for semantic code search and codebase intelligence

## Overview

Integrate CodeAlive with [OpenClaw](https://openclaw.ai/) to give your personal AI agent deep contextual understanding of your entire codebase. OpenClaw supports MCP natively, so CodeAlive tools are available out of the box.

<Tip>
  **Quick install:** Run `npx @codealive/installer` to automatically configure CodeAlive for OpenClaw.
  See the [Installation Guide](/installation) for details.
</Tip>

## Prerequisites

* [OpenClaw](https://openclaw.ai/) installed and running
* CodeAlive account
* At least one repository added in your CodeAlive dashboard
* CodeAlive API key ([Sign up here](https://app.codealive.ai))
* Indexed repositories in your CodeAlive dashboard

## Installation

<Steps>
  <Step title="Add a repository and get your API key">
    Add at least one repository in your CodeAlive dashboard, then get your API key from [app.codealive.ai/settings/api-keys](https://app.codealive.ai/settings/api-keys).
  </Step>

  <Step title="Add MCP Server to openclaw.json">
    Edit your OpenClaw configuration file at `~/.openclaw/openclaw.json` and add the CodeAlive MCP server under `agents.main.mcpServers`:

    **Remote HTTP (recommended):**

    ```json theme={null}
    {
      "agents": {
        "main": {
          "mcpServers": {
            "codealive": {
              "transport": "streamable-http",
              "url": "https://mcp.codealive.ai/api",
              "headers": {
                "Authorization": "Bearer YOUR_API_KEY_HERE"
              }
            }
          }
        }
      }
    }
    ```

    **Docker (STDIO):**

    ```json theme={null}
    {
      "agents": {
        "main": {
          "mcpServers": {
            "codealive": {
              "command": "docker",
              "args": [
                "run", "--rm", "-i",
                "-e", "CODEALIVE_API_KEY=YOUR_API_KEY_HERE",
                "ghcr.io/codealive-ai/codealive-mcp:main"
              ]
            }
          }
        }
      }
    }
    ```

    Replace `YOUR_API_KEY_HERE` with your actual API key.

    <Info>OpenClaw uses JSON5 format — comments and trailing commas are allowed in the config file.</Info>
  </Step>

  <Step title="Restart OpenClaw">
    OpenClaw watches `openclaw.json` for changes and applies them automatically. If the server doesn't pick up the new config, restart it.
  </Step>

  <Step title="Verify Integration">
    Ask OpenClaw:

    * "What CodeAlive repositories are available?"
    * "Search for authentication code in my codebase"
  </Step>
</Steps>

## Available Tools

Once connected, OpenClaw can use these CodeAlive tools:

| Tool                         | Description                                                                                 |
| ---------------------------- | ------------------------------------------------------------------------------------------- |
| `semantic_search`            | Canonical semantic search across indexed repositories                                       |
| `grep_search`                | Exact text or regex search with line-level previews                                         |
| `get_repository_ontology`    | Repository-level orientation for one selected repository                                    |
| `get_file_tree`              | Bounded file tree for one repository                                                        |
| `read_file`                  | Read one repository-relative file path                                                      |
| `fetch_artifacts`            | Retrieve full source code for search results                                                |
| `get_artifact_relationships` | Expand call graph, inheritance, and references for one artifact                             |
| `get_artifact_query_schema`  | Inspect ArtifactQuery metadata schema                                                       |
| `query_artifact_metadata`    | Run read-only metadata analytics                                                            |
| `chat`                       | Stateless slower synthesized codebase Q\&A, only when explicitly requested                  |
| `get_data_sources`           | List available repositories and workspaces, optionally relevance-filtered by a task `query` |

## Installing the CodeAlive Skill

For workflow guidance and multi-step exploration patterns, also install the CodeAlive skill:

```bash theme={null}
npx skills add CodeAlive-AI/codealive-skills@codealive-context-engine
```

Or manually copy the skill to OpenClaw's skills directory:

| Scope   | Path                                           |
| ------- | ---------------------------------------------- |
| Project | `skills/codealive-context-engine/`             |
| User    | `~/.openclaw/skills/codealive-context-engine/` |

The skill and MCP server complement each other: the MCP server provides tool access, the skill teaches the agent effective query patterns and cost-aware workflows.

## Publishing to ClawHub

The CodeAlive Context Engine skill is also available on [ClawHub](https://clawhub.ai/), OpenClaw's skill marketplace:

```bash theme={null}
openclaw skills install codealive-context-engine
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="MCP server not connecting">
    1. Verify your API key is correct
    2. Check that `openclaw.json` is valid JSON5 (watch for syntax errors)
    3. Ensure `"transport": "streamable-http"` is set for the remote option
    4. Check OpenClaw logs for MCP initialization errors
  </Accordion>

  <Accordion title="Tools not appearing">
    1. Confirm the `codealive` entry is inside `agents.main.mcpServers`
    2. Restart OpenClaw if config auto-reload didn't trigger
    3. Verify the API key has not expired
  </Accordion>

  <Accordion title="Docker STDIO not working">
    Ensure Docker is installed and running:

    ```bash theme={null}
    docker pull ghcr.io/codealive-ai/codealive-mcp:main
    ```
  </Accordion>
</AccordionGroup>

<Tip>
  For more solutions, see the [Troubleshooting Guide](/troubleshooting).
</Tip>

## Related Resources

<CardGroup cols={2}>
  <Card title="MCP Overview" icon="plug" href="/integrations/mcp">
    Learn about Model Context Protocol
  </Card>

  <Card title="Skills & Plugins" icon="graduation-cap" href="/integrations/skills">
    Install CodeAlive as an agent skill
  </Card>

  <Card title="OpenClaw Docs" icon="book" href="https://docs.openclaw.ai/">
    Official OpenClaw documentation
  </Card>

  <Card title="ClawHub" icon="store" href="https://clawhub.ai/">
    OpenClaw skill marketplace
  </Card>
</CardGroup>

## Instruct Your Agent

Connecting CodeAlive makes its tools available, but the agent may still default to its built-in search. For reliable results, add a short instruction in the agent's native format telling it to prefer `semantic_search` and `grep_search` when exploring indexed code. See [Instructing Coding Agents](https://docs.codealive.ai/guides/instructing-agents).
