Skip to main content
Docs navigation

Connect a CLI agent

Local AI agents — Claude Desktop, Claude Code, Cursor, Windsurf, Zed, and a dozen CLIs — reach your catalog through the tiny emisar-mcp stdio bridge, authenticated with an emk- API key.

Using Claude.ai or ChatGPT?

Cloud apps connect over OAuth with no key or bridge to manage — see Connect a cloud LLM.

Before you connect

Point your client at an account that already has at least one runner online — otherwise the agent signs in fine but finds an empty catalog with nothing to call. New here? Run the quickstart first (install a runner, run one action), then come back to wire in your client.

Use your coding agent

The connect-llm skill walks your agent through this whole page.

paste into your agent
Connect this machine's coding agent to my emisar account over MCP — install the emisar-mcp bridge, register the client, and prove a run end to end. First ask me which client I use. Use the connect-llm skill: https://raw.githubusercontent.com/AndrewDryga/emisar/main/skills/connect-llm/SKILL.md

Works in Claude Code, Codex, or any agent that reads Markdown skills — read the skill first .

1. Mint an API key#

You rarely mint a key by hand: the installer in step 2 mints one per client it finds, and cloud apps use OAuth with no key at all (Connect a cloud LLM). To do it yourself, open LLM agents in the dashboard, pick your client, and reveal its prefilled snippet — shown once.

There's nothing to configure on the key: it runs under your account policy and its owner's runner scope. Rotation, revocation, and scope are covered in MCP keys.

2. Set up a stdio client#

For clients that only speak stdio MCP — Claude Desktop, Claude Code, Cursor (local mode), Windsurf, Zed, OpenClaw, OpenCode, Pi, Copilot CLI, Gemini CLI, Codex CLI, Goose, Hermes, Grok CLI — install the tiny emisar-mcp binary. It's a thin shim that forwards stdio JSON-RPC frames to the same /api/mcp/rpc endpoint. Every MCP semantic — tool descriptors, content blocks, wait_for_run — is implemented in the portal, so MCP spec updates land server-side — you only redownload the bridge when the portal raises its minimum supported version.

Install#

One-liner — auto-resolves the latest mcp-v* release, verifies sha256, drops emisar-mcp into /usr/local/bin:

shell
$ curl -sSL https://emisar.dev/install-mcp.sh | sudo bash

The installer finds your LLM clients and, once you approve in the browser, mints each one a key and writes its config — comments and other servers preserved. The by-hand configs below are just for reference or unattended setups.

Verify this download first

The installer checks the checksum itself; to prove the binary before it runs as sudo, download it and run these first — a green check names our source repository and the release workflow that built it.

shell
# provenance — built by our workflow, from our source
$ gh attestation verify emisar-mcp-<version>-linux-amd64.tar.gz --owner andrewdryga
# checksums — the bytes match what we published
$ sha256sum -c SHA256SUMS-MCP

More on the signing pipeline: Release integrity.

Set up a client by hand

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "emisar": {
      "command": "/usr/local/bin/emisar-mcp",
      "env": {
        "EMISAR_URL": "https://emisar.dev",
        "EMISAR_API_KEY": "emk-...",
        "EMISAR_CLIENT": "claude-desktop"
      }
    }
  }
}

Restart Claude Desktop. Tools appear under the tool icon as "emisar".

Cursor

Same bridge. Cursor reads ~/.cursor/mcp.json:

{
  "mcpServers": {
    "emisar": {
      "command": "/usr/local/bin/emisar-mcp",
      "env": {
        "EMISAR_URL": "https://emisar.dev",
        "EMISAR_API_KEY": "emk-...",
        "EMISAR_CLIENT": "cursor"
      }
    }
  }
}

Recent Cursor builds also speak remote MCP — point them at /api/mcp/rpc directly (see Connect a cloud LLM) if you'd rather skip the bridge.

Zed

By hand, Zed reads ~/.config/zed/settings.json and nests MCP servers under context_servers, not mcpServers:

{
  "context_servers": {
    "emisar": {
      "source": "custom",
      "command": "/usr/local/bin/emisar-mcp",
      "args": [],
      "env": {
        "EMISAR_URL": "https://emisar.dev",
        "EMISAR_API_KEY": "emk-...",
        "EMISAR_CLIENT": "zed"
      }
    }
  }
}

Claude Code

One-line register, user scope (every project):

terminal
$ claude mcp add emisar --scope user \
    -e EMISAR_URL=https://emisar.dev \
    -e EMISAR_API_KEY=emk-... \
    -e EMISAR_CLIENT=claude-code \
    -- /usr/local/bin/emisar-mcp

Verify with claude mcp list.

Gemini CLI

Add to ~/.gemini/settings.json:

{
  "mcpServers": {
    "emisar": {
      "command": "/usr/local/bin/emisar-mcp",
      "env": {
        "EMISAR_URL": "https://emisar.dev",
        "EMISAR_API_KEY": "emk-...",
        "EMISAR_CLIENT": "gemini"
      }
    }
  }
}

ChatGPT Codex CLI

Add to ~/.codex/config.toml:

[mcp_servers.emisar]
command = "/usr/local/bin/emisar-mcp"
env = { EMISAR_URL = "https://emisar.dev", EMISAR_API_KEY = "emk-...", EMISAR_CLIENT = "codex" }

To let emisar calls run without Codex prompts, add default_tools_approval_mode = "approve" below [mcp_servers.emisar] in ~/.codex/config.toml. This trusts only the emisar MCP server; emisar still applies its own policies and approvals.

Grok CLI

Register the bridge in your user config:

terminal
$ grok mcp add emisar \
    -e EMISAR_URL=https://emisar.dev \
    -e EMISAR_API_KEY=emk-... \
    -e EMISAR_CLIENT=grok \
    -- /usr/local/bin/emisar-mcp

To stop Grok's per-tool prompts for emisar only, add "MCPTool(emisar__*)" to [permission].allow in ~/.grok/config.toml.

Targeting a signed-dispatch runner? If a runner enforces signed dispatch, add EMISAR_SIGNING_KEY and EMISAR_SIGNING_CERT (printed by emisar signing init) to the same env block — the bridge signs every action dispatch so an enforcing runner will run it. Keep both secret, never on the portal. The cloud connectors — Claude.ai and ChatGPT — sign nothing, so they can't reach an enforcing runner.

What the sign-in grants#

Whether the installer minted it after your browser approval or you pasted one by hand, the key is bound to your membership — the agent acts as you. Every call is attributed to you and the agent you're using, and it reaches only the runners and actions your own access already allows (how a key inherits its operator's scope). Revoke it any time from LLM agents in the dashboard.

Point your agent at real infrastructure — safely.

Set up a runner first, then connect Claude Code, Cursor, or any MCP client to your account's endpoint and let policy decide what runs.

Three runners. Seven-day audit. No credit card.