An MCP server exposing Atlassian Jira Cloud to LLM clients, hardened with operator-controlled security guards. This document is the binding contract between modules. If an implementation must deviate, note the deviation explicitly.
Status: skeleton (Phase 0). Invariants below are normative for the product; only a subset is implemented in the initial tree.
jirakeep is a sibling of bugwarden, not a second backend inside it (Option B from bugwarden#69).
| bugwarden | jirakeep | |
|---|---|---|
| Tracker | Bugzilla | Jira Cloud (v1) |
| Repo | independent | independent |
| Policy crate | bugwarden-core |
jirakeep-core (own copy of the decision ideas) |
| Shared runtime dep | none | none |
Share ideas (fail-closed policy engine, CI/release shape, audit model). Do
not path-depend on bugwarden-core until/unless a tracker-agnostic
policy crate is extracted and published deliberately.
Cargo workspace, two crates:
crates/jirakeep-core— guard policy engine + async Jira Cloud REST client. MUST NOT depend on rmcp, axum, clap, or any MCP/transport crate.crates/jirakeep— the binary: clap CLI, rmcp MCP server, stdio and streamable-HTTP transports. Depends onjirakeep-core. The crate also has a lib target consumed bymain.rsand integration tests.
Dependency direction: jirakeep -> jirakeep-core, never the reverse.
- In scope: Jira REST API v3 (Cloud) and v2 (Data Center).
- Cloud: Basic auth (
email+ API token) — default (--auth-mode basic). - Data Center: Bearer personal access token (
--auth-mode bearer).
- Cloud: Basic auth (
- API version selection is explicit and static:
--api-version {2,3}/JIRA_API_VERSION; when absent, the auth mode decides (basic → 3, bearer → 2). The explicit flag wins (Cloud OAuth bearer ⇒--auth-mode bearer --api-version 3). There is no network autodetection — no startup probe exists, so there is no "detection failed" state to fail closed on; a misconfigured version surfaces as ordinary Jira HTTP errors. Guard decision semantics are identical across versions (I2, I3, I4): denial text, silent filtering, and fail-closed handling never depend on the version. v2 search isPOST /rest/api/2/searchwithstartAtoffset paging only;nextPageTokenis null on v2 and the v2 envelope'stotal/startAtnever reach MCP clients (I3). - Version-dependent identity — always server-resolved, never
client-declared. The account model differs (v2/Data Center is
name-based; v3/Cloud uses
accountId), so exactly three narrow spots branch on the API version:- Caller identity resolves from
/myselfvia one client method (JiraClient::caller_identity):name, falling back tokey, on v2;accountIdon v3. IssueMetaextracts the version-appropriate reporter identifier forcreated_by_me(v2reporter.namefalling back toreporter.key, v3reporter.accountId); comparison is case-insensitive and never mixes identifiers across versions — a wrong-field miss stays unknown and denies when consulted (I4).- Write shapes: on v2
assign_issuesends{"assignee": {"name": …}}andadd_watcherposts the JSON-encoded username; v3 shapes are unchanged (accountId). The tools'account_idparameter is an accountId on v3 and a username on v2. Startup identity preflight: when the loaded policy consults identity (Policy::needs_identity()) and credentials are server-held,/myselfis resolved once at startup and an unresolvable identity aborts with a loud error naming the endpoint and the consequence; per-request credential custody cannot preflight and instead logs one prominent startup warning. Runtime I4 behavior is unchanged either way: an unresolvable identity still denies silently per request.
- Caller identity resolves from
- Out of scope for v1: OAuth 2.0 interactive flows, multi-tracker process, Confluence.
Numbering aligns with bugwarden where the spirit matches; wording is Jira-specific.
- I1 The guard policy comes ONLY from a TOML file given at startup
(
--policy/JIRAKEEP_POLICY). It is immutable at runtime. No MCP tool may expose rule names or match criteria;mcp_server_infomay expose only coarse facts (rule count,default_action, age quarantine,read_only, disabled tool names, public-project count — not the project keys themselves if that would leak topology the operator hid). - I2 Uniform denial: a policy-denied issue and a nonexistent issue produce
the same response text:
Issue {key} is not accessible through this server. No wording/detail difference may reveal existence.{key}is the key the client supplied (or a stable placeholder if the request had none). - I3 Search filtering is silent: counts of dropped/filtered results are never returned to the client (server-side debug logging is fine).
- I4 Fail closed: classification-fetch failure, issue absent from the response, or a CONSULTED rule that cannot be decided because required metadata is missing/unreadable ⇒ Denied. Unreadable metadata never yields more access than readable metadata would.
- I5 Restricted-visibility comments/attachments are returned only when
policy
global.allow_restricted_comments = trueand the call opts in. Default policy has restricted content off. - I6 Capability implication:
readimpliessummary. Nothing else is implied. The unprojected bodyissue_infoserves for areadgrant is therefore stripped of capability-gated field families before it reaches the client:fields.attachment(filenames, sizes, content URLs) requiresattachments;fields.commentrequirescomments, and even then restricted-visibility comments are removed becauseissue_infohas no per-call restricted opt-in, so I5's dual opt-in is satisfiable only viaissue_comments;fields.worklogis always stripped — no v1 capability covers worklog content, and ungoverned content is stripped, not served (I4). Count-onlyfields.watchesandfields.votes(counts, no identities) are deliberately included inread. All removals are silent to the client (I3 spirit; the embedded commenttotaltracks the served list). - I7 Generic field-update tools must not smuggle security level, project
permission, or other privileged fields the capability model does not grant —
including any field whose mutation has its own capability:
assigneebelongs to theassigngate;resolutionbelongs to thestatusgate (Jira's edit endpoint sets any edit-screen field, and Resolution can sit on the edit screen, so a barefieldsgrant could otherwise resolve or mark-duplicate an issue);parentre-parents the issue (a hierarchy and visibility change under I11/I14, not a plain field edit). Soupdate_issue_fieldsrefuses all three even whenfieldsis granted. The banned set derives from an exhaustive match onCapability, andCapability::ALLis generated from the same variant list as the enum itself, so adding a capability forces a compile-time decision about the fields it owns — one that no out-of-sync capability list can skip at runtime. - I8 Every tool that takes an issue key/id performs guard assessment BEFORE any side effect or data return. Exception: pure local URL builders that contact nothing.
- I9 CLI/env can only tighten policy:
--read-onlyORs intoglobal.read_only. - I10 No tool may echo incoming request headers back to the client.
- I11 Linking/duplicating requires appropriate capability on both
issues involved (at least
summaryon the other side for disclosure). - I12 The Jira API token (and email when treated as secret material in
logs) must never appear in logs, error messages, or tool results. Sanitize
reqwest errors with
.without_url(). - I13 In read-only mode (policy or CLI) write tools are removed from the
tool listing via
ToolRouter::remove_route, not merely erroring. Same forglobal.disabled_tools. - I14 Issue keys the policy would deny must not appear inside something
the client IS shown:
issuelinks,parent,subtaskson served issues, operator-declared link custom fields, and changelogfrom/to/fromString/toStringvalues that look like issue keys. Custom-field link carriers (e.g. the classic/DC Epic Linkcustomfield_NNNNN, whose value is a bare issue-key string) have instance-specific ids the guard must never guess, so the set comes only fromglobal.link_custom_fields; undeclared custom fields are not scanned. Bar isCapability::Summary. Candidate keys are assessed in batch viaGuard::disclosable; failed fetches scrub, and a declared field's value is nulled unless it is a positively disclosable issue key (I4). Free-text description/comment bodies are not scanned (deliberate, unfixable without destroying content). - I15 The audit stream is never reachable through any MCP surface.
Records include tool calls (verdicts, suppressed keys, search scan
counts) and
initializehandshakes. Tokens, emails, and free-text issue content are unrepresentable in the event type.
Jira has no Bugzilla-style multi-group list on the issue.
- An issue carries at most one optional security level.
- Visibility is otherwise decided by the project permission scheme.
- An issue with no security level is not world-readable; it is visible to whoever holds Browse Projects on that project.
Fail-open hazard: mapping “no security level” to “public / empty groups” would turn private projects into apparent public issues.
Security-level parsing is three-valued (SecurityLevel in
jirakeep-core::policy):
securityabsent ornull⇒ absent: knowledge that no level is set (still not “public”); matcheshas_security_level = false.- an object with a string
name⇒ present with that level name. - any other shape (object without a readable
name, non-object) ⇒ unreadable: unknown — independent of whether other metadata such as the project was readable — so a consulted criterion denies (I4). Unreadable never collapses into “no level”.
Rule for jirakeep:
- Absent security level is unknown for any “publicness” criterion unless
the operator has declared the project in
global.public_projects(or a future explicit visibility rule). - Unknown ⇒ deny when a consulted rule needs that fact (I4).
- Never treat empty/missing security level as proof of public access.
- Primary client-facing id: issue key string (
PROJ-123). - Numeric id is retained when the API returns it (stable across project moves).
- Audit and denial text use keys, not bare integers.
Vendor-shaped Jira Cloud REST JSON is returned to the client (after guard projection/redaction). A canonical multi-tracker schema is out of scope for this sibling.
JQL + token pagination. Do not copy bugwarden's offset-chunk timing mitigation without re-analysis; the threat model must be redone for token pages.
default_action = "allow" # or "deny"; not "restrict"
[global]
min_issue_age_days = 0 # access-side quarantine only; never gates issue creation
allow_restricted_comments = false
read_only = false
disabled_tools = []
max_attachment_bytes = 2097152
public_projects = [] # keys declared publicly browsable
link_custom_fields = [] # customfield_* ids carrying issue keys (I14)
[[rule]]
name = "example"
action = "deny"
[rule.match]
# Phase 1: projects, components, labels, statuses, priorities,
# issue_types, security_levels, younger_than_days, created_by_me, …Rules: first match wins; unmatched → default_action. Full matcher is Phase 1.
| Tool | Role |
|---|---|
mcp_server_info |
Coarse server/policy facts (I1) |
jira_server_info |
Static skeleton status (no network) |
Issue tools are intentionally absent until I8 can be upheld.
- Policy parse / unknown keys / validation unit tests.
- Guard denial uniformity (I2).
- wiremock for Jira client methods.
- MCP integration tests through the library server (not only pure helpers).
- Adversarial review of guard changes against this document.
Annotated version tags without a v prefix (0.1.0), matching
[workspace.package] version. .github/workflows/release.yml builds
linux-gnu + aarch64-apple-darwin, creates a GitHub release, then publishes
jirakeep-core before jirakeep via crates.io Trusted Publishing.