Skip to content

Quickstart and MCP Setup

Mcdavid Obioha edited this page Dec 1, 2026 · 5 revisions

Quickstart and MCP Setup

Kera runs as a local MCP stdio process. Your MCP client launches Kera, Kera opens an HTTP listener on 127.0.0.1:4000, and every request sent to that listener is forwarded to your app and captured.

For a terminal-only workflow, see Terminal CLI. To inspect captured traffic in a browser, see Local Dashboard. Tunneling for external webhook delivery is opt-in.


Prerequisites

  • Node.js 20 or newer (Node 22 recommended; CI tests Node 20 and 22).
  • pnpm 10 if building from a checkout. The exact version is pinned in package.json.
  • Your local application running on a known URL, for example http://127.0.0.1:3000.
  • An MCP-capable client: Claude Code, Cursor, Windsurf, Claude Desktop, or Cline.

Option A β€” use the npm release (no checkout)

npx -y kera-mcp --target http://127.0.0.1:3000

kera-mcp@0.3.0 and later on npm include get_tunnel_url and --tunnel. Call tools/list to confirm the tool is present in your client.

Option B β€” use the umbrella CLI

npm install -g kera-terminal
kera mcp --target http://127.0.0.1:3000

With kera-terminal@0.4.0, use "command": "kera" and "args": ["mcp", "--target", "http://127.0.0.1:3000"] in any client configuration below.

Kera must be started once per capture port. Do not configure two Kera instances with the same --port.


Directory & Registry Listings

Install from npm for kera-mcp@1.1.0 and its eight tools. Directory listings can lag behind npm:

Listing Where Notes
Glama https://glama.ai/mcp/servers/mcdavidobioha/kera Hosted listing with tool schemas and online inspector
Official MCP Registry io.github.mcdavidobioha/kera Currently lists kera-mcp@0.3.0
npm https://www.npmjs.com/package/kera-mcp Current release used by npx -y kera-mcp

Claude Code

Plugin install

On Claude Code v2.1.275 or later:

/plugin install kera --marketplace mcdavidobioha/kera

The plugin bundles the MCP server definition and the webhook debugging skill.

  • Use /mcp to check the connection.
  • Use /kera:webhook-debugging to load the debugging skill.
  • The plugin runs npx -y kera-mcp.
  • Default target: http://localhost:3000. Set KERA_TARGET_URL in the environment that launches Claude Code to change it.
  • Tunnel default: KERA_TUNNEL=false. Set KERA_TUNNEL=true before starting Claude Code to enable the Quick Tunnel.

Recommended: claude mcp add

claude mcp add --transport stdio kera -- \
  npx -y kera-mcp --target http://127.0.0.1:3000

With the tunnel:

claude mcp add --transport stdio kera -- \
  npx -y kera-mcp --target http://127.0.0.1:3000 --tunnel

Use /mcp inside Claude Code to confirm the server is connected.

Project .mcp.json

{
  "mcpServers": {
    "kera": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "kera-mcp", "--target", "http://127.0.0.1:3000"]
    }
  }
}

Cursor

Add the entry to .cursor/mcp.json for the project or ~/.cursor/mcp.json for your user.

{
  "mcpServers": {
    "kera": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "kera-mcp"],
      "env": {
        "KERA_TARGET_URL": "http://127.0.0.1:3000",
        "KERA_LISTEN_PORT": "4000",
        "KERA_TUNNEL": "false"
      }
    }
  }
}

Use args flags instead of env if you prefer:

{
  "mcpServers": {
    "kera": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "kera-mcp", "--target", "http://127.0.0.1:3000"]
    }
  }
}

Set KERA_TUNNEL to "true" to enable the tunnel. KERA_TUNNEL accepts only true or false.


Windsurf

In Cascade's MCP menu, choose Open MCP config file and add the entry to mcp_config.json. Refresh the MCP server list afterward.

{
  "mcpServers": {
    "kera": {
      "command": "npx",
      "args": ["-y", "kera-mcp", "--target", "http://127.0.0.1:3000"]
    }
  }
}

Claude Desktop

Edit claude_desktop_config.json:

{
  "mcpServers": {
    "kera": {
      "command": "npx",
      "args": ["-y", "kera-mcp", "--target", "http://127.0.0.1:3000"]
    }
  }
}

Restart Claude Desktop after saving.


Cline

Open MCP Servers β†’ Configure β†’ Configure MCP Servers and add the entry to cline_mcp_settings.json.

{
  "mcpServers": {
    "kera": {
      "command": "npx",
      "args": ["-y", "kera-mcp", "--target", "http://127.0.0.1:3000"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

autoApprove is intentionally empty. Replay and clear operations can have real side effects and should require approval.


Receive external webhooks with --tunnel

1. Enable tunnel mode

Add --tunnel to Kera's arguments:

npx -y kera-mcp --target http://127.0.0.1:3000 --tunnel

Or set the environment variable in the MCP client config:

{
  "mcpServers": {
    "kera": {
      "command": "npx",
      "args": ["-y", "kera-mcp"],
      "env": {
        "KERA_TARGET_URL": "http://127.0.0.1:3000",
        "KERA_TUNNEL": "true"
      }
    }
  }
}

Tunnel mode requires the listener to stay on the literal address 127.0.0.1. Kera rejects --host localhost, ::1, 0.0.0.0, or any other interface when --tunnel is enabled.

Current npm releases can download and cache cloudflared automatically when you enable tunneling. See Configuration and Flags for binary setup and overrides.

2. Ask the agent for the URL

Call get_tunnel_url and give me the public URL.

When active, the tool returns:

{
  "ok": true,
  "enabled": true,
  "url": "https://random-words.trycloudflare.com",
  "provider": "cloudflared",
  "targetUrl": "http://127.0.0.1:3000"
}

Append your webhook path, for example:

https://random-words.trycloudflare.com/webhooks/stripe

3. Understand the lifecycle

  • Edge startup can take up to 30 seconds after the executable is ready. get_tunnel_url returns enabled: false with a "starting" message until the URL is assigned and the first edge connection is registered.
  • The public URL is random and changes every session.
  • If cloudflared is missing or offline, local capture and all other MCP tools keep working. get_tunnel_url reports the failure with a safe, actionable message.
  • On shutdown, Kera sends SIGTERM, waits 2 seconds, then uses SIGKILL if needed.
  • The tunnel is public and unauthenticated. Read Security and Privacy before enabling it.

How traffic reaches your agent

External Webhook  ──▢  Tunnel  ──▢  127.0.0.1:4000  ──▢  Local App & SQLite  ──▢  stdio MCP  ──▢  Agent
                        optional,
                        --tunnel

Expanded view:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ External webhook β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚  HTTPS
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Cloudflare Quick Tunnel          β”‚  ← only with --tunnel
β”‚ https://…trycloudflare.com       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚  forwards to loopback
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Kera listener                    β”‚
β”‚ 127.0.0.1:4000                   β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚ forward         β”‚ capture
       β–Ό                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Local App    β”‚  β”‚ ~/.kera/traffic.db      β”‚
β”‚ :3000        β”‚  β”‚ raw bytes + metadata    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β”‚ Kera MCP server (stdio) β”‚
                  β”‚ kera / kera-mcp         β”‚
                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚ JSON-RPC
                              β–Ό
                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β”‚ AI coding agent         β”‚
                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Steps:

  1. A provider sends an HTTPS request to the Quick Tunnel URL (or a local client sends directly to 127.0.0.1:4000).
  2. The tunnel forwards the request to Kera's loopback listener.
  3. Kera forwards it to the configured target (for example 127.0.0.1:3000).
  4. Kera stores the request and response, preserving raw request bytes and multi-value headers.
  5. The agent calls MCP tools over stdin/stdout; Kera returns redacted, bounded results.
  6. After a code fix, the agent calls replay_request to send the saved request again.

Verify the connection

  1. Start your app.
  2. Start or reconnect the MCP client.
  3. Send a request to http://127.0.0.1:4000, not directly to your app.
  4. Ask the agent to call list_requests.
  5. Pass a returned id to inspect_request.
  6. If tunneling is enabled, call get_tunnel_url and send a request to the returned URL.

Example prompt:

"Call list_requests with {"limit": 5} and tell me what Kera captured."

Expected result: a list containing the request's method, path, status, provider label, and timing.


Troubleshooting

Symptom Cause / fix
EADDRINUSE on startup Another process owns the port. Stop it or choose another --port.
Kera's target points to its own listener --target resolves to Kera's own host/port. Change the target or listen port.
Tunnel cannot find or download cloudflared Check Configuration and Flags for binary setup for your Kera version.
Tunnel says it is starting Wait and call get_tunnel_url again; a first-use download can add to the edge startup time.
Tunnel failed / offline Local capture still works. Check internet access and Cloudflare connectivity, then restart.
Tunnel rejected listenHost Use the literal 127.0.0.1; other bind addresses are not allowed with tunneling.
No captures appear Traffic was sent to your app's port instead of Kera's 4000, or the client never started Kera.
MCP client cannot connect Check the client's MCP logs. Startup diagnostics go to stderr, never stdout.
Permission error for ~/.kera The data directory must be private (0700 on POSIX). Fix permissions or use --data-dir.
Agent sees [REDACTED] Expected. Redaction is on by default. See Security and Privacy.

More configuration detail: Configuration and Flags. Exact tool contracts: MCP Tools Reference.

Clone this wiki locally