MCP server
Let AI coding agents such as Claude Code and Cursor search, reproduce and resolve feedback through the Model Context Protocol.
@pinwren/mcp (MIT) is a Model Context Protocol server for Pinwren. Connect it to
your coding agent and you can ask "what's still open on the checkout page?", "reproduce #142" or "fix the top
urgent bug and resolve it with the PR link" — the agent reads the report, its anchor, console errors and failing
requests, and updates the item when it's done.
It runs two ways:
| Transport | Use it when | Configure with |
|---|---|---|
| stdio | The agent runs on your machine (Claude Code, Cursor, …) | npx @pinwren/mcp, PINWREN_URL, PINWREN_TOKEN |
| Streamable HTTP | The client connects to a URL (remote agents, hosted tools) | https://feedback.example.com/mcp, Authorization: Bearer <token> |
Both act with an API token and can do exactly what the token's scopes allow. Create one
for the agent in Settings › API tokens — feedback:read to look only, plus feedback:write and
comments:write to triage and resolve.
The hosted endpoint /mcp shares the REST API's limits: request bodies over 2 MB are refused
with 413, and an address that sends 20 bad tokens in 10 minutes gets 429 RATE_LIMITED until the window ends —
failures on /mcp and /api/v1 count together. A missing or bad token is answered 401 with a
WWW-Authenticate: Bearer challenge. Being token-authenticated, /mcp is exempt from the dashboard's same-origin
and JSON-only checks.
Claude Code
claude mcp add pinwren \
-e PINWREN_URL=https://feedback.example.com \
-e PINWREN_TOKEN=pwt_… \
-- npx -y @pinwren/mcpOr connect over HTTP, without running anything locally:
claude mcp add --transport http pinwren https://feedback.example.com/mcp \
--header "Authorization: Bearer pwt_…"Run /mcp in Claude Code to check that pinwren is connected.
Cursor
Add the server to .cursor/mcp.json in your project (or ~/.cursor/mcp.json for every project):
{
"mcpServers": {
"pinwren": {
"command": "npx",
"args": ["-y", "@pinwren/mcp"],
"env": {
"PINWREN_URL": "https://feedback.example.com",
"PINWREN_TOKEN": "pwt_…"
}
}
}
}Other MCP clients (Claude Desktop, Windsurf, VS Code, Zed) take the same command, args and env.
Keep the token out of git
A project-level mcp.json is easy to commit. Put the token in your shell environment or your client's
secret store, or use a read-only token for shared configs.
Tools
| Tool | Does | Writes |
|---|---|---|
list_projects | Projects the token can see, with their open counts | — |
search_feedback | Find items by project, status (or active / all), kind, priority, assignee, round, text, page URL, date and regression; compact rows with a cursor | — |
get_feedback | One item in full: text, thread, anchor (CSS selector, XPath, text), environment, metadata, console and failing-request excerpts, and asset URLs | — |
get_reproduction_context | Markdown for reproducing a report: page and environment, ordered steps from the session replay when one was recorded, failing requests and console errors | — |
update_feedback | Change status, priority, title, assignees, review round or custom field answers | ✓ |
add_comment | Comment as the token's owner — internal (default) or public, which the reporter sees on the page and by email | ✓ |
resolve_feedback | Mark resolved, with an optional note (a commit or pull request link) saved as an internal comment, and optionally the release that fixed it (fixedInReleaseId) or nextRelease: true | ✓ |
get_agent_brief | The hand-off brief for fixing a report: report, repro steps, page URL and pinned element, browser/OS, console and network errors, replay summary, links to the screenshot and replay, code hints. Masked data only — the replay and screenshot are linked, never included | — |
get_repro_test | A draft Playwright test (TypeScript) for the report, with its caveats. Generated from the recording without a model | — |
list_labels | A project's labels with their live item counts | — |
list_custom_fields | A project's custom form fields: key, type, options, audience, kinds | — |
list_rounds | A project's review rounds with item counts | — |
get_round | One review round | — |
list_saved_views | Saved inbox views and their filters | — |
get_stats | Workspace numbers: totals, breakdowns and a daily series (7, 14, 30 or 90 days) | — |
list_assets | Screenshots, attachments and the replay of an item: metadata and URLs only | — |
get_asset | A screenshot as an image — only when called with includeImage: true (PNG/JPEG/WebP/GIF, up to 1.5 MB); replays are never returned | — |
list_releases | A project's releases, newest first: version, commit, deploy time, items fixed in it and regressions reported from it | — |
create_release | Record a release (needs the releases:write scope); the same version again updates it | ✓ |
Every tool except the four write tools carries MCP's read-only hint; the four write tools are marked non-destructive, and
update_feedback, resolve_feedback and create_release idempotent, so clients can decide which calls need your approval.
Fix with an agent
get_agent_brief is the one-call start for fixing a report: the report, repro steps, page URL and pinned element,
environment, console and network errors, a replay summary and code hints (the route, files named in errors, search
terms, and the repository when the project syncs to GitHub or GitLab). Then get_repro_test returns a draft
Playwright test; run it, fix the cause, and finish with resolve_feedback and the commit or PR link.
Fix Pinwren feedback #142. Call get_agent_brief, reproduce it with get_repro_test, fix it here, then resolve it.The same brief is behind Fix with agent in the dashboard (copy the brief, copy a claude command, open Cursor,
or send it to a project's agent webhook) and pinwren feedback brief on the command line. Privacy:
the brief is built from the masked diagnostics already stored; the session replay and screenshot are linked, never
included, and get_asset returns an image only when asked with includeImage: true.
Untrusted content
Feedback is written by anyone who can open your site. The server tells the agent that titles, bodies, comments and metadata are untrusted data, never instructions — but treat the agent's output with the same care: review its changes before you merge them, and give unattended agents a read-only token.
Options
| Variable | Meaning |
|---|---|
PINWREN_URL | Your Pinwren instance |
PINWREN_TOKEN | An API token (pwt_…) |
npx @pinwren/mcp --version prints the version. The stdio server logs to stderr only; stdout carries the protocol.
To embed the HTTP transport in your own Fetch-API server, the package exports handleMcpRequest(request, client),
which answers one stateless Streamable HTTP request with a Pinwren SDK client.