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

# Connect to OpenClaw

> Step-by-step guide to connect your Shuriken Agent Key to OpenClaw.

This guide gets your OpenClaw agent connected to Shuriken in about 2 minutes. Once set up, your agent can monitor your alpha groups, research tokens, check your portfolio, and execute trades  - all through WhatsApp, Telegram, Discord, or the built-in Control UI.

**Time required:** About 2 minutes.

## Prerequisites

* [OpenClaw](https://openclaw.ai) installed and running (`openclaw gateway status` should show it's active)
* A Shuriken Agent Key ([create one here](/agent-kit/create-agent-key) if you haven't already)

## Step-by-step setup

<Steps>
  <Step title="Copy your Agent Key">
    If you just created your key, copy it from the setup screen. It starts with `sk_`.

    If you already closed that screen, you'll need to [create a new key](/agent-kit/create-agent-key) - keys are only shown once.
  </Step>

  <Step title="Open the config file">
    OpenClaw stores its config in a JSON5 file called `openclaw.json`.

    **Option A: Use the CLI (recommended)**

    ```bash theme={null}
    openclaw configure
    ```

    **Option B: Use the Control UI**

    Open [http://127.0.0.1:18789](http://127.0.0.1:18789) in your browser and go to the **Config** tab.

    **Option C: Edit the file directly**

    <Tabs>
      <Tab title="Windows">
        ```
        %USERPROFILE%\.openclaw\openclaw.json
        ```
      </Tab>

      <Tab title="macOS / Linux">
        ```
        ~/.openclaw/openclaw.json
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Add the Shuriken MCP server">
    Add the following `mcpServers` block to your `openclaw.json`. Replace `YOUR_AGENT_KEY` with the key you copied in step 1.

    **If you don't have any MCP servers yet**, add this to your config:

    ```json5 openclaw.json theme={null}
    {
      // ...your existing config...
      mcpServers: {
        Shuriken: {
          url: "https://api.shuriken.trade/mcp",
          headers: {
            Authorization: "AgentKey YOUR_AGENT_KEY"
          }
        }
      }
    }
    ```

    **If you already have MCP servers**, add the `shuriken` block inside the existing `mcpServers` object:

    ```json5 openclaw.json theme={null}
    {
      mcpServers: {
        "your-existing-server": {
          // ...
        },
        Shuriken: {
          url: "https://api.shuriken.trade/mcp",
          headers: {
            Authorization: "AgentKey YOUR_AGENT_KEY"
          }
        }
      }
    }
    ```

    <Note>
      OpenClaw uses JSON5 format, so you don't need to quote keys or worry about trailing commas. But standard JSON also works.
    </Note>
  </Step>

  <Step title="Save and reload">
    OpenClaw watches the config file and applies changes automatically - no restart needed in most cases.

    If the tools don't appear, restart the gateway:

    ```bash theme={null}
    openclaw gateway restart
    ```
  </Step>

  <Step title="Verify the connection">
    Open the Control UI at [http://127.0.0.1:18789](http://127.0.0.1:18789) or message your agent through any connected channel (WhatsApp, Telegram, Discord, etc.) and try:

    ```
    What tokens were called in my Discord today?
    ```

    ```
    What's my SOL balance?
    ```

    <Check>
      If you see results from Shuriken, you're all set. Your OpenClaw agent is now connected.
    </Check>
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Config validation error on startup">
    OpenClaw strictly validates its config. If the gateway won't start after your changes:

    ```bash theme={null}
    openclaw doctor --fix
    ```

    This will diagnose and suggest repairs. Common issues: unknown keys, malformed types, or invalid JSON5 syntax.
  </Accordion>

  <Accordion title="Tools not appearing">
    * Make sure the `mcpServers` block is at the root level of your config (not nested inside another section)
    * Check that your Agent Key is correct (starts with `sk_`)
    * Make sure you included the `AgentKey ` prefix before the key (with a space)
    * Try restarting the gateway: `openclaw gateway restart`
  </Accordion>

  <Accordion title="Tools show up but return errors">
    * Double-check your Agent Key hasn't been revoked on the [Agent Keys dashboard](https://app.shuriken.trade/agents)
    * Make sure the key has the permissions needed for the tool you're trying to use (see [Permissions](/agent-kit/permissions))
  </Accordion>
</AccordionGroup>
