mcp-jira-stdio 1.0.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/LICENSE +22 -0
- package/README.md +364 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2227 -0
- package/dist/index.js.map +1 -0
- package/package.json +87 -0
- package/scripts/setup-mcp-config.js +250 -0
- package/scripts/test-connection.cjs +89 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 graslt
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
# MCP Jira Server
|
|
2
|
+
|
|
3
|
+
[](https://www.typescriptlang.org)
|
|
4
|
+
[](https://nodejs.org)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
A Model Context Protocol (MCP) server for Jira API integration. Enables reading, writing, and managing Jira issues and projects directly from your MCP client (e.g., Claude Desktop).
|
|
8
|
+
|
|
9
|
+
## 🚀 Quick Start
|
|
10
|
+
|
|
11
|
+
### 1. Prerequisites
|
|
12
|
+
|
|
13
|
+
- Node.js v18 or higher
|
|
14
|
+
- Jira instance (Cloud or Server)
|
|
15
|
+
- Jira API token
|
|
16
|
+
|
|
17
|
+
### 2. Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Install from npm
|
|
21
|
+
npm install -g mcp-jira-stdio
|
|
22
|
+
|
|
23
|
+
# Or install locally in your project
|
|
24
|
+
npm install mcp-jira-stdio
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
#### Development Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Clone the repository
|
|
31
|
+
git clone https://github.com/freema/mcp-jira-stdio.git
|
|
32
|
+
cd mcp-jira-stdio
|
|
33
|
+
|
|
34
|
+
# Install dependencies
|
|
35
|
+
npm install
|
|
36
|
+
# or using Task runner
|
|
37
|
+
task install
|
|
38
|
+
|
|
39
|
+
# Build the project
|
|
40
|
+
npm run build
|
|
41
|
+
# or
|
|
42
|
+
task build
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 3. Jira API Setup
|
|
46
|
+
|
|
47
|
+
1. Go to your Jira instance settings
|
|
48
|
+
2. Create an API token:
|
|
49
|
+
- **Jira Cloud**: Go to Account Settings → Security → Create and manage API tokens
|
|
50
|
+
- **Jira Server**: Use your username and password (or create an application password)
|
|
51
|
+
3. Note your Jira base URL (e.g., `https://yourcompany.atlassian.net`)
|
|
52
|
+
|
|
53
|
+
### 4. Configuration
|
|
54
|
+
|
|
55
|
+
Create a `.env` file from the provided example:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Copy the example environment file
|
|
59
|
+
cp .env.example .env
|
|
60
|
+
|
|
61
|
+
# Edit .env with your actual Jira credentials
|
|
62
|
+
# Or use Task runner:
|
|
63
|
+
task env
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Example `.env` contents:
|
|
67
|
+
|
|
68
|
+
```env
|
|
69
|
+
JIRA_BASE_URL=https://your-instance.atlassian.net
|
|
70
|
+
JIRA_EMAIL=your-email@example.com
|
|
71
|
+
JIRA_API_TOKEN=your-api-token
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Note:** Generate your API token at [https://id.atlassian.com/manage-profile/security/api-tokens](https://id.atlassian.com/manage-profile/security/api-tokens)
|
|
75
|
+
|
|
76
|
+
### 5. Test Connection
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Test Jira connection
|
|
80
|
+
task jira:test
|
|
81
|
+
|
|
82
|
+
# List visible projects
|
|
83
|
+
task jira:projects
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 6. Configure MCP Client
|
|
87
|
+
|
|
88
|
+
Add to your Claude Desktop config:
|
|
89
|
+
|
|
90
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
91
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
92
|
+
- **Linux**: `~/.config/claude/claude_desktop_config.json`
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"mcpServers": {
|
|
97
|
+
"jira": {
|
|
98
|
+
"command": "mcp-jira-stdio",
|
|
99
|
+
"env": {
|
|
100
|
+
"JIRA_BASE_URL": "https://your-instance.atlassian.net",
|
|
101
|
+
"JIRA_EMAIL": "your-email@example.com",
|
|
102
|
+
"JIRA_API_TOKEN": "your-api-token"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### Alternative: Using npx
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"mcpServers": {
|
|
114
|
+
"jira": {
|
|
115
|
+
"command": "npx",
|
|
116
|
+
"args": ["mcp-jira-stdio"],
|
|
117
|
+
"env": {
|
|
118
|
+
"JIRA_BASE_URL": "https://your-instance.atlassian.net",
|
|
119
|
+
"JIRA_EMAIL": "your-email@example.com",
|
|
120
|
+
"JIRA_API_TOKEN": "your-api-token"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Restart Claude Desktop after adding the configuration.
|
|
128
|
+
|
|
129
|
+
## 📦 Available Tools
|
|
130
|
+
|
|
131
|
+
### Projects
|
|
132
|
+
|
|
133
|
+
- `jira_get_visible_projects`: Retrieves all projects visible to the user.
|
|
134
|
+
- `jira_get_project_info`: Retrieves detailed information about a project (components, versions, roles, insights).
|
|
135
|
+
|
|
136
|
+
### Issues
|
|
137
|
+
|
|
138
|
+
- `jira_get_issue`: Retrieve issue details by key (supports optional fields/expand).
|
|
139
|
+
- `jira_search_issues`: Search for Jira issues using JQL with pagination and fields.
|
|
140
|
+
- `jira_create_issue`: Create a new issue in a project (type, priority, assignee, labels, components).
|
|
141
|
+
- `jira_update_issue`: Update an existing issue (summary, description, priority, assignee, labels, components).
|
|
142
|
+
- `jira_create_subtask`: Create a subtask under a parent issue (auto-detects subtask type).
|
|
143
|
+
|
|
144
|
+
### Comments
|
|
145
|
+
|
|
146
|
+
- `jira_add_comment`: Add a comment to an issue (optional visibility by group/role).
|
|
147
|
+
|
|
148
|
+
### Metadata & Users
|
|
149
|
+
|
|
150
|
+
- `jira_get_issue_types`: List issue types (optionally per project).
|
|
151
|
+
- `jira_get_users`: Search for users (by query, username, or accountId).
|
|
152
|
+
- `jira_get_priorities`: List available priorities.
|
|
153
|
+
- `jira_get_statuses`: List available statuses (global or project-specific).
|
|
154
|
+
|
|
155
|
+
### My Work
|
|
156
|
+
|
|
157
|
+
- `jira_get_my_issues`: Retrieve issues assigned to the current user (sorted by updated).
|
|
158
|
+
|
|
159
|
+
## 🛠️ Development
|
|
160
|
+
|
|
161
|
+
### Development Commands
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Development mode with hot reload
|
|
165
|
+
npm run dev
|
|
166
|
+
task dev
|
|
167
|
+
|
|
168
|
+
# Build for production
|
|
169
|
+
npm run build
|
|
170
|
+
task build
|
|
171
|
+
|
|
172
|
+
# Type checking
|
|
173
|
+
npm run typecheck
|
|
174
|
+
task typecheck
|
|
175
|
+
|
|
176
|
+
# Linting
|
|
177
|
+
npm run lint
|
|
178
|
+
task lint
|
|
179
|
+
|
|
180
|
+
# Format code
|
|
181
|
+
npm run format
|
|
182
|
+
task fmt
|
|
183
|
+
|
|
184
|
+
# Run all checks
|
|
185
|
+
npm run check
|
|
186
|
+
task check
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### MCP Inspector
|
|
190
|
+
|
|
191
|
+
Debug your MCP server using the inspector:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Run inspector (production build)
|
|
195
|
+
npm run inspector
|
|
196
|
+
task inspector
|
|
197
|
+
|
|
198
|
+
# Run inspector (development mode)
|
|
199
|
+
npm run inspector:dev
|
|
200
|
+
task inspector:dev
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Testing
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# Run tests
|
|
207
|
+
npm test
|
|
208
|
+
task test
|
|
209
|
+
|
|
210
|
+
# Run tests with coverage
|
|
211
|
+
npm run test:coverage
|
|
212
|
+
task test:coverage
|
|
213
|
+
|
|
214
|
+
# Watch mode
|
|
215
|
+
npm run test:watch
|
|
216
|
+
task test:watch
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## 🚢 Publishing to npm
|
|
220
|
+
|
|
221
|
+
Steps to publish a new version to npm:
|
|
222
|
+
|
|
223
|
+
- Prerequisites: npm account with 2FA enabled (recommended) and access to the `mcp-jira-stdio` package name.
|
|
224
|
+
- Bump version: `npm version patch` (or `minor`/`major`). This updates `package.json` and creates a git tag.
|
|
225
|
+
- Verify locally:
|
|
226
|
+
- `npm run check` (typecheck, lint, format:check)
|
|
227
|
+
- `npm run test:run`
|
|
228
|
+
- `npm run build`
|
|
229
|
+
- Inspect the tarball content: `npm pack` (should include `dist/`, `README.md`, `LICENSE`, `scripts/`).
|
|
230
|
+
- Publish:
|
|
231
|
+
- Manual: `npm publish --access public`
|
|
232
|
+
- Or via GitHub Release: create a GitHub Release; the workflow at `.github/workflows/publish.yml` will build and publish to npm using `NPM_TOKEN` secret.
|
|
233
|
+
|
|
234
|
+
CI Workflows:
|
|
235
|
+
|
|
236
|
+
- CI checks on PRs/commits: `.github/workflows/ci.yml` runs typecheck, lint, format:check, tests, and build.
|
|
237
|
+
- Publish on release: `.github/workflows/publish.yml` publishes to npm when a GitHub Release is published.
|
|
238
|
+
|
|
239
|
+
Setup secrets for publish workflow:
|
|
240
|
+
|
|
241
|
+
- In GitHub repo settings → Secrets and variables → Actions, add `NPM_TOKEN` (npm access token with publish rights).
|
|
242
|
+
|
|
243
|
+
## 📋 Project Structure
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
src/
|
|
247
|
+
├── index.ts # Entry point & MCP server setup
|
|
248
|
+
├── config/
|
|
249
|
+
│ └── constants.ts # API configuration & constants
|
|
250
|
+
├── tools/
|
|
251
|
+
│ ├── index.ts # Tool exports
|
|
252
|
+
│ └── get-visible-projects.ts # Get visible projects tool
|
|
253
|
+
├── types/
|
|
254
|
+
│ ├── common.ts # Common types & interfaces
|
|
255
|
+
│ ├── jira.ts # Jira API types
|
|
256
|
+
│ └── tools.ts # Tool input/output schemas
|
|
257
|
+
└── utils/
|
|
258
|
+
├── jira-auth.ts # Jira authentication & client
|
|
259
|
+
├── validators.ts # Input validation with Zod
|
|
260
|
+
├── formatters.ts # Response formatting
|
|
261
|
+
├── error-handler.ts # Error handling
|
|
262
|
+
└── api-helpers.ts # Jira API helpers
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## 🔧 Tool Usage Examples
|
|
266
|
+
|
|
267
|
+
### Get Visible Projects
|
|
268
|
+
|
|
269
|
+
```javascript
|
|
270
|
+
// List all projects
|
|
271
|
+
jira_get_visible_projects({});
|
|
272
|
+
|
|
273
|
+
// List projects with additional details
|
|
274
|
+
jira_get_visible_projects({
|
|
275
|
+
expand: ['description', 'lead', 'issueTypes'],
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
// List recent projects only
|
|
279
|
+
jira_get_visible_projects({
|
|
280
|
+
recent: 10,
|
|
281
|
+
});
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## ❗ Troubleshooting
|
|
285
|
+
|
|
286
|
+
### Common Issues
|
|
287
|
+
|
|
288
|
+
**"Authentication failed"**
|
|
289
|
+
|
|
290
|
+
- Verify your API token is correct
|
|
291
|
+
- Check that your email matches your Jira account
|
|
292
|
+
- Ensure your Jira base URL is correct (no trailing slash)
|
|
293
|
+
|
|
294
|
+
**"Connection failed"**
|
|
295
|
+
|
|
296
|
+
- Verify your Jira instance is accessible
|
|
297
|
+
- Check network connectivity
|
|
298
|
+
- Ensure Jira REST API is enabled
|
|
299
|
+
|
|
300
|
+
**"Permission denied"**
|
|
301
|
+
|
|
302
|
+
- Verify your account has the necessary permissions
|
|
303
|
+
- Check project permissions in Jira
|
|
304
|
+
- Ensure you're using the correct Jira instance
|
|
305
|
+
|
|
306
|
+
**MCP Connection Issues**
|
|
307
|
+
|
|
308
|
+
- Ensure you're using the built version (`dist/index.js`)
|
|
309
|
+
- Check that Node.js path is correct in Claude Desktop config
|
|
310
|
+
- Look for errors in Claude Desktop logs
|
|
311
|
+
- Use `task inspector` to debug
|
|
312
|
+
|
|
313
|
+
### Debug Commands
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
# Test Jira connection
|
|
317
|
+
task jira:test
|
|
318
|
+
|
|
319
|
+
# List projects (test API connectivity)
|
|
320
|
+
task jira:projects
|
|
321
|
+
|
|
322
|
+
# Run MCP inspector for debugging
|
|
323
|
+
task inspector:dev
|
|
324
|
+
|
|
325
|
+
# Check all configuration
|
|
326
|
+
task check
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## 🔍 Environment Variables
|
|
330
|
+
|
|
331
|
+
| Variable | Required | Description | Example |
|
|
332
|
+
| ---------------- | -------- | ----------------- | ------------------------------- |
|
|
333
|
+
| `JIRA_BASE_URL` | Yes | Jira instance URL | `https://company.atlassian.net` |
|
|
334
|
+
| `JIRA_EMAIL` | Yes | Your Jira email | `user@example.com` |
|
|
335
|
+
| `JIRA_API_TOKEN` | Yes | Jira API token | `ATxxx...` |
|
|
336
|
+
| `NODE_ENV` | No | Environment mode | `development` or `production` |
|
|
337
|
+
|
|
338
|
+
## 🤝 Contributing
|
|
339
|
+
|
|
340
|
+
1. Fork the repository
|
|
341
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
342
|
+
3. Run tests and linting (`task check`)
|
|
343
|
+
4. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
344
|
+
5. Push to the branch (`git push origin feature/amazing-feature`)
|
|
345
|
+
6. Open a Pull Request
|
|
346
|
+
|
|
347
|
+
## 📄 License
|
|
348
|
+
|
|
349
|
+
This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
|
|
350
|
+
|
|
351
|
+
### MCP Config Setup
|
|
352
|
+
|
|
353
|
+
Configure Claude Desktop to use this MCP server interactively:
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
npm run setup:mcp
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
The script will:
|
|
360
|
+
|
|
361
|
+
- Build the project if needed and detect your Node path
|
|
362
|
+
- Prompt for `JIRA_BASE_URL`, `JIRA_EMAIL`, `JIRA_API_TOKEN`
|
|
363
|
+
- Save a `jira` entry into your Claude Desktop config or print the JSON
|
|
364
|
+
- Optionally generate a local `.env` for development
|
package/dist/index.d.ts
ADDED