Errors MCP server
On this page
Dokwe exposes its error surface as a Model Context Protocol server so external MCP-aware IDEs — Claude Code, Cursor, and any other client that speaks MCP — can list, investigate, and act on error events without scripting against the REST API.
1. When to use this#
If you want your local Claude Code (or another MCP client) to see new errors, dig into stacks, propose fixes, and close issues without you manually copy-pasting from the dashboard, this is the surface.
Everything the MCP server can do is a superset of what the dashboard's Errors tab does — same underlying data, same workflow states, same audit trail.
2. Setup — Claude Code#
# Mint a token in the Dokwe dashboard:
# Errors tab → MCP tokens → Mint
# Copy it now — the plain value is only shown once.
claude mcp add --transport sse dokwe https://dokwe.com/api/mcp/sse \
--header "Authorization: Bearer dkm_abcd1234..."For self-hosted Dokwe, replace dokwe.com with your app.baseDomain.
Verify with claude mcp list — you should see dokwe in the list.
Any subsequent claude session picks it up.
3. Tokens (dkm_…)#
MCP tokens are workspace-scoped — one token sees every project in
the workspace. Distinct from dke_… ingest tokens (project-scoped,
write-only, cannot read errors).
| Property | Value |
|---|---|
| Prefix | dkm_ |
| Format | dkm_ + 32 random bytes hex |
| Storage | SHA-256 hash only; plain shown once at mint |
| Scope | Whole workspace (read errors + write issues) |
| Revocable | Soft-delete via DELETE /api/mcp/tokens/:id |
4. Transport#
SSE (Server-Sent Events). Two endpoints:
| Endpoint | Purpose |
|---|---|
GET /api/mcp/sse | Establishes the SSE stream. Long-lived. |
POST /api/mcp/messages?sessionId=… | Client → server JSON-RPC requests. |
Both require Authorization: Bearer dkm_…. The sessionId is issued
by the server in the initial SSE handshake — Claude Code handles this
transparently.
Streamable HTTP transport is not enabled in v1 (SSE was chosen because
it's what Claude Code's --transport sse flag ships with).
5. Tools#
list_projects#
List all projects in the workspace.
Args: none.
Returns: [{ id, slug, name, sourceType }, …]
list_errors#
Grouped list of error events for a project, optionally filtered.
| Arg | Type | Notes |
|---|---|---|
projectId | uuid, optional | Either this or projectSlug. |
projectSlug | string, optional | Friendlier for humans. |
sinceHours | number, optional | Default 168 (7 days). Max 720 (30d). |
status | enum, optional | open | ack | resolved | ignored | any (default). |
Returns: { projectId, count, errors: [{fingerprint, message, level, count, environments, firstSeenAt, lastSeenAt, issue}, …] }
get_error#
Full detail for one error group.
| Arg | Type | Notes |
|---|---|---|
projectId | projectSlug | one required | |
fingerprint | string, required | |
withOccurrences | bool, default true | Include recent event rows. |
occurrencesLimit | number, optional | Default 25. Max 500. |
Returns: { projectId, group, occurrences? } — the group carries workflow state (status/assignee/resolvedAt/regression info); occurrences carry stack + context + timestamps.
list_occurrences#
Raw event rows for a fingerprint (no group aggregation). Useful when inspecting how the stack drifts across events.
| Arg | Type |
|---|---|
projectId | projectSlug | one required |
fingerprint | string, required |
limit | number, optional (default 25, max 500) |
resolve_issue ⚠ requires confirmed: true#
Mark an issue as resolved.
| Arg | Type |
|---|---|
projectId | projectSlug | one required |
fingerprint | string, required |
note | string, optional (e.g. PR URL) |
confirmed | true, required |
Returns: { ok: true, issue, note }
ack_issue#
Acknowledge — signal someone is working on it, without resolving. Same
required args as resolve_issue minus confirmed.
ignore_issue#
Won't-fix. New events on ignored issues do NOT auto-reopen the way
regressions on resolved issues do. Args: same shape + optional reason.
assign_issue#
| Arg | Type |
|---|---|
assigneeId | uuid or null |
Assign to a team member (by team_members.id) or null to unassign.
email_summary ⚠ requires confirmed: true — currently stubbed#
| Arg | Type |
|---|---|
to | |
fingerprint | string, required |
prUrl | url, optional |
note | string, optional |
confirmed | true, required |
Returns: { delivered: false, reason: "stub — server-side SMTP not yet wired", requested: {...} }
The tool signature is final; wiring real delivery is a follow-up.
6. Confirmation-gated tools#
resolve_issue and email_summary refuse to run without an explicit
confirmed: true argument. This sits on top of Claude Code's built-in
tool-approval prompt — belt-and-braces so a bug in the client can't
silently trigger destructive-ish operations.
Everything else is trusted to Claude Code's default per-call approval.
7. Example session#
$ claude
> what open errors do we have on staffnet-api right now?
⏵ dokwe.list_errors({ projectSlug: "staffnet-api", status: "open" })
← {
count: 3,
errors: [
{ fingerprint: "95756def", message: "TypeError: cannot read x",
count: 42, level: "error", environments: ["production"],
firstSeenAt: "2h ago", issue: null },
...
]
}
3 open errors. The top one (95756def) has 42 occurrences and started
2 hours ago. Want me to dig into it?
> yes
⏵ dokwe.get_error({ projectSlug: "staffnet-api", fingerprint: "95756def" })
← { group: {...}, occurrences: [ /* 25 recent */ ] }
Looking at the stack, it fails in `handleRequest` at api.ts:42 when
`req.body.user` is undefined. Let me check the code.
⏵ Read(apps/api/src/handlers/user.ts)
[Claude reads the file, sees the missing guard]
I'll add a null check + a test.
⏵ Edit(...) / Bash(pnpm test) / Bash(git commit + push)
[normal Claude Code tools]
Opened PR #234 on the app repo. Want me to mark the dokwe issue
resolved with a link to the PR?
> yes
⏵ dokwe.resolve_issue({
projectSlug: "staffnet-api",
fingerprint: "95756def",
note: "https://github.com/.../pull/234",
confirmed: true,
})
← { ok: true, issue: {...} }8. Limits & known gaps#
- No MCP resource subscription (yet). A running Claude session
polls via
list_errorsrather than getting pushed the events. Real-time push over MCP itself is a planned follow-up. In the meantime, the Desktop Agent WebSocket gives you the same real-time signal via a plain WS + Bearer auth — the samedkm_token authenticates both surfaces. email_summaryis a stub. Returns{ delivered: false, reason: "stub" }. Tool signature is final — the wire will change when server-side SMTP lands.- No prompts / no resources yet. Only tools are registered. Prompt templates ("investigate this error") and resource URIs are natural additions once we see how operators actually use the tools.
- Rate limits. None per-token yet. The tool handlers are cheap DB reads / writes; add limits when we see abuse.
- Streamable HTTP transport. SSE was picked because it's what Claude Code supports today. Streamable HTTP (the newer MCP transport) can be added in parallel without breaking the SSE endpoint.