Kera
<div align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="assets/logos/kera-logo-dark.svg" />
<source media="(prefers-color-scheme: light)" srcset="assets/logos/kera-logo-light.svg" />
<img alt="Kera — Local Webhook & Network Antenna for AI Coding Agents" src="assets/logos/kera-logo-dark.svg" width="320" />
</picture>
<h3>Your local webhook and network antenna for AI coding agents.</h3>
<p>Capture, inspect, redact, and replay local HTTP traffic over MCP — without leaving your editor.</p>
<p>
<a href="https://www.npmjs.com/package/kera-mcp"><img src="https://img.shields.io/npm/v/kera-mcp?color=10B981&label=npm" alt="npm version" /></a>
<a href="https://github.com/mcdavidobioha/kera/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/mcdavidobioha/kera/ci.yml?label=CI&color=10B981" alt="CI status" /></a>
<a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D20-10B981" alt="Node.js >= 20" /></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-10B981" alt="MIT License" /></a>
</p>
</div>
---
## Why Kera?
When you build webhook handlers (Stripe, GitHub, Clerk, Shopify) with AI coding assistants like **Claude Code**, **Cursor**, or **Windsurf**, the debugging loop breaks down:
1. An external webhook or test request hits your local server and fails with a `500`.
2. Your AI agent cannot see the incoming HTTP headers, raw payload, or exact response.
3. You waste time manually re-triggering events or copy-pasting massive `curl` commands to test a fix.
**Kera closes that loop locally.** It sits transparently in front of your dev server, captures raw request/response bytes in SQLite, redacts secrets automatically, and gives your AI agent tools to inspect failures and replay requests after patching your code.
```text
External Webhook / HTTP Client
│
▼
Kera Listener (127.0.0.1:4000) ──────▶ Your Local App (localhost:3000)
│
▼
Local SQLite Store (~/.kera/)
│
▼
AI Coding Agent (MCP Tools: list, inspect, replay, diff, clear)
```
---
## Quickstart
**Phase 1 is complete.** Kera provides [local capture](docs/ARCHITECTURE.md#reverse-proxy-and-capture),
[provider detection](docs/PROVIDERS.md), [redacted inspection](docs/ARCHITECTURE.md#core-services),
and [bounded replay and JSON diffs](docs/ARCHITECTURE.md#replay-and-payload-diffs) over MCP `stdio`.
Build the server from a checkout using Node.js 20 or newer:
```bash
pnpm install --frozen-lockfile
pnpm run build
```
Replace `/absolute/path/to/kera` with your checkout path and point `--target` at your local app.
To launch the npm release instead, run `npx -y kera-mcp --target http://127.0.0.1:3000` from outside
this repository; inside the checkout npm resolves the local package and the command fails.
Choose your MCP client: [Claude Code](#claude-code) · [Cursor](#cursor-cursormcpjson) · [Windsurf](#windsurf-cascades-open-mcp-config-file) · [Claude Desktop](#claude-desktop-claude_desktop_configjson).
### Claude Code
Install the Kera plugin from inside Claude Code (v2.1.275 or later):
```text
/plugin install kera --marketplace mcdavidobioha/kera
```
The plugin launches `npx -y kera-mcp`. It defaults to `http://localhost:3000`; set
`KERA_TARGET_URL` before starting Claude Code to use a different target. Use `/mcp` to check
the connection and `/kera:webhook-debugging` to load the debugging skill.
To connect from a local build instead:
```bash
claude mcp add --transport stdio kera -- node /absolute/path/to/kera/dist/index.js --target http://127.0.0.1:3000
```
### Cursor (`.cursor/mcp.json`)
```json
{
"mcpServers": {
"kera": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/kera/dist/index.js", "--target", "http://127.0.0.1:3000"]
}
}
}
```
### Windsurf (Cascade's **Open MCP config file**)
```json
{
"mcpServers": {
"kera": {
"command": "node",
"args": ["/absolute/path/to/kera/dist/index.js", "--target", "http://127.0.0.1:3000"]
}
}
}
```
### Claude Desktop (`claude_desktop_config.json`)
```json
{
"mcpServers": {
"kera": {
"command": "node",
"args": ["/absolute/path/to/kera/dist/index.js", "--target", "http://127.0.0.1:3000"]
}
}
}
```
Once connected, send webhooks or test HTTP requests to **`http://127.0.0.1:4000`** instead of port `3000`. Kera forwards requests to your app and records the exchange. For Cline and more client details, see [MCP setup](docs/MCP_SETUP.md).
### Receive external webhooks with `--tunnel`
Install [cloudflared](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/)
on the MCP client's `PATH`. Add `--tunnel` to the server's arguments; for example, to register a
tunneled local build in Claude Code:
```bash
claude mcp add --transport stdio kera -- node /absolute/path/to/kera/dist/index.js --target http://127.0.0.1:3000 --tunnel
```
With the plugin, set `KERA_TUNNEL=true` in the environment that starts Claude Code instead.
The published `kera-mcp@0.2.0` package does not support tunnels. Use the local build command
above until an npm release includes Milestone 7. Call `get_tunnel_url` and append your webhook
path to the returned `https://…trycloudflare.com` URL.
A Quick Tunnel needs no Cloudflare account, exposes every route served
through Kera, and gets a new URL each time it starts. Keep application authentication or
signature verification enabled and stop the MCP server when done. See
[Public tunnels](docs/SECURITY.md#public-tunnels).
---
## Example Agent Workflow
Ask your AI coding assistant:
> _"Check the last failed webhook in Kera, find out why it returned 500, fix my route handler, and replay the request to verify."_
Your agent uses Kera's MCP tools in sequence:
1. **`list_requests`** (`{"status":500,"provider":"stripe"}`) — Finds the failed `POST /webhooks/stripe` capture and its event type and ID.
2. **`inspect_request`** — Uses that ID to review redacted headers, compressed request and response bodies, and any proxy error. Uses local app logs and code to diagnose the `500`.
3. **Code fix** — Patches the bug in the handler.
4. **`replay_request`** — After approval if there may be external side effects, uses the original ID and omits body overrides. Checks the upstream `responseStatus`, then inspects the replay ID to verify the outcome.
---
## Available MCP Tools
| Tool | Parameters | Description |
| :-------------------- | :------------------------------------------------- | :------------------------------------------------------------------------------------------------------- |
| **`list_requests`** | `limit?`, `status?`, `provider?`, `path_contains?` | Lists compact summaries. Filter by a [provider name](docs/PROVIDERS.md), such as `stripe` or `paystack`. |
| **`inspect_request`** | `id`, `raw?` | Returns headers, payload, status, and timing for one exchange (redacted & compressed by default). |
| **`replay_request`** | `id`, `override_body?`, `override_headers?` | Replays once to the configured target and warns if the signed body changes without re-signing. |
| **`diff_payloads`** | `id_a`, `id_b` | Compares two captured JSON request bodies and masks sensitive fields. |
| **`clear_traffic`** | `older_than_minutes?`, `confirm?` | Previews the scope and deletes captures only with `confirm: true`. |
| **`get_tunnel_url`** | — | Returns the active public HTTPS URL or tells you how to enable or troubleshoot the tunnel. |
`override_body` accepts UTF-8 text or `null` to remove the body; `override_headers` maps names
to strings or arrays of strings. A capture with a truncated body requires an override.
Omit `older_than_minutes` to preview all stored traffic.
`clear_traffic` reports the requested scope even if a confirmed deletion fails.
`inspect_request` with `raw: true` shows more detail within a byte limit. By default, it still
redacts sensitive values and re-serializes JSON for display without changing the capture in SQLite.
Replays never follow redirects. `diff_payloads` requires complete UTF-8 JSON bodies with no
content encoding other than `identity` and masks recognized credential and signature fields.
---
## Configuration & CLI Flags
| Flag | Environment Variable | Default | Description |
| :--------------------- | :------------------------- | :----------- | :----------------------------------------------------------------------------- |
| `--target <url>` | `KERA_TARGET_URL` | _(Required)_ | Upstream local application URL (e.g., `http://localhost:3000`). |
| `--port <number>` | `KERA_LISTEN_PORT` | `4000` | Local port Kera listens on. |
| `--host <addr>` | `KERA_LISTEN_HOST` | `127.0.0.1` | Local bind address (localhost-only by default). |
| `--tunnel` | `KERA_TUNNEL` | `false` | Opt in to a public Quick Tunnel. Requires `cloudflared` and `127.0.0.1`. |
| `--data-dir <path>` | `KERA_DATA_DIR` | `~/.kera` | Directory for local SQLite storage (`traffic.db`). |
| `--max-requests <n>` | `KERA_MAX_STORED_REQUESTS` | `1000` | Maximum retained captures, including failures. |
| `--max-body-bytes <n>` | `KERA_MAX_BODY_BYTES` | `1048576` | Per-body capture limit in bytes (`1 MiB`). |
| `--log-level <lvl>` | `KERA_LOG_LEVEL` | `info` | `info` and `debug` show readiness on `stderr`; `warn` and `error` suppress it. |
| — | `KERA_REDACTION_POLICY` | `redact` | Set `allow-unredacted-raw` only if raw inspection may expose sensitive data. |
Flags take precedence over environment variables. See [Configuration](docs/CONFIGURATION.md)
for accepted values and storage permissions.
---
## Security & Privacy by Default
- **Local-First Storage:** Captures are stored locally in `~/.kera/traffic.db` by default (`0600` permissions on POSIX). The proxy sends traffic to your configured target.
- **Automatic Secret Redaction:** Default inspection masks credential headers, webhook signatures, and recognized sensitive query and body fields.
- **SSRF & Loop Guards:** Replays are strictly restricted to your configured target URL. Kera rejects requests with `x-kera-hop` before accepting their bodies.
- **Protocol-Clean `stdio`:** All diagnostic logs write exclusively to `stderr` so MCP JSON-RPC messages on `stdout` are never corrupted.
- **Opt-In Public Exposure:** Quick Tunnels are off by default. Enabling one sends public HTTPS requests through Cloudflare to the loopback proxy.
Read [docs/SECURITY.md](docs/SECURITY.md) for the full threat model and responsible-use guidelines.
---
## Ecosystem Roadmap
Kera is built around a single decoupled core engine (`src/core/`) powering three progressive interfaces:
- **Phase 1 — `kera-mcp` on npm (Complete):** Local MCP stdio server for AI coding agents.
- **Phase 1.5 — Tunnels and Claude Code plugin:** Opt-in Cloudflare Quick Tunnels and a Claude Code marketplace plugin.
- **Phase 2 — `kera` CLI (Planned):** Standalone terminal listener (`kera listen 3000`) and live TUI stream.
- **Phase 3 — Kera Dashboard (Planned):** Local browser UI (`localhost:4040`) for visual request inspection, JSON diffing, and one-click replay.
See [docs/ROADMAP.md](docs/ROADMAP.md) for detailed milestone tracking.
---
## Documentation
| Guide | Description |
| :----------------------------------------------------- | :--------------------------------------------------------------- |
| [docs/DESIGN.md](docs/DESIGN.md) | Engineering design, product phases, and technical specifications |
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | Module boundaries, request lifecycle, and SQLite schema |
| [docs/MCP_SETUP.md](docs/MCP_SETUP.md) | Detailed setup instructions for supported MCP clients |
| [docs/CONFIGURATION.md](docs/CONFIGURATION.md) | Flags, environment variables, storage paths, and limits |
| [docs/PROVIDERS.md](docs/PROVIDERS.md) | Eight webhook providers, replay warnings, and extension guide |
| [docs/SECURITY.md](docs/SECURITY.md) | Redaction policy, SSRF protections, and local data handling |
| [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) | Local development setup, testing, and npm publishing workflow |
| [docs/GITHUB_PUBLISHING.md](docs/GITHUB_PUBLISHING.md) | GitHub Actions and npm Trusted Publishing |
| [assets/README.md](assets/README.md) | Brand logos, icons, and monorepo asset guidelines |
---
## Contributing & License
Contributions, bug reports, and new webhook provider integrations are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) and [AGENTS.md](AGENTS.md) before submitting a pull request.
`main` is protected. Submit changes from a feature branch for squash merge through a pull request.
Released under the [MIT License](LICENSE).
TDQS
Scored across 6 tools
Each tool targets a distinct action on the capture lifecycle: list summaries, inspect a single capture, replay, diff two bodies, clear storage, and fetch the tunnel URL. There is no meaningful overlap between any pair, and descriptions reinforce the boundaries (e.g. list vs inspect, diff vs replay).
All six tools follow a consistent snake_case verb_noun pattern (inspect_request, list_requests, replay_request, diff_payloads, clear_traffic, get_tunnel_url). Singular/plural noun variation reflects the actual semantics rather than arbitrary inconsistency.
Six tools is well-scoped for a capture/inspection proxy, with each tool earning its place across the list/inspect/replay/diff/clear/tunnel workflow. Nothing feels padded or missing at the count level.
The core lifecycle (list, inspect, replay, diff, clear) plus tunnel URL is covered, with a sensible preview/confirm pattern on destructive deletes. Minor gaps exist: no single-capture delete or export, and filtering/search beyond list summaries is not exposed, but agents can work around these.