ticket-ai
An MCP server and CLI that measures how your team actually writes tickets, and holds new ones to that. Not this ticket is bad — 31 of the 40 tickets that shipped here have an acceptance-criteria section, and this one does not.
No 'Akzeptanzkriterien' section. 31 of the 40 exemplar tickets (78%) have one.
Most ticket advice is free and therefore ignored. "Add acceptance criteria", "include steps to reproduce" — everyone has heard it, nobody changed anything. A count of what already happened in your own project is harder to wave away, and it is not an opinion about tickets.
There is no model in the loop for any of that. Learning the house style, finding related tickets and measuring a draft are counting, and run with no key and no network beyond your tracker. Writing a ticket needs a model, so that part is opt-in and which one is your choice. What it found when it was run against real boards →
Install
uv tool install ticket-ai-mcp
Configuration is environment variables only — a token passed as --token ends
up in your shell history and in the process list.
export TICKET_AI_TRACKER=gitlab
export TICKET_AI_PROJECT=acme/shop # or the numeric id
export TICKET_AI_GITLAB_URL=https://gitlab.example.com
export TICKET_AI_GITLAB_TOKEN=... # read_api scope is enough
The token is optional on a public project. TICKET_AI_GITLAB_URL=https://gitlab.com
with no token reads any public board, which is the quickest way to see what
this does before pointing it at your own instance.
Jira and GitHub
# Jira — Cloud or self-hosted Server / Data Center. Which one you are on is
# detected from the instance; you do not have to say.
export TICKET_AI_TRACKER=jira
export TICKET_AI_PROJECT=PROJ
export TICKET_AI_JIRA_URL=https://acme.atlassian.net
# Leave the credentials unset for a public board — plenty answer without any.
# Cloud: the token comes from id.atlassian.com, and is not the password.
export TICKET_AI_JIRA_EMAIL=you@example.com
export TICKET_AI_JIRA_TOKEN=...
# Self-hosted: a personal access token on its own, sent as a Bearer.
export TICKET_AI_JIRA_TOKEN=...
# Only if detection gets it wrong: cloud | server | auto (the default)
export TICKET_AI_JIRA_API=server
# GitHub
export TICKET_AI_TRACKER=github
export TICKET_AI_PROJECT=acme/shop
export TICKET_AI_GITHUB_TOKEN=...
mcp-name: io.github.syrian963/ticket-ai-mcp
One command
ticket-ai learn # mine the tracker, cache the profile
ticket-ai style # what it learned
learn takes a minute or two: ranking needs each ticket's comments and linked
merge requests, which is an extra request or two per ticket. It caches to
TICKET_AI_CACHE_DIR if you set one and to .ticket-ai/ otherwise, so it
happens once rather than once per review.
Then the rest:
ticket-ai learn --from '#412,#98' # or name the good ones yourself
ticket-ai context 'export is broken on mobile' # what already exists
ticket-ai gaps # declared template vs what arrives
ticket-ai draft --title '...' --file draft.md # check one before creating it
ticket-ai review '#42' # measure one that exists
ticket-ai open # every open ticket, worst first
draft is the one worth building a habit around. Checking a ticket after you
create it puts the review past the point of no return: the board has already
been notified and every fix is now an edit with a history.
$ ticket-ai draft --title 'Filter kaputt' --file draft.md
Alignment with house style: 33% over 3 checks
### MEDIUM - The description is 116 characters.
The shortest quarter of tickets that shipped here start at 639; the median is 1079.
### MEDIUM - The ticket has no labels.
62% of the exemplars are labelled.
--from is taken as given: no filtering, no scoring against your choices. Name
a ticket with a three-word description and that is your answer about how this
team writes tickets, and the profile will say so.
As an MCP server
{
"mcpServers": {
"ticket-ai": {
"command": "uvx",
"args": ["ticket-ai-mcp"],
"env": {
"TICKET_AI_TRACKER": "gitlab",
"TICKET_AI_PROJECT": "acme/shop",
"TICKET_AI_GITLAB_URL": "https://gitlab.example.com",
"TICKET_AI_GITLAB_TOKEN": "..."
}
}
}
}
Eight tools, all read-only: learn_conventions, house_style,
ticket_template, ticket_context, template_gaps, review_draft,
review_ticket, review_open_tickets.
Add TICKET_AI_REPO to the env block if the checkout you want searched is
not the assistant's working directory.
Writing a ticket this way
The path to reach for if you already use Claude Code: no key, no compose, no
second model call. Ask for a ticket and the assistant does five things, three
of them here:
ticket_template— the shape: which sections, how long, what language, which labels.ticket_context— what exists: related tickets, the files their merge requests changed, the files in the checkout that mention it.- It reads those files.
ticket_contextruns a text search, not an analysis; it says where to look, it does not save you looking. - It writes the ticket.
review_draft— measures what it wrote, and fixes what that finds before showing you anything.
Where the "AI" is
Counting cannot produce a paragraph of German, so writing a ticket needs a model. Everything else needs nothing.
| Writes | Needs | |
|---|---|---|
| MCP, in Claude Code | yes | nothing — the assistant is already a model |
--writer ollama |
yes | a model on your machine. No key, no account, nothing leaves the laptop |
--writer openai |
yes | a base URL and a key. OpenRouter, Azure AI Foundry, vLLM, any provider |
| no writer (default) | no | nothing. Measures and gathers; you write |
export TICKET_AI_WRITER=ollama # or openai, with a base url and key
ticket-ai models # what that endpoint can reach
ticket-ai compose --title 'Etikettendruck bricht bei mehr als zehn Positionen ab'
ticket-ai models --workflow # an Actions workflow that drafts new issues
compose writes the body, measures it, hands the findings back to the model
once, and prints the review to stderr so the body alone can be redirected.
--fail-under makes it refuse to emit a draft that missed the house style.
Whichever model writes, the draft goes through the same measurement as any other ticket. That loop is why a small local model is usable here: it writes into a shape worked out by counting, and is marked against your team's own tickets afterwards.
A page instead
ticket-ai ui --lang de # or en
A local page on 127.0.0.1:8760 with three tabs: the house style, a box to
paste a draft into, and the open backlog worst-first. Loopback only, because
this process holds a tracker token, and there is no flag to change that.
No build step and no CDN — one HTML file with its CSS and JavaScript inline.
Two languages, and they are separate
export TICKET_AI_UI_LANGUAGE=de # buttons and headings
export TICKET_AI_TICKET_LANGUAGE=de # what it says to write tickets in
The distinction is easy to collapse and worth keeping. A German team may want the tool's own buttons in English; someone joining a German board still has to write the ticket in German.
TICKET_AI_TICKET_LANGUAGE overrides what the corpus measured and takes effect
without re-learning. Leave it unset unless the board is mid-switch — a
measurement beats a setting, and forcing a language the board does not use
makes every existing ticket fail the language check.
Findings, the caveats under them and the list of what a ticket already got right are all rendered in the reader's language at the moment they are shown. The section names inside them are not: those are the team's own headings, and translating one turns it into a section the team does not have.
In CI
ticket-ai review "$CI_ISSUE" --fail-under 0.5
What it measures
The house style. Sections, length, labels, title markers, language — over a corpus it either took from you or found itself. Every finding cites a count over that corpus.
The tickets that failed, not only the ones that worked. A rate can be a comparison: not "78% of tickets have acceptance criteria" but "78% of the ones that shipped, and 30% of the ones that stalled". The second is evidence; the first invites a shrug.
The split is on outcome alone — a merged change, a reopen, a run of clarifying questions — and never on what the ticket contains, because splitting on content and then comparing content would be circular. Tickets a staleness bot closed are left out of both groups: those say something about attention rather than about writing. On a board where nothing separates the two, it says so, which is worth knowing before anyone is asked to write differently. docs/shipped-against-stalled.md has the guards and the real board that forced the bot exclusion.
Sections that only travel together. A section carried by 41% of tickets is under any threshold worth having — but if it is on 76% of the tickets that also have a Ziel section and 20% of the ones that do not, the team has a template and applies it to one kind of work. A board-wide rate hides that entirely.
The form you declared, against the tickets you got. With a
.github/ISSUE_TEMPLATE or .gitlab/issue_templates in the checkout, gaps
lines each field up against how often tickets actually carry it — and the gap
runs both ways. A required field that turns up in 10% of tickets is a form
asking for something people cannot easily give. A section most tickets carry
that no form mentions is a convention the project grew and never wrote down.
What you need to write one. Give it a subject and it returns the related past tickets, the files the merge requests for those tickets actually changed, and the files in your checkout that mention it. That middle one lives only in the tracker's history — no amount of reading the code produces it, and it is usually the fastest way to find where the work will land.
How the mining works
Only closed tickets are sampled: an open ticket may be beautifully written, but nothing about it yet shows anyone could act on it. Each is scored on
| Signal | Weight | Why |
|---|---|---|
| A merged MR is attached | 0.30 | Strongest evidence someone could build it as written |
| Substantial description | 0.20 | A stub teaches nothing about a template |
| Has sections | 0.15 | The template is the thing being learned |
| No clarifying questions | 0.15 | Eleven "what do you mean?" comments means it was not clear |
| Never reopened | 0.10 | Reopened means closed before it was understood |
| Labelled | 0.10 |
Tickets opened and closed inside an hour are halved — usually duplicates or typo fixes, whose shape is not the shape of real work. Bot authors are dropped outright; learning a house style from Renovate is a real failure mode. No one author may supply more than 40% of the corpus, or the profile describes your most prolific ticket-writer instead of your team.
Every score carries the reasons that produced it. A corpus you cannot argue with is one you will not trust.
What it will not tell you
Whether your tickets are any good. Nothing here reads for meaning; it counts. It cannot tell you whether your acceptance criteria make sense. It can tell you that the 40 tickets that shipped in this project all had some and this one does not.
Alignment is not quality. The score is distance from the tickets that historically got built here. A one-line ticket from someone who knows exactly what they mean can score badly and be completely fine. The tool says this about itself, and so should you when you quote it at a colleague.
Nothing about your tracker's contents changes. Every operation is a read.
The ranking signals are also circumstantial. A well-written ticket closed as out-of-scope with no MR scores badly, and that is an acceptable error: the goal is thirty representative tickets, not the thirty best ones. A thin sample says so, loudly, in the report and in every review built on it.
Jira has no public API for linked branches and merge requests, so the "shipped" signal there falls back to remote links, and a board that does not post them cannot be split into shipped and stalled at all. It says that rather than reporting every ticket as stalled. That is a limit of the API, not of the corpus.
Documentation
| thirty-boards.md | What running it against forty-three real boards, an MCP client, a browser and a clean install found. Almost all of it had full line coverage at the time |
| what-it-produces.md | Five tickets it wrote, unedited, with the score each one got |
| shipped-against-stalled.md | How the two groups are split, and the guards that keep the comparison honest |
| local-models.md | Running the writer on a 2 GB local model: measured timings, and what it trades away |
Verified against
Run end to end, read-only, against home-assistant/core, pydantic/pydantic,
astral-sh/uv, fastapi/fastapi (GitHub), inkscape/inkscape and
gitlab-org/gitlab-runner (GitLab), hibernate.atlassian.net HHH (Jira Cloud),
issues.apache.org/jira KAFKA (Jira Data Center), and one private GitLab board.
Home Assistant produces no conditional rules at all, which is the right answer: their issue form is mandatory, so every section already clears the board-wide threshold and a conditional has nothing to add.
Development
uv sync
uv run pytest
uv run ruff check .
bash install_check.sh # build the wheel and drive it from a clean venv
uv run python tests/fleet.py # the whole tool across 43 public boards
License
MIT.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ticket_ai_mcp-0.1.1.tar.gz.
File metadata
- Download URL: ticket_ai_mcp-0.1.1.tar.gz
- Upload date:
- Size: 100.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c75fe083749b47cfbfd0e519b12676668f7f66f8da172609e9b609d43b703cc8
|
|
| MD5 |
8a9a0fe8770de86522b4e2c524fe36ab
|
|
| BLAKE2b-256 |
b7baa63780179eef78262f2970ca398a0f29ca2fd85bc9988345f14376382963
|
Provenance
The following attestation bundles were made for ticket_ai_mcp-0.1.1.tar.gz:
Publisher:
release.yml on syrian963/Ticket-AI-MCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ticket_ai_mcp-0.1.1.tar.gz -
Subject digest:
c75fe083749b47cfbfd0e519b12676668f7f66f8da172609e9b609d43b703cc8 - Sigstore transparency entry: 2792965853
- Sigstore integration time:
-
Permalink:
syrian963/Ticket-AI-MCP@2546763a42402b89425ec6c2db204044f48d0c9b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/syrian963
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2546763a42402b89425ec6c2db204044f48d0c9b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file ticket_ai_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ticket_ai_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 120.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
098fdf4d1b508d2ad118ad7b02c6f631fd125abb038d63653c489f0067a63cc8
|
|
| MD5 |
df4bfd6f44d91fb80271ef857f9db1a8
|
|
| BLAKE2b-256 |
842398678b6bc5fd2e5c64fc8be994a7806cc9b42ba1db93aaef7cdc4770d9b7
|
Provenance
The following attestation bundles were made for ticket_ai_mcp-0.1.1-py3-none-any.whl:
Publisher:
release.yml on syrian963/Ticket-AI-MCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ticket_ai_mcp-0.1.1-py3-none-any.whl -
Subject digest:
098fdf4d1b508d2ad118ad7b02c6f631fd125abb038d63653c489f0067a63cc8 - Sigstore transparency entry: 2792965892
- Sigstore integration time:
-
Permalink:
syrian963/Ticket-AI-MCP@2546763a42402b89425ec6c2db204044f48d0c9b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/syrian963
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2546763a42402b89425ec6c2db204044f48d0c9b -
Trigger Event:
workflow_dispatch
-
Statement type: