# Use MCP

Connect Claude Code, Codex, Cursor, Claude Desktop or any MCP client to a product that has rungent. What to give the client, which tools appear, and how changes are confirmed.

Every product with rungent serves an MCP server at its address followed by `/mcp`, for the cloud
console `https://console.example.com/mcp`. Connect your agent to it, and the agent can look things
up and act in the product as you, with your rights and nothing more.

## What you need

- **The address**: the product's address followed by `/mcp`. The product's `/skill.md` names it too.
- **A way to sign in**: a token the product gives you, sent as `Authorization: Bearer <token>`.
  Create one for your agent alone, so you can revoke it without touching anything else. Some
  products sign you in through their own login page instead (OAuth); then the client opens that
  page, and you need no token.
- **A client that speaks streamable HTTP.** Most do; a client that speaks only stdio connects
  through a bridge such as `mcp-remote`.

Keep the token in an environment variable, `CONSOLE_TOKEN` below, rather than in a file you share.

## Connect your client

```bash
# Claude Code
claude mcp add --transport http console https://console.example.com/mcp \
  --header "Authorization: Bearer $CONSOLE_TOKEN"

# Codex
codex mcp add console --url https://console.example.com/mcp --bearer-token-env-var CONSOLE_TOKEN
```

```jsonc
// Cursor: .cursor/mcp.json
{ "mcpServers": { "console": { "url": "https://console.example.com/mcp",
  "headers": { "Authorization": "Bearer ${env:CONSOLE_TOKEN}" } } } }
```

```jsonc
// Claude Desktop, and other stdio-only clients, through mcp-remote
{ "mcpServers": { "console": { "command": "npx",
  "args": ["mcp-remote", "https://console.example.com/mcp", "--header", "Authorization:${CONSOLE_AUTH}"],
  "env": { "CONSOLE_AUTH": "Bearer <your token>" } } } }
```

Any other client takes the same three settings: streamable HTTP, the address, and the
`Authorization` header. When the product signs you in with OAuth, leave the header out; the client
opens the product's login page the first time it connects.

## What tools appear

Your agent gets one tool for each thing the product offers over MCP that you may do, plus
`search`, which searches everything you can see, the product's docs included. Someone with other
rights sees other tools. Each tool says whether it only reads, changes or deletes something, so a
client can treat them differently, and the product's own guide reaches the agent as its
instructions.

Many products offer only lookups over MCP and leave changes to the assistant and the CLI. When a
change you can make in the product is missing from the tools, use [the CLI](use-the-cli.md), or
ask the product's team to offer it over MCP.

## Confirm changes

A tool that changes something asks you first: the client shows the same title, target and
changes the product's assistant would, and runs nothing until you accept. Declining answers the
agent `declined`: "The user declined this change, so it did not run."

A client that cannot ask you (MCP calls it elicitation) gets `not_executed` for every change, and
nothing runs; use a client that can, the product's assistant, or the CLI. A change the product
finishes later answers "The host is completing this in the background."

## When it does not work

| You see | What to do |
|---|---|
| `401` on connect | The token is missing or refused. Check that the variable is set where the client starts, and that the token is still valid. |
| A tool you expected is missing | You may not use it in the product, or the product does not offer it over MCP. |
| `not_executed`, "cannot ask for (elicitation)" | Your client cannot confirm a change. Use one that can, the assistant, or the CLI. |
| `404 session_not_found` | The connection was idle for 10 minutes, or the token changed. Reconnect; most clients do it on their own. |
| The OAuth login never opens | Tell the product's team: its server does not announce its login. Use a token meanwhile. |

## Where to go next

[Use with coding agents](use-with-agents.md) gives an agent the product's skill, so it knows the
tools before it calls them.
