atlassian-mcp-server

atlassian-mcp-server

Enables AI agents to manage Jira issues and Confluence pages via natural language, including creating, updating, searching, and uploading file attachments using API token authentication.

Category
访问服务器

README

Atlassian MCP Server

A Model Context Protocol (MCP) server for Atlassian Jira and Confluence integration using API token authentication.

Features

  • Long-lived Authentication: Uses API tokens instead of OAuth for persistent access
  • Jira Integration: Create, update, search, and manage Jira issues (including file attachments)
  • Confluence Integration: Read, create, and update Confluence pages
  • Custom Field Mapping: Use friendly names (e.g., "sprint") instead of cryptic field IDs (e.g., "customfield_10560")
  • TypeScript: Fully typed for better development experience
  • MCP Compatible: Works with Claude Code CLI and Claude Desktop

Prerequisites

  • Node.js 20.x or later
  • An Atlassian Cloud account (e.g., yoursite.atlassian.net)
  • An Atlassian API token

Installation

  1. Clone or download this repository:
cd /Users/dongood/SourceCode/Repos/_dongood/atlassian-mcp-server
  1. Install dependencies:
npm install
  1. Build the TypeScript code:
npm run build

Creating an Atlassian API Token

  1. Visit https://id.atlassian.com/manage-profile/security/api-tokens
  2. Click Create API token
  3. Give it a descriptive name (e.g., "MCP Server")
  4. Copy the token (you won't be able to see it again)
  5. Store it securely

Configuration

Environment Variables

The server requires these environment variables:

  • ATLASSIAN_SITE_URL: Your Atlassian site URL (e.g., https://avetta.atlassian.net)
  • ATLASSIAN_USER_EMAIL: Your email address associated with your Atlassian account
  • ATLASSIAN_API_TOKEN: The API token you created above
  • ATLASSIAN_FIELD_MAPPINGS_PATH (optional): Path to custom field mappings JSON file

For Claude Code CLI

Global Configuration (recommended): Edit ~/.claude.json and add the server under the mcpServers key. This makes the server available in all projects without per-project approval prompts:

{
  "mcpServers": {
    "atlassian": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/atlassian-mcp-server/build/index.js"],
      "env": {
        "ATLASSIAN_SITE_URL": "https://yoursite.atlassian.net",
        "ATLASSIAN_USER_EMAIL": "your.email@example.com",
        "ATLASSIAN_API_TOKEN": "YOUR_API_TOKEN_HERE"
      }
    }
  }
}

Project-specific Configuration: Create .mcp.json in your project root. Note that servers defined in .mcp.json files require per-project approval when Claude Code starts:

{
  "mcpServers": {
    "atlassian": {
      "command": "node",
      "args": ["/path/to/atlassian-mcp-server/build/index.js"],
      "env": {
        "ATLASSIAN_SITE_URL": "https://yoursite.atlassian.net",
        "ATLASSIAN_USER_EMAIL": "your.email@example.com",
        "ATLASSIAN_API_TOKEN": "YOUR_API_TOKEN_HERE"
      }
    }
  }
}

Important: Replace the placeholders with your actual values.

For Claude Desktop

Edit the Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

Add this configuration:

{
  "mcpServers": {
    "atlassian": {
      "command": "node",
      "args": ["/Users/dongood/SourceCode/Repos/_dongood/atlassian-mcp-server/build/index.js"],
      "env": {
        "ATLASSIAN_SITE_URL": "https://avetta.atlassian.net",
        "ATLASSIAN_USER_EMAIL": "your.email@example.com",
        "ATLASSIAN_API_TOKEN": "YOUR_API_TOKEN_HERE"
      }
    }
  }
}

Custom Field Mapping

Jira custom fields have cryptic IDs like customfield_10560. This server allows you to map them to friendly names.

Configuring Field Mappings

  1. Edit config/field-mappings.json:
{
  "sprint": "customfield_10560",
  "story_points": "customfield_10016",
  "epic_link": "customfield_10014",
  "team": "customfield_10100"
}
  1. The server will automatically load this file from the config/ directory
  2. You can now use "sprint" instead of "customfield_10560" in MCP tool calls

Finding Custom Field IDs

To find the actual field ID for a custom field:

  1. Via Jira UI:

    • Go to Jira Settings → Issues → Custom fields
    • Find your field and note its ID
  2. Via API:

    • Get any issue that has the field populated
    • Look at the raw JSON response - custom fields appear as customfield_XXXXX
  3. Example using the MCP server:

    Use atlassian_get_jira_issue with issueKey "PROJ-123"
    Look in the fields object for customfield_* entries
    

Using Field Mappings

When creating or editing issues, you can use either:

  • Friendly names: { "sprint": "Sprint 42" }
  • Actual field IDs: { "customfield_10560": "Sprint 42" }

Both formats work - the server handles the translation.

Available Tools

Utility Tools

  • atlassian_health_check - Test connectivity and authentication
  • atlassian_get_user_info - Get current user information

Jira Tools

  • atlassian_get_jira_issue - Get issue by key or ID
  • atlassian_create_jira_issue - Create a new issue
  • atlassian_edit_jira_issue - Update issue fields
  • atlassian_search_jira_issues - Search using JQL
  • atlassian_add_jira_comment - Add a comment to an issue
  • atlassian_transition_jira_issue - Change issue status
  • atlassian_get_jira_transitions - Get available transitions
  • atlassian_get_jira_projects - List projects
  • atlassian_get_project_issue_types - Get issue types for a project
  • atlassian_add_jira_attachment - Upload a file attachment to an issue
  • atlassian_get_jira_attachments - List attachments on an issue
  • atlassian_delete_jira_attachment - Delete an attachment by ID
  • atlassian_lookup_jira_user - Find users by name/email

Confluence Tools

  • atlassian_get_confluence_page - Get page by ID
  • atlassian_search_confluence_cql - Search using CQL
  • atlassian_get_confluence_spaces - List spaces
  • atlassian_get_space_pages - Get pages in a space
  • atlassian_create_confluence_page - Create a new page
  • atlassian_update_confluence_page - Update an existing page
  • atlassian_get_page_children - Get child pages

File Attachments

The attachment tools allow uploading files from the local filesystem to Jira issues. This works because the MCP server runs as a local process on the same machine as the AI agent (Claude Code), giving it direct filesystem access.

Claude Code  --MCP (JSON: file path as string)-->  MCP Server  --HTTP (multipart/form-data)-->  Jira API

The MCP protocol itself only passes JSON (strings, numbers, objects). It has no native binary or multipart support. The trick is that the AI agent passes a file path as a string argument, and the MCP server handles the rest: reading the file from disk, constructing the multipart/form-data request, and uploading it to Jira's REST API v3 attachment endpoint.

This approach requires the MCP server to be running locally (same filesystem as the files being attached). If the MCP server were running remotely, the file path would be meaningless on the remote host, and you'd need an alternative approach like base64-encoded content or a shared storage URL.

Jira Attachment API Requirements

The Jira REST API v3 attachment endpoint (POST /rest/api/3/issue/{key}/attachments) requires:

  • X-Atlassian-Token: no-check header (CSRF protection bypass, required by Jira for this endpoint)
  • Content-Type: multipart/form-data with the file in the file form field
  • Standard Basic Auth (same as all other Jira API calls)

Usage Examples

"Attach /Users/me/docs/report.pdf to BI-10341"
"List all attachments on PROJ-123"
"Delete attachment 12345 from the issue"

Testing

You can test the server using the MCP Inspector:

npx @modelcontextprotocol/inspector node build/index.js

Set environment variables before running:

export ATLASSIAN_SITE_URL="https://avetta.atlassian.net"
export ATLASSIAN_USER_EMAIL="your.email@example.com"
export ATLASSIAN_API_TOKEN="your-api-token"
npx @modelcontextprotocol/inspector node build/index.js

Example Usage

Once configured in Claude Code or Claude Desktop, you can interact with Jira and Confluence naturally:

Jira Examples:

  • "Get details for issue BI-9956"
  • "Create a new bug in project PROJ with summary 'Login page is broken'"
  • "Search for all open bugs assigned to me"
  • "Add a comment to PROJ-123 saying 'Fixed in latest build'"
  • "Move PROJ-456 to In Progress"

Confluence Examples:

  • "Get the content of Confluence page 123456789"
  • "Search Confluence for pages about 'architecture'"
  • "List all pages in the ENG space"
  • "Create a new page in space 12345 titled 'Sprint Retrospective'"

Development

Build

npm run build

Run

npm start

Development mode (build + run)

npm run dev

API Documentation

  • Jira REST API v3: https://developer.atlassian.com/cloud/jira/platform/rest/v3/
  • Confluence REST API v2: https://developer.atlassian.com/cloud/confluence/rest/v2/

Troubleshooting

Authentication Errors

If you get 401 errors:

  1. Verify your email and API token are correct
  2. Make sure the API token hasn't expired
  3. Check that your user has access to the Jira/Confluence site

Permission Errors

If you get 403 errors:

  1. Verify you have permission to access the project/space
  2. Check that your user has the required permissions (e.g., Create Issues, Edit Pages)

Field Not Found Errors

If custom fields aren't working:

  1. Verify the field ID in your field-mappings.json is correct
  2. Make sure the field exists in the project/issue type
  3. Check that the field is not hidden or restricted

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选