Docs/Reference/Errors MCP server

Errors MCP server

5 min read
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#

bash
# 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).

PropertyValue
Prefixdkm_
Formatdkm_ + 32 random bytes hex
StorageSHA-256 hash only; plain shown once at mint
ScopeWhole workspace (read errors + write issues)
RevocableSoft-delete via DELETE /api/mcp/tokens/:id

4. Transport#

SSE (Server-Sent Events). Two endpoints:

EndpointPurpose
GET /api/mcp/sseEstablishes 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.

ArgTypeNotes
projectIduuid, optionalEither this or projectSlug.
projectSlugstring, optionalFriendlier for humans.
sinceHoursnumber, optionalDefault 168 (7 days). Max 720 (30d).
statusenum, optionalopen | 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.

ArgTypeNotes
projectId | projectSlugone required
fingerprintstring, required
withOccurrencesbool, default trueInclude recent event rows.
occurrencesLimitnumber, optionalDefault 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.

ArgType
projectId | projectSlugone required
fingerprintstring, required
limitnumber, optional (default 25, max 500)

resolve_issue ⚠ requires confirmed: true#

Mark an issue as resolved.

ArgType
projectId | projectSlugone required
fingerprintstring, required
notestring, optional (e.g. PR URL)
confirmedtrue, 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#

ArgType
assigneeIduuid or null

Assign to a team member (by team_members.id) or null to unassign.


email_summary ⚠ requires confirmed: true — currently stubbed#

ArgType
toemail
fingerprintstring, required
prUrlurl, optional
notestring, optional
confirmedtrue, 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#

code
$ 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_errors rather 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 same dkm_ token authenticates both surfaces.
  • email_summary is 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.