Wirehook is a webhook gateway for agentic systems: it ingests, verifies, stores, and routes webhooks across trust boundaries with an MCP-first admin interface.
Note: Use simple English in this project (docs, comments, messages).
- Webhook ingestion:
POST /in/:endpoint_id - Event storage in SQLite
- Routing to destinations
- Cron schedules sending JSON payloads to destinations
- MCP admin tools (HTTP/SSE)
- CLI for admin tasks
Wirehook follows a light hexagonal architecture:
src/domain: business models and typessrc/app: use cases and ports (traits)src/infrastructure: SQLite repositories, forwarders, mapperssrc/adapters: HTTP server and MCP transport
- Run the server:
cargo run -- serve
- Create an endpoint:
cargo run -- endpoint create --name "jira" --description "Jira automation" --method POST --auth-type none
- Create a destination:
cargo run -- destination create --name "internal" --type http --config-json '{"url":"http://internal"}'
- Create a route:
cargo run -- route create --endpoint-id <ENDPOINT_ID> --destination-id <DESTINATION_ID> --priority 10
- Send a webhook:
curl -X POST http://127.0.0.1:3000/in/<ENDPOINT_ID> \
-H 'content-type: application/json' \
-d '{"status":"ok"}'
POST /in/:endpoint_id: ingest webhook (JSON body)POST /test: returns 200 OKGET /mcp/sse: MCP SSE endpoint (admin only)POST /mcp/messages/{session_id}: MCP messages (admin only)
See docs/cli.md.
See docs/mcp.md.
Build and run with Compose (includes Vault):
docker compose up --build
Auto rebuild on code changes:
docker compose watch
- Versioning follows SemVer with tags like
v1.2.3. - CI builds and publishes Docker images to GHCR on release tags.
- See
RELEASING.mdfor details.
- MCP endpoints require
Authorization: Bearer <ADMIN_TOKEN>. - Set the admin token with
WIREHOOK_ADMIN_TOKEN(or--admin-token). - For production, use TLS and secure Vault configuration.
- HMAC signatures: set endpoint
auth_typetohmac_sha256and sendX-Wirehook-Signature: sha256=<hex>. - For HMAC endpoints you must set
secret_id(create a secret first). - Signature headers and base string are configurable via
signature set.
- SQLite is the default (file
wirehook.db). - To use Postgres, set
WIREHOOK_DATABASE_URLorDATABASE_URL. - When the Postgres env var is set, the
--dbpath is ignored.
By default Wirehook uses a local SQLite file.
WIREHOOK_DATABASE_URL is not set
wirehook.db is created next to the binary
Override the file path with:
cargo run -- --db /path/to/wirehook.db serve
Set one of the env vars below:
export WIREHOOK_DATABASE_URL=postgres://user:<DB_PASSWORD>@host:5432/dbname
# or
export DATABASE_URL=postgres://user:<DB_PASSWORD>@host:5432/dbname
When set, Wirehook uses Postgres and ignores --db.
Wirehook logs JSON lines (Datadog-friendly). Configure with env vars:
WIREHOOK_LOG_LEVEL(default:info)WIREHOOK_LOG_SERVICE(default:wirehook)WIREHOOK_LOG_ENV(optional)WIREHOOK_LOG_VERSION(optional)WIREHOOK_LOG_DDTAGS(optional, comma-separated)
Each HTTP request logs request_id, method, path, status, and latency_ms.
WIREHOOK_BODY_LIMIT_BYTES(default: 1048576, set 0 to disable)WIREHOOK_SCHEDULE_TICK_SECONDS(default: 30, set 0 to disable the scheduler loop)
cargo test
Wirehook is licensed under either of:
- Apache License, Version 2.0
- MIT License
You may choose either license. See LICENSE-APACHE and LICENSE-MIT.