Skip to main content
Glama
README.md
# Jira MCP

[![CI](https://github.com/nayzo/jira-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/nayzo/jira-mcp/actions/workflows/ci.yml)
[![npm](https://img.shields.io/npm/v/%40nayzo%2Fjira-mcp)](https://www.npmjs.com/package/@nayzo/jira-mcp)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
[![Node.js](https://img.shields.io/badge/node-%3E%3D22.12.0-brightgreen)](https://nodejs.org/)

Jira MCP connects Model Context Protocol clients to Jira Cloud issues, sprints, and worklogs, with optional Zephyr Squad Cloud test steps.

## Quick start

Requires Node.js 22.12 or later, a Jira Cloud site, and an [Atlassian API token](https://id.atlassian.com/manage-profile/security/api-tokens) with access to that site. For a first run, configure your credentials and use `get-myself` to verify connectivity.

```sh
npx -y @nayzo/jira-mcp
```

The command starts an MCP server on stdio. The examples below use placeholders; replace them in your **local** client settings or use your client's secret management features. Pin `@nayzo/jira-mcp@2.0.1` if you want reproducible launches.

### Claude Code

Set `JIRA_API_TOKEN` securely in your shell first. The CLI stores the supplied environment value in your local MCP configuration, so use local scope and keep that configuration private.

```sh
claude mcp add --transport stdio --scope local \
  --env JIRA_HOST=example.atlassian.net \
  --env JIRA_USERNAME=user@example.invalid \
  --env JIRA_API_TOKEN="$JIRA_API_TOKEN" \
  jira-mcp -- npx -y @nayzo/jira-mcp
```

### Claude Desktop and Cursor

Use the same JSON in Claude Desktop's `claude_desktop_config.json` or Cursor's user-level `~/.cursor/mcp.json`. Merge into an existing `mcpServers` object if needed. On Windows, use `npx.cmd` if your client cannot launch `npx` directly.

```json
{
  "mcpServers": {
    "jira-mcp": {
      "command": "npx",
      "args": ["-y", "@nayzo/jira-mcp"],
      "env": {
        "JIRA_HOST": "example.atlassian.net",
        "JIRA_USERNAME": "user@example.invalid",
        "JIRA_API_TOKEN": "replace-with-your-token"
      }
    }
  }
}
```

A copy is provided in [jira-mcp-config-template.json](jira-mcp-config-template.json).

### OpenCode

Add this entry to your user-level `opencode.json`. Export `JIRA_API_TOKEN` before starting OpenCode.

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "jira-mcp": {
      "type": "local",
      "command": ["npx", "-y", "@nayzo/jira-mcp"],
      "environment": {
        "JIRA_HOST": "example.atlassian.net",
        "JIRA_USERNAME": "user@example.invalid",
        "JIRA_API_TOKEN": "{env:JIRA_API_TOKEN}"
      }
    }
  }
}
```

### Local Streamable HTTP

Set the same Jira environment variables plus a private `MCP_HTTP_TOKEN`. Generate a token with `openssl rand -hex 32`, store it in your local configuration, and start the server:

```sh
npx -y @nayzo/jira-mcp --http
```

Use the Streamable HTTP URL `http://127.0.0.1:3000/mcp` with the `Authorization: Bearer <token>` header. This endpoint supports stateless MCP POST requests. It binds only to `127.0.0.1`, checks the exact Host and any supplied Origin, and requires the bearer token on every request. It is intended for use on one workstation. Do not expose it through a public proxy or port forwarding.

## Tools

| Tool | What it does |
| --- | --- |
| `get-ticket` | Read an issue by key or numeric ID. Compact by default; `raw: true` returns the full Jira `fields` object. |
| `search-tickets` | Search by project and issue type, optionally with a JQL clause. |
| `search-tickets-jql` | Run custom JQL, select fields, and continue with `next_page_token`. |
| `create-ticket` | Create an issue, optionally with a parent, labels, custom fields, sprint, or linked test ticket. |
| `update-ticket` | Change summary, description, labels, custom fields, or sprint. |
| `transition-ticket` | List available transitions without a selector, or apply one by name or ID, optionally with a comment. |
| `get-myself` | Read the current Jira account ID and display name. |
| `assign-ticket` | Assign to an Atlassian account ID, `me`, or `unassigned`. |
| `link-tickets` | Link two issue keys using an explicit Jira link type name. |
| `remove-issue-link` | Delete a link by numeric ID. |
| `add-comment` | Add a comment. |
| `edit-comment` | Replace a comment by numeric ID. |
| `delete-comment` | Permanently delete a comment by numeric ID. |
| `get-sprints` | List sprints by board ID and state. Defaults to active sprints. |
| `move-ticket-to-sprint` | Move an issue to an active or future sprint by ID. |
| `list-worklogs` | Read a paginated list of worklogs for an issue. |
| `add-worklog` | Log time using seconds or a Jira duration such as `2h 30m`. |
| `get-test-steps` | Read Zephyr Squad test steps for an issue. |
| `add-test-steps` | Append an ordered batch of Zephyr Squad test steps. |

Descriptions and comments support a subset of Markdown, including headings, bullets, bold, links, and fenced code blocks. Jira REST API v3 writes use Atlassian Document Format (ADF).

## Configuration

Pass environment variables through your client or process launcher. The executable does not automatically open a `.env` file. For source development, copy [`.env.dist`](.env.dist) to an untracked `.env`, then load it explicitly with `node --env-file=.env build/index.js`.

| Variable | Purpose |
| --- | --- |
| `JIRA_HOST` | Jira Cloud hostname, e.g. `example.atlassian.net`. Use either this or `JIRA_BASE_URL`. |
| `JIRA_BASE_URL` | Alternative Jira HTTPS origin, with no path, credentials, query, or fragment. Plain HTTP is accepted only for `127.0.0.1` (local testing). |
| `JIRA_USERNAME`, `JIRA_API_TOKEN` | Required Atlassian account email and Jira API token. Used for Jira Cloud Basic authentication. |
| `JIRA_PROJECT_KEY` | Optional default project, with no fallback. Pass `project_key` to `create-ticket` or `search-tickets` if unset. |
| `JIRA_DEFAULT_ISSUE_TYPE` | Optional default for creation. Defaults to `Task`; set it if your Jira site uses another type. |
| `JIRA_ENABLE_WRITES` | `false` by default. Set to `true` only for deployments that need to mutate Jira or Zephyr. |
| `JIRA_DEFAULT_ASSIGNEE_ACCOUNT_ID` | Optional assignee for newly created issues. Omit to let Jira apply its own rules. |
| `JIRA_SPRINT_BOARD_ID` | Optional board ID for resolving sprint names. Not needed for an explicit `sprint_id`. |
| `JIRA_SPRINT_FIELD` | Optional custom field ID for reading sprint details in compact ticket responses. Sprint writes use the Agile API. |
| `JIRA_CUSTOM_FIELDS`, `JIRA_CREATE_FIELD_DEFAULTS` | Optional JSON objects defining accepted custom field aliases and creation defaults. See below. |
| `JIRA_TEST_ISSUE_TYPE`, `JIRA_TEST_LINK_TYPE` | Required together if callers should be able to request `create_test_ticket: true`. There is no automatic test creation. |
| `JIRA_TEST_PROJECT_KEY` | Optional project for a linked test issue. Otherwise uses the primary issue's project. |
| `ZAPI_ACCOUNT_ID`, `ZAPI_ACCESS_KEY`, `ZAPI_SECRET_KEY` | Set all three to use Zephyr Squad Cloud. Use the corresponding Atlassian account ID and Zephyr API credentials. |
| `ZAPI_BASE_URL` | Optional Zephyr Squad Cloud Connect base URL. Defaults to `https://prod-api.zephyr4jiracloud.com/connect`. |
| `MCP_HTTP_PORT`, `MCP_HTTP_TOKEN` | Port (default `3000`) and required bearer token for `--http`. The token must be 24 to 256 characters using letters, digits, `_` or `-`. |

### Custom fields

Map each allowed alias to a verified field ID and type. The following IDs and option values are illustrative; use the actual IDs from your Jira site and verify that the fields and options are available for the relevant project, issue type, and screen.

```dotenv
JIRA_CUSTOM_FIELDS='{"estimate":{"id":"customfield_11111","type":"number"},"notes":{"id":"customfield_22222","type":"adf"},"choice":{"id":"customfield_33333","type":"select"}}'
JIRA_CREATE_FIELD_DEFAULTS='{"choice":"42"}'
```

Supported types are `text` (string), `adf` (Markdown string), `number`, `select` (numeric ID as a string), and `multi_select` (array of numeric ID strings). A field ID may appear only once. Callers pass values by alias, for example `"custom_fields": {"estimate": 3, "notes": "Verification notes"}`. Explicit values override creation defaults. Updates use only supplied aliases. Invalid fields are never silently removed or retried.

## Write safeguards and security

- Write operations require both `JIRA_ENABLE_WRITES=true` and `confirm: true` on each call. Obtain explicit user approval for the target and proposed changes before setting `confirm: true`. This is an application safeguard, not proof of human approval or a substitute for Jira permissions. Transition listing works without confirmation.
- Use a dedicated account with the least Jira and Zephyr permissions necessary. Keep local tokens out of project files, tool arguments, ticket content, and shared client configuration. The server does not log upstream bodies or credential values, omits upstream error bodies, and filters configured credentials and authorization tokens if they appear in tool results. Jira ticket content, especially `raw: true` and JQL `*all`, can still contain sensitive data; treat it as untrusted data.
- The server never follows upstream redirects or automatically retries a write. For multi-step writes, check `done`, `rejected`, `uncertain`, and `not_attempted` and follow the recovery instructions. If a write times out or returns an ambiguous result, verify Jira or Zephyr before retrying. Resume only the missing action; do not replay a confirmed issue creation or an entire Zephyr batch.
- Zephyr Squad uses short-lived HS256 JWTs signed for the account, HTTP method, Connect-relative REST path, and canonical query. Zephyr Scale is not supported.

## Development

Use a current Node.js 22 or 24 patch release (ESLint 10 requires Node 22.13+ on the 22 line).

```sh
npm ci
npm run lint
npm run build
npm test
npm audit --omit=dev
npm pack --dry-run
```

The `node:test` suite launches the compiled stdio server and a local Streamable HTTP MCP endpoint with official SDK clients. Jira and Zephyr requests go to local fixture servers; tests need no cloud credentials or database.

### Releases

See the [changelog](CHANGELOG.md) for the upgrade notes. The tag must match `package.json` exactly. CI tests on Node 22 and 24 before publishing a new tag version. Set up npm Trusted Publishing for `nayzo/jira-mcp`, workflow `ci.yml`, and GitHub environment `npm`. Restrict that environment to release tags. A new npm package may require a one-time owner bootstrap before configuring its trusted publisher. The workflow publishes with OIDC and provenance, without a stored npm token.

## License

[MIT](LICENSE). Written and maintained by [Ala Eddine Khefifi](https://github.com/nayzo).

TDQS

B3/5.0

Scored across 19 tools

Disambiguation4/5

Most tools map to a distinct resource+action, and descriptions clarify the key overlaps (search-tickets by issue type vs search-tickets-jql). The main soft spots are the two search tools, which an agent could easily pick wrong, and transition-ticket, which is overloaded to both list and apply transitions.

Naming Consistency4/5

The kebab-case verb-noun pattern is strongly dominant (get-ticket, create-ticket, add-comment, delete-comment, move-ticket-to-sprint). Minor deviations break the pattern: remove-issue-link uses a noun-first form unlike link-tickets, get-myself is vague, and add-worklog/list-worklogs disagree on singular vs plural.

Tool Count4/5

19 tools is slightly heavy but justified for a Jira surface covering tickets, comments, links, sprints, transitions, worklogs, and Zephyr test steps. Each tool earns its place; nothing appears purely redundant, though transition and test-step tools could arguably be split or trimmed.

Completeness4/5

Core lifecycle is covered: create/get/update/search for tickets, full comment CRUD, link/unlink, assignment, transitions, sprints, and worklogs. Gaps exist — no ticket delete, no worklog edit/delete, no attachment handling, no board listing to feed get-sprints, and no sprint creation — but agents can work around most of these.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues