> For the complete documentation index, see [llms.txt](https://docs.kubchain.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kubchain.com/build-with-ai/kub-docs-mcp.md).

# KUB Docs MCP

Use this MCP server URL for the public KUB Docs:

```
https://docs.kubchain.com/~gitbook/mcp
```

{% hint style="info" %}
Opening the MCP URL in a browser returns an error. Add it to an AI tool or IDE that supports HTTP MCP servers.
{% endhint %}

## Add the server to your tool

{% stepper %}
{% step %}

#### Copy the MCP server URL

Copy `https://docs.kubchain.com/~gitbook/mcp`.
{% endstep %}

{% step %}

#### Add it to your AI tool

Choose your tool below and add the URL as an HTTP MCP server.
{% endstep %}

{% step %}

#### Test the connection

Ask a question from the [Prompt Examples](#prompt-examples) section below. The tool should search KUB Docs and cite its answer.
{% endstep %}
{% endstepper %}

{% tabs %}
{% tab title="Claude" %}
These steps work in Claude on the web and Claude Desktop.

1. Open **Settings** > **Connectors**.
2. Select **Add custom connector**.
3. Paste `https://docs.kubchain.com/~gitbook/mcp`.

If remote connectors are unavailable, your plan may not support them yet.
{% endtab %}

{% tab title="Claude Code" %}
Run the following command:

```shell
claude mcp add --transport http kub-docs https://docs.kubchain.com/~gitbook/mcp
```

{% endtab %}

{% tab title="Cursor" %}
Open **Settings** > **MCP**, then select **Add new MCP server**.

Use `https://docs.kubchain.com/~gitbook/mcp o` or add this to `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "kub-docs": {
      "url": "https://docs.kubchain.com/~gitbook/mcp"
    }
  }
}
```

{% endtab %}

{% tab title="Codex" %}
Add the server from your terminal:

```shell
codex mcp add kub-docs https://docs.kubchain.com/~gitbook/mcp
```

Or add it to `config.toml`:

```toml
[mcp_servers.kub-docs]
url = "https://docs.kubchain.com/~gitbook/mcp"
```

{% endtab %}

{% tab title="VS Code (Copilot)" %}
Open your `mcp.json` file and add:

```json
{
  "servers": {
    "kub-docs": {
      "type": "http",
      "url": "https://docs.kubchain.com/~gitbook/mcp"
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Prompt Examples

After connecting, ask one of these questions:

* `Using the KUB Docs MCP server, how do I add KUB Testnet to MetaMask?`
* `Search KUB Docs for the KUB Mainnet RPC URL and chain ID.`
* `Find the guide for deploying a smart contract on KUB Testnet. Summarize the required setup.`

For agentic tools, use this prompt:

```
Add an MCP server named kub-docs with HTTP transport at https://docs.kubchain.com/~gitbook/mcp. Then list its available tools to verify the connection.
```

## Troubleshooting

If your tool cannot connect:

* Confirm `https://docs.kubchain.com` is reachable.
* Confirm the URL ends with `/~gitbook/mcp`.
* Use `/~gitbook/mcp/auth` only for partially authenticated sites.
* Confirm the tool supports HTTP MCP transport.

{% hint style="warning" %}
Tools that require `stdio` or `SSE` cannot connect to the KUB Docs MCP server.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kubchain.com/build-with-ai/kub-docs-mcp.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
