- Jira MCP Server
Jira MCP Server
Jira MCP Server
A Model Context Protocol (MCP) server that allows Claude and other AI assistants to create and manage Jira issues.
Installation
- Clone this repository
- Install dependencies:
cd jira_mcp_server
npm install
Configuration
The server requires the following environment variables:
JIRA_SERVER: Your Jira server URL (defaults to 'https://alepo.atlassian.net')JIRA_USER: Your Jira email addressJIRA_TOKEN: Your Jira API tokenJIRA_PROJECTS: Comma-separated list of project keys that are allowed for issue creation (e.g.,XYZ,ABC,DEF)- The server will only return these projects in
get_jira_projectsand will only allow creating issues in these projects - Must contain at least one project key
- The server will only return these projects in
You can set these in a .env file or through your MCP configuration.
Jira API Token
To create a Jira API token:
- Log in to https://id.atlassian.com
- Go to Security → API tokens
- Click "Create API token"
- Give it a name like "MCP Server" and click "Create"
- Copy the token and use it for your
JIRA_TOKENenvironment variable
Jira Permissions
The user associated with the API token must have:
- Read access to projects you want to list
- Create issue permissions for projects you want to create tickets in
If you encounter errors like "You do not have permission to create issues in this project", make sure your Jira user has the necessary permissions.
MCP Configuration Example
Add this to your MCP configuration:
{
"mcpServers": {
"jira": {
"command": "node",
"args": [
"server.js"
],
"cwd": "/path/to/jira_mcp_server",
"env": {
"JIRA_SERVER": "https://alepo.atlassian.net",
"JIRA_USER": "your-jira-email@example.com",
"JIRA_TOKEN": "your-jira-api-token",
"JIRA_PROJECTS": "XYZ,ABC,DEF"
}
}
}
}
Running the Server
npm start
Using with Claude or Other AI Assistants
This server implements the Model Context Protocol (MCP), which allows AI assistants like Claude to directly interact with Jira. Once the server is running, Claude can use the provided tools to create tickets and retrieve project information.
For example, when Claude is configured with this MCP server, it can run commands like:
- "Create a Jira ticket for the bug we just discussed"
- "Show me all available Jira projects"
The AI will be restricted to creating issues only in the projects specified in the JIRA_PROJECTS environment variable.
Available Tools
create_jira_issue
Creates a new Jira issue with the specified parameters.
Parameters:
project: Jira project key (e.g., CRMUP)summary: Issue summary/titledescription: Detailed description of the issueissuetype: Type of issue (e.g., Bug, Task, Story) - defaults to "Task"priority: Priority of the issue (e.g., High, Medium, Low) - defaults to "Medium"
Example success response:
{
"success": true,
"key": "CRMUP-123",
"id": "10042",
"url": "https://alepo.atlassian.net/browse/CRMUP-123"
}
Example error response when project is not in allowed list:
{
"success": false,
"error": "Project TEST is not allowed. Only the following projects can be used: XYZ, ABC, DEF"
}
get_jira_projects
Gets a list of available Jira projects. Only returns projects that match the keys specified in the JIRA_PROJECTS environment variable.
No parameters required.
Example response:
{
"success": true,
"projects": [
{
"id": "10000",
"key": "XYZ",
"name": "Project XYZ"
}
]
}
Development
This server is built using:
- The Model Context Protocol TypeScript SDK
- Jira API client for Node.js
For testing and debugging, you can run the example usage script:
node example-usage.js
Troubleshooting
Empty Projects List
If get_jira_projects returns an empty array, check:
- Your Jira user has permission to view the projects specified in
JIRA_PROJECTS - The project keys in
JIRA_PROJECTSexist in your Jira instance - Your API token hasn't expired
Permission Errors
If you get "You do not have permission to create issues in this project" errors:
- Verify your Jira user has the "Create Issue" permission for that project
- Try creating an issue manually with the same account to confirm permissions
- If using a cloud instance, make sure your user is properly assigned to the project
Project Not Allowed Errors
If you get "Project X is not allowed" errors:
- Check that the project key you're trying to use is included in your
JIRA_PROJECTSenvironment variable - Make sure the project keys in
JIRA_PROJECTSare correctly spelled and match your Jira projects exactly (case-sensitive) - If you need to use additional projects, update your
JIRA_PROJECTSenvironment variable