ultra-jira-mcp 2.1.2 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +130 -7
- package/build/auth/jira-client.d.ts +14 -1
- package/build/auth/jira-client.d.ts.map +1 -1
- package/build/auth/jira-client.js +22 -5
- package/build/auth/jira-client.js.map +1 -1
- package/build/cli/connection.d.ts +6 -0
- package/build/cli/connection.d.ts.map +1 -0
- package/build/cli/connection.js +32 -0
- package/build/cli/connection.js.map +1 -0
- package/build/cli/direct.d.ts.map +1 -1
- package/build/cli/direct.js +15 -4
- package/build/cli/direct.js.map +1 -1
- package/build/cli/index.js +12 -7
- package/build/cli/index.js.map +1 -1
- package/build/codeapi/boot.d.ts +10 -1
- package/build/codeapi/boot.d.ts.map +1 -1
- package/build/codeapi/boot.js +38 -8
- package/build/codeapi/boot.js.map +1 -1
- package/build/codeapi/bridge.d.ts +2 -1
- package/build/codeapi/bridge.d.ts.map +1 -1
- package/build/codeapi/bridge.js +3 -2
- package/build/codeapi/bridge.js.map +1 -1
- package/build/codeapi/tool.d.ts +3 -3
- package/build/codeapi/tool.d.ts.map +1 -1
- package/build/codeapi/tool.js +14 -7
- package/build/codeapi/tool.js.map +1 -1
- package/build/config.d.ts +9 -0
- package/build/config.d.ts.map +1 -1
- package/build/config.js +50 -2
- package/build/config.js.map +1 -1
- package/build/core/adf.d.ts +5 -0
- package/build/core/adf.d.ts.map +1 -1
- package/build/core/adf.js.map +1 -1
- package/build/core/attachments.d.ts +33 -1
- package/build/core/attachments.d.ts.map +1 -1
- package/build/core/attachments.js +150 -1
- package/build/core/attachments.js.map +1 -1
- package/build/core/body-coerce.d.ts +2 -0
- package/build/core/body-coerce.d.ts.map +1 -0
- package/build/core/body-coerce.js +96 -0
- package/build/core/body-coerce.js.map +1 -0
- package/build/core/embed-images.d.ts +15 -0
- package/build/core/embed-images.d.ts.map +1 -0
- package/build/core/embed-images.js +168 -0
- package/build/core/embed-images.js.map +1 -0
- package/build/core/manifest.d.ts +3 -3
- package/build/core/manifest.d.ts.map +1 -1
- package/build/core/manifest.js +54 -5
- package/build/core/manifest.js.map +1 -1
- package/build/core/markdown-to-adf.d.ts +4 -0
- package/build/core/markdown-to-adf.d.ts.map +1 -0
- package/build/core/markdown-to-adf.js +350 -0
- package/build/core/markdown-to-adf.js.map +1 -0
- package/build/core/operations.d.ts.map +1 -1
- package/build/core/operations.js +21 -0
- package/build/core/operations.js.map +1 -1
- package/build/core/sandbox.d.ts +2 -2
- package/build/core/sandbox.d.ts.map +1 -1
- package/build/core/sandbox.js +1 -1
- package/build/core/sandbox.js.map +1 -1
- package/build/core/tenant-cache.js +1 -1
- package/build/core/tenant-cache.js.map +1 -1
- package/build/core/trim-registry.d.ts.map +1 -1
- package/build/core/trim-registry.js +8 -1
- package/build/core/trim-registry.js.map +1 -1
- package/build/core/trim.d.ts +6 -4
- package/build/core/trim.d.ts.map +1 -1
- package/build/core/trim.js +18 -9
- package/build/core/trim.js.map +1 -1
- package/build/http-server.d.ts +12 -0
- package/build/http-server.d.ts.map +1 -0
- package/build/http-server.js +64 -0
- package/build/http-server.js.map +1 -0
- package/build/index.js +45 -113
- package/build/index.js.map +1 -1
- package/build/script.d.ts +4 -0
- package/build/script.d.ts.map +1 -0
- package/build/script.js +17 -0
- package/build/script.js.map +1 -0
- package/build/server.d.ts +31 -0
- package/build/server.d.ts.map +1 -0
- package/build/server.js +137 -0
- package/build/server.js.map +1 -0
- package/build/skill-dir.d.ts +3 -0
- package/build/skill-dir.d.ts.map +1 -0
- package/build/skill-dir.js +8 -0
- package/build/skill-dir.js.map +1 -0
- package/build/tools/v2/attachment-upload.d.ts +5 -0
- package/build/tools/v2/attachment-upload.d.ts.map +1 -0
- package/build/tools/v2/attachment-upload.js +57 -0
- package/build/tools/v2/attachment-upload.js.map +1 -0
- package/build/tools/v2/attachment.d.ts +5 -0
- package/build/tools/v2/attachment.d.ts.map +1 -1
- package/build/tools/v2/attachment.js +11 -1
- package/build/tools/v2/attachment.js.map +1 -1
- package/build/tools/v2/dispatcher.d.ts +1 -1
- package/build/tools/v2/dispatcher.d.ts.map +1 -1
- package/build/tools/v2/dispatcher.js +20 -8
- package/build/tools/v2/dispatcher.js.map +1 -1
- package/build/tools/v2/index.d.ts.map +1 -1
- package/build/tools/v2/index.js +19 -1
- package/build/tools/v2/index.js.map +1 -1
- package/package.json +17 -11
- package/skills/jira/SKILL.md +94 -0
- package/skills/jira/references/jql.md +37 -0
- package/skills/jira/references/refs.md +32 -0
- package/skills/jira/references/writing.md +103 -0
- package/build/cli/install-skill.d.ts +0 -10
- package/build/cli/install-skill.d.ts.map +0 -1
- package/build/cli/install-skill.js +0 -100
- package/build/cli/install-skill.js.map +0 -1
- package/build/codeapi/generator.d.ts +0 -22
- package/build/codeapi/generator.d.ts.map +0 -1
- package/build/codeapi/generator.js +0 -106
- package/build/codeapi/generator.js.map +0 -1
- package/build/codeapi/templates.d.ts +0 -17
- package/build/codeapi/templates.d.ts.map +0 -1
- package/build/codeapi/templates.js +0 -296
- package/build/codeapi/templates.js.map +0 -1
- package/build/core/http.d.ts +0 -24
- package/build/core/http.d.ts.map +0 -1
- package/build/core/http.js +0 -110
- package/build/core/http.js.map +0 -1
- package/build/core/lru.d.ts +0 -18
- package/build/core/lru.d.ts.map +0 -1
- package/build/core/lru.js +0 -57
- package/build/core/lru.js.map +0 -1
- package/build/tools/attachments.d.ts +0 -27
- package/build/tools/attachments.d.ts.map +0 -1
- package/build/tools/attachments.js +0 -98
- package/build/tools/attachments.js.map +0 -1
- package/build/tools/boards.d.ts +0 -205
- package/build/tools/boards.d.ts.map +0 -1
- package/build/tools/boards.js +0 -308
- package/build/tools/boards.js.map +0 -1
- package/build/tools/comments.d.ts +0 -134
- package/build/tools/comments.d.ts.map +0 -1
- package/build/tools/comments.js +0 -207
- package/build/tools/comments.js.map +0 -1
- package/build/tools/epics.d.ts +0 -107
- package/build/tools/epics.d.ts.map +0 -1
- package/build/tools/epics.js +0 -139
- package/build/tools/epics.js.map +0 -1
- package/build/tools/fields.d.ts +0 -59
- package/build/tools/fields.d.ts.map +0 -1
- package/build/tools/fields.js +0 -134
- package/build/tools/fields.js.map +0 -1
- package/build/tools/filters.d.ts +0 -233
- package/build/tools/filters.d.ts.map +0 -1
- package/build/tools/filters.js +0 -273
- package/build/tools/filters.js.map +0 -1
- package/build/tools/groups.d.ts +0 -109
- package/build/tools/groups.d.ts.map +0 -1
- package/build/tools/groups.js +0 -146
- package/build/tools/groups.js.map +0 -1
- package/build/tools/index.d.ts +0 -23
- package/build/tools/index.d.ts.map +0 -1
- package/build/tools/index.js +0 -138
- package/build/tools/index.js.map +0 -1
- package/build/tools/issue-links.d.ts +0 -61
- package/build/tools/issue-links.d.ts.map +0 -1
- package/build/tools/issue-links.js +0 -139
- package/build/tools/issue-links.js.map +0 -1
- package/build/tools/issues.d.ts +0 -421
- package/build/tools/issues.d.ts.map +0 -1
- package/build/tools/issues.js +0 -479
- package/build/tools/issues.js.map +0 -1
- package/build/tools/projects.d.ts +0 -353
- package/build/tools/projects.d.ts.map +0 -1
- package/build/tools/projects.js +0 -457
- package/build/tools/projects.js.map +0 -1
- package/build/tools/search.d.ts +0 -60
- package/build/tools/search.d.ts.map +0 -1
- package/build/tools/search.js +0 -103
- package/build/tools/search.js.map +0 -1
- package/build/tools/server.d.ts +0 -12
- package/build/tools/server.d.ts.map +0 -1
- package/build/tools/server.js +0 -23
- package/build/tools/server.js.map +0 -1
- package/build/tools/sprints.d.ts +0 -269
- package/build/tools/sprints.d.ts.map +0 -1
- package/build/tools/sprints.js +0 -318
- package/build/tools/sprints.js.map +0 -1
- package/build/tools/users.d.ts +0 -134
- package/build/tools/users.d.ts.map +0 -1
- package/build/tools/users.js +0 -183
- package/build/tools/users.js.map +0 -1
- package/build/tools/watchers.d.ts +0 -35
- package/build/tools/watchers.d.ts.map +0 -1
- package/build/tools/watchers.js +0 -156
- package/build/tools/watchers.js.map +0 -1
- package/build/tools/worklogs.d.ts +0 -167
- package/build/tools/worklogs.d.ts.map +0 -1
- package/build/tools/worklogs.js +0 -266
- package/build/tools/worklogs.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
# Ultra Jira MCP Server/CLI
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A token-efficient **Jira MCP server** and CLI for Claude, ChatGPT, Cursor, Cline, and any other Model Context Protocol (MCP) client. Gives AI agents full access to **Jira Cloud** via the REST API v3 and Agile API 1.0 — without burning your context window on Jira's verbose JSON.
|
|
4
|
+
|
|
5
|
+
Built for the way real teams use AI agents with Jira: triaging tickets, planning sprints, summarizing comment threads, drafting status updates, running JQL searches, moving issues through workflows — not just for engineers writing code. If your agent talks to Jira, this server keeps it fast and cheap.
|
|
6
|
+
|
|
7
|
+
**Keywords:** Jira MCP server, Jira Cloud MCP, Claude Jira integration, ChatGPT Jira, Cursor Jira, Cline Jira, Atlassian MCP, AI agent for Jira, JQL agent, sprint management AI, ticket triage AI.
|
|
8
|
+
|
|
9
|
+
## Why this over other Jira MCP servers
|
|
10
|
+
|
|
11
|
+
Most Jira MCP servers wrap the REST API one endpoint per tool and pass raw responses straight to the agent. That works on toy tickets and falls over the moment you point it at a real backlog. Here's what `ultra-jira-mcp` does differently:
|
|
12
|
+
|
|
13
|
+
- **~17× smaller per-call responses.** A real "investigate this ticket with its comments" call drops from **270 KB (~67k tokens)** of raw Jira JSON to **15 KB (~3,900 tokens)** — same description, comments, subtasks, and links, just without Jira's `self` URLs, icon URLs, nested schema metadata, and ADF rich-text ASTs. See [docs/BENCHMARK.md](docs/BENCHMARK.md) for the full table.
|
|
14
|
+
- **Up to 99× smaller tool-list cost** (the bytes paid into your context window on *every* conversation, before the agent has done anything). 16 consolidated tools instead of 80+ thin ones; optional `code-api` mode collapses that to a single tool that hands the agent a shell binary.
|
|
15
|
+
- **Full responses are never lost** — they're written to a session-scoped temp dir and referenced by path. The agent reads the trimmed summary by default and `cat`s the full payload only when it actually needs the detail.
|
|
16
|
+
- **ADF flattening built in.** Atlassian Document Format trees become plain text on the way out, so a 500-byte comment doesn't arrive as a 4 KB nested AST.
|
|
17
|
+
- **Works as a standalone CLI too.** The same `jira-cli` binary runs without any MCP server in the picture — drop it in a script, a CI job, or a non-MCP agent framework.
|
|
18
|
+
- **Deletes ask first.** Hosts grant permissions per tool, so allowing `jira_issue` (or `jira-cli`) allows its deletes too. By default the server asks you to confirm every delete and removal through the client's prompt (`JIRA_CONFIRM_ACTIONS`); in code-api mode the CLI gets a one-time `--confirm-token` after you agree.
|
|
19
|
+
- **Tool surface you can prune.** `JIRA_ENABLED_CATEGORIES` and `JIRA_DISABLED_ACTIONS` let you whitelist only the operations your agent should see (and *block* destructive ones like `issue.delete` at the dispatch layer, not just hide them from the schema).
|
|
20
|
+
- **Covers REST v3 and Agile API 1.0.** Issues, comments, worklogs, attachments, users, projects, **boards, sprints, epics**, filters, links, watchers/votes, fields, groups. Not just CRUD on issues.
|
|
21
|
+
- **Ships a Claude Code skill.** The server serves `skills/jira` over the MCP skills extension, so Claude Code loads it on demand from the server itself; `jira-cli install-skill` writes the same files under `~/.claude/skills/jira/` for hosts that can't load skills from servers.
|
|
22
|
+
|
|
23
|
+
If you're building anything beyond a demo — an agent that lives in a Slack channel triaging incoming tickets, a sprint-planning assistant that reads three boards, a release-notes drafter that scans a JQL filter — the per-call savings dominate every conversation longer than a handful of calls.
|
|
24
|
+
|
|
25
|
+
## Use cases
|
|
26
|
+
|
|
27
|
+
This isn't only for coding agents. Anywhere an LLM talks to Jira:
|
|
28
|
+
|
|
29
|
+
- **Ticket triage and routing** — agent reads new issues, classifies, assigns, sets priority.
|
|
30
|
+
- **Sprint planning and retros** — pull the backlog, summarize blockers, draft sprint goals.
|
|
31
|
+
- **Status reporting** — JQL → trimmed list → human-readable update for Slack, email, or a Confluence page.
|
|
32
|
+
- **Comment thread summarization** — long discussion threads collapse to the decisions and open questions.
|
|
33
|
+
- **Workflow automation** — agent moves issues through transitions, assigns reviewers, links related work.
|
|
34
|
+
- **Incident and bug investigation** — agent pulls a rich ticket with all comments, attachments, and linked issues in one trimmed response.
|
|
35
|
+
- **Cross-tool workflows** — pair with Confluence, GitHub, Slack, or Bitbucket MCP servers to drive end-to-end flows.
|
|
36
|
+
- **Coding agents** — yes, this too. Claude Code, Cursor, Cline, and friends can pick up tickets, implement them, and update status without flooding context.
|
|
4
37
|
|
|
5
38
|
## Installation
|
|
6
39
|
|
|
@@ -27,6 +60,7 @@ Set these environment variables on the server process. With Claude Desktop or Cl
|
|
|
27
60
|
| `JIRA_TOOL_MODE` | `"classic"` (default — 16 consolidated tools) or `"code-api"` (one tool, agent drives via the bundled `jira-cli` shell binary) | No |
|
|
28
61
|
| `JIRA_ENABLED_CATEGORIES` | Comma-separated category whitelist. Empty = all 16 categories enabled. | No |
|
|
29
62
|
| `JIRA_DISABLED_ACTIONS` | Comma-separated `category.action` blacklist. Enforced at the dispatch layer in **both** modes. | No |
|
|
63
|
+
| `JIRA_CONFIRM_ACTIONS` | Operations that ask the user before running. Unset: the 11 deletes and removals (`issue.delete`, `project.delete`, `comment.delete`, …). An explicit list replaces that; empty turns confirmation off. Clients that can't show a prompt run the operation as before. `issue.delete` and `project.delete` ask you to type the key back. | No |
|
|
30
64
|
|
|
31
65
|
### Claude Desktop / Claude Code setup
|
|
32
66
|
|
|
@@ -48,6 +82,89 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
|
|
|
48
82
|
}
|
|
49
83
|
```
|
|
50
84
|
|
|
85
|
+
### Docker
|
|
86
|
+
|
|
87
|
+
To keep `npm ci` and dependency install scripts off your machine, build the image from a checkout:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
docker build -t ultra-jira-mcp .
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Then point your MCP client at `docker run`. Each `-e NAME` flag (no value) passes that variable through from the `env` block, so the token never appears in the container's command line:
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"mcpServers": {
|
|
98
|
+
"jira": {
|
|
99
|
+
"command": "docker",
|
|
100
|
+
"args": [
|
|
101
|
+
"run", "-i", "--rm", "--init",
|
|
102
|
+
"-v", "/tmp/jira-mcp:/tmp/jira-mcp",
|
|
103
|
+
"-e", "JIRA_HOST", "-e", "JIRA_EMAIL", "-e", "JIRA_API_TOKEN",
|
|
104
|
+
"ultra-jira-mcp"
|
|
105
|
+
],
|
|
106
|
+
"env": {
|
|
107
|
+
"JIRA_HOST": "https://yourcompany.atlassian.net",
|
|
108
|
+
"JIRA_EMAIL": "your-email@example.com",
|
|
109
|
+
"JIRA_API_TOKEN": "your-api-token"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
- The `/tmp/jira-mcp` mount puts the full responses at the same path on the host, so the `ref: /path` in each summary stays readable by the agent.
|
|
117
|
+
- Pass `JIRA_CLOUD_ID`, `JIRA_ENABLED_CATEGORIES` or `JIRA_DISABLED_ACTIONS` the same way (`-e NAME` plus an `env` entry) if you use them.
|
|
118
|
+
- Use classic mode. code-api mode hands the agent a CLI path and a unix socket inside the container, which a host shell can't reach.
|
|
119
|
+
|
|
120
|
+
### Shared HTTP server
|
|
121
|
+
|
|
122
|
+
By default every MCP client session starts its own server over stdio. With `JIRA_MCP_TRANSPORT=http`, one long-running server answers all of your sessions over streamable HTTP. It needs no Jira credentials of its own: each session sends its email and API token as request headers and gets its own Jira client.
|
|
123
|
+
|
|
124
|
+
| Variable | Description | Default |
|
|
125
|
+
|---|---|---|
|
|
126
|
+
| `JIRA_MCP_TRANSPORT` | `stdio` or `http` | `stdio` |
|
|
127
|
+
| `JIRA_MCP_HTTP_HOST` | Address the HTTP server listens on | `127.0.0.1` |
|
|
128
|
+
| `JIRA_MCP_HTTP_PORT` | Port the HTTP server listens on | `18001` |
|
|
129
|
+
|
|
130
|
+
In HTTP mode the server needs `JIRA_HOST`, plus `JIRA_CLOUD_ID`, `JIRA_ENABLED_CATEGORIES` and `JIRA_DISABLED_ACTIONS` if you use them. It ignores `JIRA_EMAIL` and `JIRA_API_TOKEN`. It serves classic mode only and refuses to start with `JIRA_TOOL_MODE=code-api`.
|
|
131
|
+
|
|
132
|
+
Run it in Docker, published on the host's loopback only:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
docker run -d --name jira-mcp --restart unless-stopped \
|
|
136
|
+
-p 127.0.0.1:18001:18001 \
|
|
137
|
+
-v /tmp/jira-mcp:/tmp/jira-mcp \
|
|
138
|
+
-e JIRA_MCP_TRANSPORT=http -e JIRA_MCP_HTTP_HOST=0.0.0.0 \
|
|
139
|
+
-e JIRA_HOST=https://yourcompany.atlassian.net \
|
|
140
|
+
ultra-jira-mcp
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Then point each Claude Code session at it, in `~/.claude.json`:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"mcpServers": {
|
|
148
|
+
"jira": {
|
|
149
|
+
"type": "http",
|
|
150
|
+
"url": "http://127.0.0.1:18001/mcp",
|
|
151
|
+
"headers": {
|
|
152
|
+
"Jira-Email": "your-email@example.com",
|
|
153
|
+
"Jira-Api-Token": "${JIRA_API_TOKEN}"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Claude Code fills in `${JIRA_API_TOKEN}` from the environment it was started in, so the token stays out of the config file.
|
|
161
|
+
|
|
162
|
+
- `JIRA_MCP_HTTP_HOST=0.0.0.0` is for inside a container only. Outside one, keep the `127.0.0.1` default.
|
|
163
|
+
- The server only accepts requests whose `Host` is `localhost`, `127.0.0.1` or `[::1]` at the port it listens on, which blocks DNS rebinding from a web page. Publish the same port number on the host as inside the container.
|
|
164
|
+
- A session keeps the credentials it started with. A later request in that session with a different `Jira-Email` or `Jira-Api-Token` gets a 403. A new session without both headers gets a 401.
|
|
165
|
+
- Clients on the stateless 2026-07-28 MCP protocol don't open sessions: every request carries both headers and gets its own Jira client, and a request without them gets a 401. The server speaks both that revision and 2025-11-25, over HTTP and stdio.
|
|
166
|
+
- All sessions run in one process, so they share its files: whatever the server writes goes to one session directory under `/tmp/jira-mcp`, and the attachment upload action can read any file the server can. Run one shared server per person rather than one for a team.
|
|
167
|
+
|
|
51
168
|
## Tool surface
|
|
52
169
|
|
|
53
170
|
Default mode is **classic**: 16 consolidated MCP tools, each taking an `action` argument plus action-specific args. For example `jira_issue` covers `get`, `create`, `update`, `delete`, `bulkCreate`, `listTransitions`, `transition`, `assign`, `changelog` — discriminated by `action: "..."`.
|
|
@@ -110,10 +227,14 @@ Set `JIRA_TOOL_MODE=code-api` to expose a single MCP tool, `jira_code_api`. Call
|
|
|
110
227
|
JIRA_MCP_SOCKET=/tmp/jira-mcp/${session}/ipc.sock \
|
|
111
228
|
node <cli-path> issue.get --issueIdOrKey=PROJ-1
|
|
112
229
|
# stdout: trimmed summary as JSON, then a final `ref: /path` line
|
|
113
|
-
# pointing at the full response on disk
|
|
230
|
+
# pointing at the full response on disk.
|
|
114
231
|
```
|
|
115
232
|
|
|
116
|
-
Discovery: `node <cli-path> --help` lists
|
|
233
|
+
Discovery: `node <cli-path> --help` lists the categories with their operation names (2.3 KB; `--help --all` is the full 7.8 KB listing), `<category> --help` describes a category's operations, and `<op> --help` lists an operation's flags.
|
|
234
|
+
|
|
235
|
+
`--select=key,status,assignee.displayName` prints only those fields of the summary; `--select-from=ref` selects from the full response instead. People in issue, comment, and search summaries carry `accountId` and `displayName` but not their email; the `user.*` lookups and the full response still have it.
|
|
236
|
+
|
|
237
|
+
For several calls, import the script module (`module` in the `jira_code_api` response, `build/script.js` in the package): `call(op, args)` resolves to the same `{ summary, ref }` from one Node process, so loops and joins skip a CLI startup per call. Ten parallel `issue.get` calls took 0.46 s, against 3.5 s as ten `jira-cli` runs.
|
|
117
238
|
|
|
118
239
|
Stays as `classic` by default because tool-only MCP clients (no shell access) can't drive `jira-cli`. See [docs/MIGRATION.md](docs/MIGRATION.md#code-api-mode) for the full flow.
|
|
119
240
|
|
|
@@ -125,18 +246,20 @@ The same `jira-cli` binary works without an MCP server. Set `JIRA_HOST` / `JIRA_
|
|
|
125
246
|
export JIRA_HOST=https://yourcompany.atlassian.net
|
|
126
247
|
export JIRA_EMAIL=you@example.com
|
|
127
248
|
export JIRA_API_TOKEN=...
|
|
128
|
-
npx -y -p github:
|
|
249
|
+
npx -y -p github:criblio/ultra-jira-mcp jira-cli issue.get --issueIdOrKey=PROJ-1
|
|
129
250
|
```
|
|
130
251
|
|
|
131
252
|
The CLI auto-selects between **bridge mode** (`JIRA_MCP_SOCKET` set, talks to a running server) and **direct mode** (no socket, builds a `JiraClient` in-process). Same trim + ref output either way; credentials never leave the CLI's `process.env`, so they don't enter the agent's context.
|
|
132
253
|
|
|
133
|
-
|
|
254
|
+
The server serves its skill (`skills/jira`: `SKILL.md` plus references for writing tickets, JQL, and reading full responses) over the MCP skills extension. Clients that support it, such as Claude Code, load it from the server on demand, always matching the running version.
|
|
255
|
+
|
|
256
|
+
For hosts that can't load skills from servers (`claude -p`, the Agent SDK, other agents), install the same files once:
|
|
134
257
|
|
|
135
258
|
```bash
|
|
136
|
-
npx -y -p github:
|
|
259
|
+
npx -y -p github:criblio/ultra-jira-mcp jira-cli install-skill
|
|
137
260
|
```
|
|
138
261
|
|
|
139
|
-
This writes `~/.claude/skills/jira
|
|
262
|
+
This writes `~/.claude/skills/jira/`. `--check` reports whether an installed copy is out of date (exit 1), `--force` updates it, and `--print` dumps the files without writing. If your client loads the skill from the server, remove an installed copy so the agent doesn't see two.
|
|
140
263
|
|
|
141
264
|
## Resources
|
|
142
265
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type TransportFn } from "ultra-mcp-toolkit/transport";
|
|
1
2
|
import { JiraConfig } from "../config.js";
|
|
2
3
|
export interface JiraRequestOptions {
|
|
3
4
|
method?: "GET" | "POST" | "PUT" | "DELETE";
|
|
@@ -18,7 +19,8 @@ export declare class JiraClient {
|
|
|
18
19
|
private cloudId;
|
|
19
20
|
private initPromise;
|
|
20
21
|
private readonly metadataCache;
|
|
21
|
-
|
|
22
|
+
private readonly transportFn;
|
|
23
|
+
constructor(config: JiraConfig, transportFn?: TransportFn);
|
|
22
24
|
/**
|
|
23
25
|
* Initialize the client by fetching the cloudId if needed (for scoped tokens)
|
|
24
26
|
*/
|
|
@@ -45,6 +47,17 @@ export declare class JiraClient {
|
|
|
45
47
|
* expose this value to a response payload or log.
|
|
46
48
|
*/
|
|
47
49
|
getAuthorizationHeader(): string;
|
|
50
|
+
/**
|
|
51
|
+
* Build the fully-resolved URL for an issue's attachment-upload
|
|
52
|
+
* endpoint. Attachment upload is a multipart side-channel (see
|
|
53
|
+
* core/attachments.ts) that bypasses the JSON request pipeline, so
|
|
54
|
+
* it can't go through `post()`. It still needs the same token-type +
|
|
55
|
+
* cloudId-aware base URL the rest of the client uses — exposing it
|
|
56
|
+
* here keeps `buildUrl`'s scoped-vs-classic logic in one place rather
|
|
57
|
+
* than re-derived in the uploader. Awaits init so a scoped token has
|
|
58
|
+
* its cloudId before the URL is built.
|
|
59
|
+
*/
|
|
60
|
+
attachmentUploadUrl(issueIdOrKey: string): Promise<string>;
|
|
48
61
|
private metadataCacheKey;
|
|
49
62
|
private request;
|
|
50
63
|
get<T>(path: string, queryParams?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jira-client.d.ts","sourceRoot":"","sources":["../../src/auth/jira-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jira-client.d.ts","sourceRoot":"","sources":["../../src/auth/jira-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG5E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAA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G,OAAO,GAAG,SAAS,CAAC,GAClE,OAAO,CAAC,CAAC,CAAC,CAEZ;IAEK,WAAW,CAAC,CAAC,EACjB,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,GAClE,OAAO,CAAC,CAAC,CAAC,CAEZ;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { httpRequest } from "
|
|
2
|
-
import { TtlLruCache } from "
|
|
1
|
+
import { httpRequest } from "ultra-mcp-toolkit/transport";
|
|
2
|
+
import { TtlLruCache } from "ultra-mcp-toolkit/lru";
|
|
3
3
|
import { readTenantCache, writeTenantCache } from "../core/tenant-cache.js";
|
|
4
4
|
export class JiraApiError extends Error {
|
|
5
5
|
statusCode;
|
|
@@ -31,8 +31,11 @@ export class JiraClient {
|
|
|
31
31
|
maxSize: METADATA_MAX_SIZE,
|
|
32
32
|
ttlMs: METADATA_TTL_MS,
|
|
33
33
|
});
|
|
34
|
-
|
|
34
|
+
transportFn;
|
|
35
|
+
// transportFn lets a caller swap out how requests actually go over
|
|
36
|
+
constructor(config, transportFn = httpRequest) {
|
|
35
37
|
this.config = config;
|
|
38
|
+
this.transportFn = transportFn;
|
|
36
39
|
// If cloudId is provided in config, use it directly
|
|
37
40
|
if (config.cloudId) {
|
|
38
41
|
this.cloudId = config.cloudId;
|
|
@@ -81,7 +84,7 @@ export class JiraClient {
|
|
|
81
84
|
// Cache read failure is non-fatal — fall through to the network.
|
|
82
85
|
}
|
|
83
86
|
const tenantInfoUrl = `${this.config.host}/_edge/tenant_info`;
|
|
84
|
-
const response = await
|
|
87
|
+
const response = await this.transportFn(tenantInfoUrl, {
|
|
85
88
|
method: "GET",
|
|
86
89
|
headers: { Accept: "application/json" },
|
|
87
90
|
});
|
|
@@ -154,6 +157,20 @@ export class JiraClient {
|
|
|
154
157
|
getAuthorizationHeader() {
|
|
155
158
|
return this.getAuthHeader();
|
|
156
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Build the fully-resolved URL for an issue's attachment-upload
|
|
162
|
+
* endpoint. Attachment upload is a multipart side-channel (see
|
|
163
|
+
* core/attachments.ts) that bypasses the JSON request pipeline, so
|
|
164
|
+
* it can't go through `post()`. It still needs the same token-type +
|
|
165
|
+
* cloudId-aware base URL the rest of the client uses — exposing it
|
|
166
|
+
* here keeps `buildUrl`'s scoped-vs-classic logic in one place rather
|
|
167
|
+
* than re-derived in the uploader. Awaits init so a scoped token has
|
|
168
|
+
* its cloudId before the URL is built.
|
|
169
|
+
*/
|
|
170
|
+
async attachmentUploadUrl(issueIdOrKey) {
|
|
171
|
+
await this.ensureInitialized();
|
|
172
|
+
return this.buildUrl(`/issue/${issueIdOrKey}/attachments`);
|
|
173
|
+
}
|
|
157
174
|
metadataCacheKey(path, queryParams, isAgile) {
|
|
158
175
|
if (isAgile)
|
|
159
176
|
return null;
|
|
@@ -186,7 +203,7 @@ export class JiraClient {
|
|
|
186
203
|
if (body) {
|
|
187
204
|
headers["Content-Type"] = "application/json";
|
|
188
205
|
}
|
|
189
|
-
const response = await
|
|
206
|
+
const response = await this.transportFn(url, {
|
|
190
207
|
method,
|
|
191
208
|
headers,
|
|
192
209
|
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jira-client.js","sourceRoot":"","sources":["../../src/auth/jira-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"jira-client.js","sourceRoot":"","sources":["../../src/auth/jira-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAc5E,MAAM,OAAO,YAAa,SAAQ,KAAK;I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;IAED,6BAA6B;IAC7B,KAAK,CAAC,QAAQ,CACZ,IAAY,EACZ,WAAmE;QAEnE,OAAO,IAAI,CAAC,OAAO,CAAI,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,SAAS,CACb,IAAY,EACZ,IAAc,EACd,WAAmE;QAEnE,OAAO,IAAI,CAAC,OAAO,CAAI,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,IAAY,EACZ,IAAc,EACd,WAAmE;QAEnE,OAAO,IAAI,CAAC,OAAO,CAAI,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,WAAW,CACf,IAAY,EACZ,WAAmE;QAEnE,OAAO,IAAI,CAAC,OAAO,CAAI,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;IACxE,CAAC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const SOCKET_ENV = "JIRA_MCP_SOCKET";
|
|
2
|
+
export declare class NotConnectedError extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
export declare function notConnectedMessage(missing: readonly string[]): string;
|
|
6
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/cli/connection.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,UAAU,oBAAoB,CAAC;AAG5C,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAatE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Agent-facing error for "jira-cli can't reach Jira".
|
|
2
|
+
//
|
|
3
|
+
// In code-api sessions jira-cli reaches Jira through the MCP server's
|
|
4
|
+
// bridge. It finds the bridge from JIRA_MCP_SOCKET or, since host shells
|
|
5
|
+
// don't inherit that from the server, through the toolkit's discovery
|
|
6
|
+
// records. When neither finds a server, the CLI falls back to direct
|
|
7
|
+
// mode; a bare "missing JIRA_API_TOKEN" there made agents conclude they
|
|
8
|
+
// had no Jira access and switch to other Jira tools. So this message
|
|
9
|
+
// leads with the server, because that's the usual fix.
|
|
10
|
+
export const SOCKET_ENV = "JIRA_MCP_SOCKET";
|
|
11
|
+
const CODE_API_TOOL = "jira_code_api";
|
|
12
|
+
export class NotConnectedError extends Error {
|
|
13
|
+
constructor(message) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = "NotConnected";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export function notConnectedMessage(missing) {
|
|
19
|
+
return [
|
|
20
|
+
`No running jira MCP server was found for this session (${SOCKET_ENV} is unset),`,
|
|
21
|
+
`and direct mode is missing ${missing.join(", ")}.`,
|
|
22
|
+
"",
|
|
23
|
+
`If the jira MCP server is connected in this session, it has a ${CODE_API_TOOL} tool:`,
|
|
24
|
+
`call it and rerun this command prefixed with the ${SOCKET_ENV}=<socketAddress> it returns.`,
|
|
25
|
+
"Every shell command needs the prefix; it doesn't carry over between commands.",
|
|
26
|
+
"Use that rather than switching to a different Jira client.",
|
|
27
|
+
"",
|
|
28
|
+
"For standalone use without an MCP server, set JIRA_HOST, JIRA_EMAIL, and JIRA_API_TOKEN",
|
|
29
|
+
"in the environment or a .env.local file in the working directory.",
|
|
30
|
+
].join("\n");
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/cli/connection.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,EAAE;AACF,sEAAsE;AACtE,yEAAyE;AACzE,sEAAsE;AACtE,qEAAqE;AACrE,wEAAwE;AACxE,qEAAqE;AACrE,uDAAuD;AAEvD,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAC5C,MAAM,aAAa,GAAG,eAAe,CAAC;AAEtC,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AAED,MAAM,UAAU,mBAAmB,CAAC,OAA0B;IAC5D,OAAO;QACL,0DAA0D,UAAU,aAAa;QACjF,8BAA8B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;QACnD,EAAE;QACF,iEAAiE,aAAa,QAAQ;QACtF,oDAAoD,UAAU,8BAA8B;QAC5F,+EAA+E;QAC/E,4DAA4D;QAC5D,EAAE;QACF,yFAAyF;QACzF,mEAAmE;KACpE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direct.d.ts","sourceRoot":"","sources":["../../src/cli/direct.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"direct.d.ts","sourceRoot":"","sources":["../../src/cli/direct.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,gBAAiB,SAAQ,aAAa,CAAC,OAAO,CAAC;CAAG;AAUnE,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAsB3B"}
|
package/build/cli/direct.js
CHANGED
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
// the difference is just *where* the JiraClient lives (in this
|
|
26
26
|
// process vs. in the MCP server's process).
|
|
27
27
|
import { JiraClient } from "../auth/jira-client.js";
|
|
28
|
-
import { getConfig } from "../config.js";
|
|
28
|
+
import { getConfig, MissingConfigError } from "../config.js";
|
|
29
|
+
import { NotConnectedError, notConnectedMessage } from "./connection.js";
|
|
29
30
|
import { operations } from "../core/operations.js";
|
|
30
31
|
import { invokeAndSandbox } from "../codeapi/bridge.js";
|
|
31
32
|
// Run one operation against the local JiraClient and return the
|
|
@@ -38,9 +39,19 @@ import { invokeAndSandbox } from "../codeapi/bridge.js";
|
|
|
38
39
|
// gets the same guarantee in direct mode.
|
|
39
40
|
export async function callDirect(operation, args) {
|
|
40
41
|
// getConfig() loads .env / .env.local (via dotenv), validates the
|
|
41
|
-
// required Jira creds, and returns a JiraConfig.
|
|
42
|
-
//
|
|
43
|
-
|
|
42
|
+
// required Jira creds, and returns a JiraConfig. Missing creds are
|
|
43
|
+
// re-raised as NotConnectedError: reaching direct mode means
|
|
44
|
+
// JIRA_MCP_SOCKET was unset too, and that's usually the real fix.
|
|
45
|
+
let config;
|
|
46
|
+
try {
|
|
47
|
+
config = getConfig();
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
if (err instanceof MissingConfigError) {
|
|
51
|
+
throw new NotConnectedError(notConnectedMessage(err.missing));
|
|
52
|
+
}
|
|
53
|
+
throw err;
|
|
54
|
+
}
|
|
44
55
|
const client = new JiraClient(config);
|
|
45
56
|
return invokeAndSandbox(operations, client, operation, args, config.toolFilter.disabledActions);
|
|
46
57
|
}
|
package/build/cli/direct.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direct.js","sourceRoot":"","sources":["../../src/cli/direct.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,oEAAoE;AACpE,qEAAqE;AACrE,kEAAkE;AAClE,EAAE;AACF,mEAAmE;AACnE,6DAA6D;AAC7D,+DAA+D;AAC/D,qEAAqE;AACrE,mEAAmE;AACnE,8BAA8B;AAC9B,EAAE;AACF,mBAAmB;AACnB,kEAAkE;AAClE,iEAAiE;AACjE,sBAAsB;AACtB,iEAAiE;AACjE,sEAAsE;AACtE,gBAAgB;AAChB,EAAE;AACF,gEAAgE;AAChE,qEAAqE;AACrE,kEAAkE;AAClE,+DAA+D;AAC/D,4CAA4C;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"direct.js","sourceRoot":"","sources":["../../src/cli/direct.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,oEAAoE;AACpE,qEAAqE;AACrE,kEAAkE;AAClE,EAAE;AACF,mEAAmE;AACnE,6DAA6D;AAC7D,+DAA+D;AAC/D,qEAAqE;AACrE,mEAAmE;AACnE,8BAA8B;AAC9B,EAAE;AACF,mBAAmB;AACnB,kEAAkE;AAClE,iEAAiE;AACjE,sBAAsB;AACtB,iEAAiE;AACjE,sEAAsE;AACtE,gBAAgB;AAChB,EAAE;AACF,gEAAgE;AAChE,qEAAqE;AACrE,kEAAkE;AAClE,+DAA+D;AAC/D,4CAA4C;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAKxD,gEAAgE;AAChE,oEAAoE;AACpE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,SAAiB,EACjB,IAA6B;IAE7B,kEAAkE;IAClE,mEAAmE;IACnE,6DAA6D;IAC7D,kEAAkE;IAClE,IAAI,MAAM,CAAC;IACX,IAAI,CAAC;QACH,MAAM,GAAG,SAAS,EAAE,CAAC;IACvB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,kBAAkB,EAAE,CAAC;YACtC,MAAM,IAAI,iBAAiB,CAAC,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QAChE,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,OAAO,gBAAgB,CACrB,UAAU,EACV,MAAM,EACN,SAAS,EACT,IAAI,EACJ,MAAM,CAAC,UAAU,CAAC,eAAe,CAClC,CAAC;AACJ,CAAC"}
|
package/build/cli/index.js
CHANGED
|
@@ -3,24 +3,29 @@
|
|
|
3
3
|
//
|
|
4
4
|
// All argv parsing, help rendering, bridge round-trip, install-skill
|
|
5
5
|
// dispatch, and the trimmed-summary + `ref:` stdout layout live in
|
|
6
|
-
//
|
|
6
|
+
// `ultra-mcp-toolkit/cli`. This file wires in the Jira-specific
|
|
7
7
|
// bits: the operation manifest, the direct-mode handler (which builds
|
|
8
8
|
// a JiraClient in-process when no socket is configured), the SKILL.md
|
|
9
9
|
// content, and the env vars to mention in the help text.
|
|
10
|
-
import { createCli } from "
|
|
10
|
+
import { createCli } from "ultra-mcp-toolkit/cli";
|
|
11
11
|
import { operations } from "../core/operations.js";
|
|
12
|
+
import { SOCKET_ENV } from "./connection.js";
|
|
12
13
|
import { callDirect } from "./direct.js";
|
|
13
|
-
import {
|
|
14
|
+
import { JIRA_SKILL_DIR } from "../skill-dir.js";
|
|
15
|
+
const argv = process.argv.slice(2);
|
|
14
16
|
const cli = createCli({
|
|
15
17
|
cliName: "jira-cli",
|
|
16
|
-
socketEnvVar:
|
|
18
|
+
socketEnvVar: SOCKET_ENV,
|
|
19
|
+
// Named in the toolkit's errors when no server can be reached.
|
|
20
|
+
codeApiToolName: "jira_code_api",
|
|
17
21
|
manifest: operations,
|
|
18
22
|
callDirect,
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
// Same directory the server serves over MCP; installs into
|
|
24
|
+
// ~/.claude/skills/jira for hosts that don't load skills from servers.
|
|
25
|
+
skillDir: JIRA_SKILL_DIR,
|
|
21
26
|
directModeEnvVars: ["JIRA_HOST", "JIRA_EMAIL", "JIRA_API_TOKEN"],
|
|
22
27
|
});
|
|
23
|
-
void cli.run(
|
|
28
|
+
void cli.run(argv).then((code) => process.exit(code), (err) => {
|
|
24
29
|
process.stderr.write(`jira-cli: unexpected error: ${err.stack ?? err}\n`);
|
|
25
30
|
process.exit(1);
|
|
26
31
|
});
|
package/build/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,oCAAoC;AACpC,EAAE;AACF,qEAAqE;AACrE,mEAAmE;AACnE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,oCAAoC;AACpC,EAAE;AACF,qEAAqE;AACrE,mEAAmE;AACnE,gEAAgE;AAChE,sEAAsE;AACtE,sEAAsE;AACtE,yDAAyD;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,MAAM,GAAG,GAAG,SAAS,CAAC;IACpB,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,UAAU;IACxB,+DAA+D;IAC/D,eAAe,EAAE,eAAe;IAChC,QAAQ,EAAE,UAAU;IACpB,UAAU;IACV,2DAA2D;IAC3D,uEAAuE;IACvE,QAAQ,EAAE,cAAc;IACxB,iBAAiB,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,gBAAgB,CAAC;CACjE,CAAC,CAAC;AAEH,KAAK,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CACrB,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAC5B,CAAC,GAAG,EAAE,EAAE;IACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,+BAAgC,GAAa,CAAC,KAAK,IAAI,GAAG,IAAI,CAC/D,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CACF,CAAC"}
|
package/build/codeapi/boot.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { JiraClient } from "../auth/jira-client.js";
|
|
2
|
+
import { type DiscoveryOpts } from "ultra-mcp-toolkit/bridge";
|
|
2
3
|
import { type BridgeServer } from "./bridge.js";
|
|
3
|
-
import type {
|
|
4
|
+
import type { ConfirmTokens } from "ultra-mcp-toolkit/confirm";
|
|
5
|
+
import { type CodeApiToolContext } from "./tool.js";
|
|
4
6
|
export declare function defaultCliPath(): string;
|
|
7
|
+
export declare function defaultModulePath(): string;
|
|
5
8
|
export interface BootedCodeApi {
|
|
6
9
|
bridge: BridgeServer;
|
|
7
10
|
ctx: CodeApiToolContext;
|
|
@@ -9,7 +12,13 @@ export interface BootedCodeApi {
|
|
|
9
12
|
export interface BootCodeApiOpts {
|
|
10
13
|
client: JiraClient;
|
|
11
14
|
disabledActions?: readonly string[];
|
|
15
|
+
confirm?: {
|
|
16
|
+
actions: readonly string[];
|
|
17
|
+
tokens: ConfirmTokens;
|
|
18
|
+
};
|
|
12
19
|
cliPath?: string;
|
|
20
|
+
modulePath?: string;
|
|
21
|
+
discovery?: false | Omit<DiscoveryOpts, "namespace">;
|
|
13
22
|
cleanupSessions?: boolean;
|
|
14
23
|
}
|
|
15
24
|
export declare function bootCodeApi(opts: BootCodeApiOpts): Promise<BootedCodeApi>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../src/codeapi/boot.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../src/codeapi/boot.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGpF,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAA2B,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAM7E,wBAAgB,cAAc,IAAI,MAAM,CAGvC;AAID,wBAAgB,iBAAiB,IAAI,MAAM,CAG1C;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,GAAG,EAAE,kBAAkB,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,UAAU,CAAC;IAInB,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAGpC,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,aAAa,CAAA;KAAE,CAAC;IAEhE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,SAAS,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAIrD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAsB,WAAW,CAC/B,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,aAAa,CAAC,CA8CxB"}
|
package/build/codeapi/boot.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
// 1. Sweep stale session dirs (>24h old) under the cache root.
|
|
6
6
|
// 2. Resolve the bundled `jira-cli` binary path relative to this
|
|
7
7
|
// compiled module's location.
|
|
8
|
-
// 3. Start the IPC bridge
|
|
9
|
-
//
|
|
10
|
-
//
|
|
8
|
+
// 3. Start the IPC bridge, set `JIRA_MCP_SOCKET` in this process's
|
|
9
|
+
// env, and publish the address for discovery so `jira-cli` finds
|
|
10
|
+
// the bridge from a host shell, which doesn't inherit our env.
|
|
11
11
|
//
|
|
12
12
|
// The toolkit ships a `bootCodeApi` helper that does steps (1) and (3)
|
|
13
13
|
// generically, but jira-mcp's bridge needs an explicit socket-prefix
|
|
@@ -19,7 +19,10 @@ import * as path from "node:path";
|
|
|
19
19
|
import { fileURLToPath } from "node:url";
|
|
20
20
|
import { operations } from "../core/operations.js";
|
|
21
21
|
import { jiraSandbox } from "../core/sandbox.js";
|
|
22
|
+
import { publishBridgeAddress } from "ultra-mcp-toolkit/bridge";
|
|
23
|
+
import { SOCKET_ENV } from "../cli/connection.js";
|
|
22
24
|
import { startBridge } from "./bridge.js";
|
|
25
|
+
import { JIRA_CODE_API_TOOL_NAME } from "./tool.js";
|
|
23
26
|
// Resolves to build/cli/index.js at runtime. This module compiles to
|
|
24
27
|
// build/codeapi/boot.js, so "../cli/index.js" lands at build/cli/index.js.
|
|
25
28
|
// The CLI is what code-api mode hands to the agent — a single
|
|
@@ -28,6 +31,12 @@ export function defaultCliPath() {
|
|
|
28
31
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
29
32
|
return path.join(here, "..", "cli", "index.js");
|
|
30
33
|
}
|
|
34
|
+
// build/script.js: the script module (src/script.ts) agents import to
|
|
35
|
+
// run several operations in one process.
|
|
36
|
+
export function defaultModulePath() {
|
|
37
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
38
|
+
return path.join(here, "..", "script.js");
|
|
39
|
+
}
|
|
31
40
|
export async function bootCodeApi(opts) {
|
|
32
41
|
if (opts.cleanupSessions !== false) {
|
|
33
42
|
await jiraSandbox.cleanupStaleSessions().catch(() => {
|
|
@@ -40,14 +49,35 @@ export async function bootCodeApi(opts) {
|
|
|
40
49
|
manifest: operations,
|
|
41
50
|
client: opts.client,
|
|
42
51
|
disabledActions: opts.disabledActions,
|
|
52
|
+
...(opts.confirm && opts.confirm.actions.length > 0
|
|
53
|
+
? { confirm: { ...opts.confirm, toolName: JIRA_CODE_API_TOOL_NAME } }
|
|
54
|
+
: {}),
|
|
43
55
|
});
|
|
44
|
-
//
|
|
45
|
-
// Code's Bash tool,
|
|
46
|
-
//
|
|
47
|
-
|
|
56
|
+
// Children of this process inherit the variable. Host shells
|
|
57
|
+
// (Claude Code's Bash tool) are siblings, so they find the bridge
|
|
58
|
+
// through the published discovery record instead; otherwise agents
|
|
59
|
+
// had to prefix every command with JIRA_MCP_SOCKET=<address>.
|
|
60
|
+
process.env[SOCKET_ENV] = bridge.address;
|
|
61
|
+
if (opts.discovery !== false) {
|
|
62
|
+
try {
|
|
63
|
+
const published = await publishBridgeAddress(bridge.address, {
|
|
64
|
+
...opts.discovery,
|
|
65
|
+
namespace: SOCKET_ENV,
|
|
66
|
+
});
|
|
67
|
+
const close = bridge.close.bind(bridge);
|
|
68
|
+
bridge.close = async () => {
|
|
69
|
+
await published.remove().catch(() => { });
|
|
70
|
+
await close();
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
// The explicit prefix still works without discovery.
|
|
75
|
+
console.error(`jira-mcp: bridge discovery unavailable: ${err.message}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
48
78
|
return {
|
|
49
79
|
bridge,
|
|
50
|
-
ctx: { cliPath, socketAddress: bridge.address },
|
|
80
|
+
ctx: { cliPath, socketAddress: bridge.address, modulePath: opts.modulePath ?? defaultModulePath() },
|
|
51
81
|
};
|
|
52
82
|
}
|
|
53
83
|
//# sourceMappingURL=boot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../src/codeapi/boot.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,EAAE;AACF,6DAA6D;AAC7D,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,mCAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../src/codeapi/boot.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,EAAE;AACF,6DAA6D;AAC7D,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,mCAAmC;AACnC,qEAAqE;AACrE,sEAAsE;AACtE,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,qEAAqE;AACrE,oEAAoE;AACpE,gEAAgE;AAChE,qEAAqE;AACrE,qDAAqD;AAErD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAsB,MAAM,0BAA0B,CAAC;AAEpF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAqB,MAAM,aAAa,CAAC;AAG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E,EAAE;YACrE,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,CAAC;IAEH,6DAA6D;IAC7D,kEAAkE;IAClE,mEAAmE;IACnE,8DAA8D;IAC9D,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;IAEzC,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,EAAE,CAAC;QAC7B,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,oBAAoB,CAAC,MAAM,CAAC,OAAO,EAAE;gBAC3D,GAAG,IAAI,CAAC,SAAS;gBACjB,SAAS,EAAE,UAAU;aACtB,CAAC,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACxC,MAAM,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE;gBACxB,MAAM,SAAS,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;gBACzC,MAAM,KAAK,EAAE,CAAC;YAChB,CAAC,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,qDAAqD;YACrD,OAAO,CAAC,KAAK,CAAC,2CAA4C,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QACrF,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM;QACN,GAAG,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,iBAAiB,EAAE,EAAE;KACpG,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BridgeAddress, type BridgeServer } from "
|
|
1
|
+
import { type BridgeAddress, type BridgeConfirmOpts, type BridgeServer } from "ultra-mcp-toolkit/bridge";
|
|
2
2
|
import type { JiraClient } from "../auth/jira-client.js";
|
|
3
3
|
import { type Manifest } from "../core/manifest.js";
|
|
4
4
|
import type { SandboxResult } from "../types/refs.js";
|
|
@@ -9,6 +9,7 @@ export interface StartBridgeOpts {
|
|
|
9
9
|
client: JiraClient;
|
|
10
10
|
address?: BridgeAddress;
|
|
11
11
|
disabledActions?: readonly string[];
|
|
12
|
+
confirm?: BridgeConfirmOpts;
|
|
12
13
|
}
|
|
13
14
|
export declare function startBridge(opts: StartBridgeOpts): Promise<BridgeServer>;
|
|
14
15
|
export declare function invokeAndSandbox(manifest: Manifest, client: JiraClient, operation: string, args: Record<string, unknown>, disabledActions?: readonly string[]): Promise<SandboxResult<unknown>>;
|