# Setup Kerno MCP

This guide explains how to attach **Cursor** or **Claude Code** to Kerno’s local MCP endpoint after the **Kerno IDE extension** has started the Kerno agent for your project.

### What you get

Your assistant can use Kerno’s MCP tools from the IDE—for example workspace checks, listing applications and endpoints, starting environments, capturing baselines, and running validation—without leaving your editor.

### Prerequisites

* Kerno IDE extension installed and your repository open in the IDE.
* The local Kerno agent is running for that workspace (wait until Kerno has finished its usual startup for the project).
* MCP is exposed by default on **port 8086** at:

  **`http://127.0.0.1:8086/mcp`**

  Use this address only on the **same computer** where the IDE and agent run.

### Important details

* **Workspace path:** When a tool asks for a workspace path, use the **absolute path** of the project folder Kerno is using. Paths that do not match that project are rejected.
* **Long operations:** Some tools start work in the background and return a **job id** quickly. Use the job tools Kerno exposes to check status or logs; avoid asking the model to poll every few seconds. Very long steps (for example environment builds) can take many minutes.

### Cursor

1. Open Cursor’s MCP configuration (from **Settings**, or the MCP section documented in [Cursor’s MCP help](https://cursor.com/docs/context/mcp)).
2. Add a server that points at Kerno’s endpoint.

Example:

```json
{
  "mcpServers": {
    "kerno": {
      "url": "http://127.0.0.1:8086/mcp"
    }
  }
}
```

3. Save the configuration. If Kerno tools do not show up, reload MCP or restart Cursor.

Tool names in the UI may be prefixed by Cursor; they still correspond to Kerno’s tools.

### Claude Code

Use the HTTP transport so Claude Code talks to the same local URL.

**Project scope** (configuration can live with the repository):

```bash
claude mcp add --transport http kerno --scope project http://127.0.0.1:8086/mcp
```

**Local scope** (for the current machine only):

```bash
claude mcp add --transport http kerno --scope local http://127.0.0.1:8086/mcp
```

If you edit JSON instead of using the CLI, use the same URL and the HTTP type your Claude Code version expects—for example:

```json
{
  "mcpServers": {
    "kerno": {
      "type": "http",
      "url": "http://127.0.0.1:8086/mcp"
    }
  }
}
```

See [Connect Claude Code to tools via MCP](https://docs.claude.com/en/docs/claude-code/mcp.md) for scopes, headers, and troubleshooting.

Restart or reopen Claude Code in the project if the server does not appear.

### If the connection fails

* Confirm the Kerno extension has started and your project is the active workspace.
* Confirm nothing else is blocking **localhost** access on port **8086**.
* Confirm the URL is exactly **`http://127.0.0.1:8086/mcp`** (including `/mcp`).
* If your team uses a **custom MCP port**, replace **8086** with the value shown in Kerno’s settings or status in the IDE.

### Further reading

* [Kerno documentation](https://kerno.gitbook.io/docs)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kerno.gitbook.io/docs/user-manual/setup-kerno-mcp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
