punchline-mcp
v1.4.1
Published
MCP stdio server exposing the Punchline external API as tools
Maintainers
Readme
punchline-mcp
A local stdio MCP server that exposes the Punchline external API as agent tools. Authorization is entirely server-side — the tools you get depend on the API key you configure, not on any client-side flag.
Setup
The server is published to npm — no repo access needed, just Node ≥ 18. With the Claude Code CLI:
claude mcp add punchline --env PUNCHLINE_API_KEY=pnchl_live_... -- npx -y punchline-mcpOr with the generic MCP client JSON config:
{
"mcpServers": {
"punchline": {
"command": "npx",
"args": ["-y", "punchline-mcp"],
"env": { "PUNCHLINE_API_KEY": "pnchl_live_..." }
}
}
}From source
Working from a checkout of this repo instead:
cd punchline-mcp
npm install
npm run buildThen register the built entry point in place of npx — e.g. with the Claude Code CLI:
claude mcp add punchline --env PUNCHLINE_API_KEY=pnchl_live_... -- node /path/to/punchline/punchline-mcp/dist/index.js(For the JSON config, use "command": "node" and "args": ["/path/to/punchline/punchline-mcp/dist/index.js"].)
Environment variables
| Variable | Required | Default | Notes |
|---|---|---|---|
| PUNCHLINE_API_KEY | Yes | — | A pnchl_live_… project key or a pnchl_user_… user provisioning key. Sent as X-Punchline-Key. |
| PUNCHLINE_BASE_URL | No | https://proding.co:8050 | Punchline API base URL. A path prefix (e.g. https://host/punchline) is kept in front of /api/v1/… (1.4.1+). |
Any other key prefix, or a missing key, fails at startup with a ConfigError on stderr.
Key-type behavior
The server registers a different tool set depending on the key prefix:
pnchl_live_…(project key) — registers the 9 ticket/project tools:create_ticket,list_tickets,get_ticket,update_ticket,add_communication,link_tickets,unlink_tickets,whoami,get_changelog.pnchl_user_…(user provisioning key) — registers onlycreate_project, which returns a ONE-TIME project API key.
A single server instance only ever exposes one set. To give an agent both capabilities, register
the server twice under two names with two different keys, e.g. punchline (project key) and
punchline-provisioning (user key).
Tools
| Tool | Available with | Description |
|---|---|---|
| create_ticket | project key | Create a ticket. reporter_email is required. Supports idempotent retries via idempotency_key, sent to the API as the idempotencyKey body field. Optional custom_fields (sent as customFields) is an array of { name, value } pairs; name must match a custom-field definition configured on the project or the request is rejected with 400. description is at most 16 000 characters, the API's limit (1.4.1+; was wrongly 50 000). |
| list_tickets | project key | List tickets visible to the key (own tickets, or the whole project with read:all). Paginated. |
| get_ticket | project key | Fetch one ticket by display id (e.g. ACM-7). |
| update_ticket | project key | Change a ticket's workflow status, its priority, its labels, and/or customer-facing public summary. Setting priority records a triage ruling — confirming the current value counts as one — which a project enforcing triage requires before a ticket can close. Priority is applied before status, so one call can triage and close. A ticket created through this API arrives untriaged: the priority sent at creation is the reporter's proposal, not a ruling. (1.2.0+) labels is a replace-set applied before everything else: omit it to leave the labels alone, send the full list to change them, send [] to clear them — unknown names are created, exactly as at create_ticket; a blank name is refused by both tools rather than silently dropped, and surrounding whitespace is stripped server-side. (1.3.0+) title and description may also be patched: title is trimmed and rejected if blank, description replaces only the reporter-authored body, preserving the **Reported by** … via … provenance header the ticket was created with — send "" to clear the body and keep just the header. Both are applied before labels, priority and status. (1.4.0+) |
| add_communication | project key | Post a customer-facing communication (external comment) on a ticket. |
| link_tickets | project key | Link two tickets. relation is one of BLOCKS, BLOCKED_BY, DUPLICATES, DUPLICATE_OF, RELATES_TO, read from the perspective of the ticket in display_id — the same vocabulary get_ticket returns in linkedTickets, so a relation round-trips. ⚠️ close_as_duplicate: true also closes the display_id ticket and emails its reporter; it requires relation=DUPLICATES and is not undone by unlink_tickets. |
| unlink_tickets | project key | Remove a link. relation must match how the link reads from the ticket in display_id. |
Cross-project links are omitted from every response. These endpoints can only create links within your own project, but a staff member can link one of your tickets to a ticket in another project from the Punchline UI. Those are filtered out of
linkedTicketsandlinksalike — so a ticket may carry links you cannot see, and a409 Link already existsfromlink_ticketscan refer to one of them. |whoami| project key | Introspect the configured key: project, key name, scopes, last use. Useful for self-diagnosing 403s. | |get_changelog| project key | Recent externally-visible ticket changes for the project. | |create_project| user key | Provision a new Punchline project. Returns the project and a ONE-TIME project API key. |
Manual smoke test
With a real key configured in your MCP client, ask the agent to run whoami and confirm it
returns your project/key details.
Or run the server directly and check the startup log on stderr:
PUNCHLINE_API_KEY=pnchl_live_... node dist/index.js
# punchline-mcp: 9 tool(s) registered [create_ticket, list_tickets, get_ticket, update_ticket, add_communication, link_tickets, unlink_tickets, whoami, get_changelog]Errors
Tool errors carry the API's problem detail: 403 scope errors (e.g. missing write:own), 409
conflicts (e.g. duplicate project slug/prefix), and 429 rate limits with Retry-After.
Development
npx vitest run # unit tests
npm run build # tsc --noEmit-equivalent build to dist/