@lvmk/jira-mcp 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 +21 -0
- package/README.md +583 -0
- package/dist/client.d.ts +287 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +235 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +54 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +66 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +222 -0
- package/dist/index.js.map +1 -0
- package/dist/setup.d.ts +41 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +275 -0
- package/dist/setup.js.map +1 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +10 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/issues.d.ts +363 -0
- package/dist/tools/issues.d.ts.map +1 -0
- package/dist/tools/issues.js +365 -0
- package/dist/tools/issues.js.map +1 -0
- package/dist/tools/projects.d.ts +69 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +93 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/search.d.ts +76 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +98 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/transitions.d.ts +98 -0
- package/dist/tools/transitions.d.ts.map +1 -0
- package/dist/tools/transitions.js +109 -0
- package/dist/tools/transitions.js.map +1 -0
- package/dist/tools/users.d.ts +69 -0
- package/dist/tools/users.d.ts.map +1 -0
- package/dist/tools/users.js +89 -0
- package/dist/tools/users.js.map +1 -0
- package/package.json +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 lvmk
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+
# @lvmk/jira-mcp
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server providing Jira tools with **HTTP Basic Authentication** support. Specifically designed for **legacy self-hosted Jira Server** instances (v7.x and older) that only support basic authentication.
|
|
4
|
+
|
|
5
|
+
> **🔔 Using Jira Cloud or newer Jira Data Center?**
|
|
6
|
+
>
|
|
7
|
+
> If you're using **Jira Cloud** or **Jira Data Center 8.14+** that supports Personal Access Tokens (PAT), OAuth, or API tokens, we recommend using [**mcp-atlassian**](https://github.com/sooperset/mcp-atlassian) instead. It provides broader authentication options and supports both Jira and Confluence.
|
|
8
|
+
>
|
|
9
|
+
> This package (`@lvmk/jira-mcp`) is specifically for legacy Jira Server deployments where basic auth (username/password) is the only available authentication method.
|
|
10
|
+
|
|
11
|
+
## 📑 Table of Contents
|
|
12
|
+
|
|
13
|
+
- [Features](#features)
|
|
14
|
+
- [Installation](#installation)
|
|
15
|
+
- [⚡ Quick CLI Setup](#-quick-cli-setup)
|
|
16
|
+
- [Environment Variables](#environment-variables)
|
|
17
|
+
- [Available Tools](#available-tools)
|
|
18
|
+
- [MCP Configuration Examples](#mcp-configuration-examples)
|
|
19
|
+
- [Usage Examples](#usage-examples)
|
|
20
|
+
- [Development Guide](#development-guide)
|
|
21
|
+
- [Contributing](#contributing)
|
|
22
|
+
- [License](#license)
|
|
23
|
+
|
|
24
|
+
## Features
|
|
25
|
+
|
|
26
|
+
- 🔐 **Basic Authentication** - Username/password auth for legacy Jira Server
|
|
27
|
+
- 📋 **Issue Management** - Create, read, update, delete issues
|
|
28
|
+
- 🔍 **JQL Search** - Powerful issue search with JQL
|
|
29
|
+
- 📁 **Project Tools** - List and inspect projects
|
|
30
|
+
- 🔄 **Workflow Transitions** - Move issues through workflow states
|
|
31
|
+
- 👤 **User Information** - Get current and other user details
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx @lvmk/jira-mcp
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Or install globally:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g @lvmk/jira-mcp
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## ⚡ Quick CLI Setup
|
|
48
|
+
|
|
49
|
+
Automatically inject MCP configuration into your AI tool's config file with a single command:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx @lvmk/jira-mcp setup -c <cli> -b <url> -u <user> -p <pass> [-s <scope>]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Arguments
|
|
56
|
+
|
|
57
|
+
| Short | Long | Description |
|
|
58
|
+
|-------|------|-------------|
|
|
59
|
+
| `-c` | `--cli` | Target CLI tool (**required**) |
|
|
60
|
+
| `-b` | `--base-url` | Jira base URL (**required**) |
|
|
61
|
+
| `-u` | `--username` | Jira username (**required**) |
|
|
62
|
+
| `-p` | `--password` | Jira password (**required**) |
|
|
63
|
+
| `-s` | `--scope` | `user` or `project` (default: `user`) |
|
|
64
|
+
|
|
65
|
+
### Supported CLI Tools
|
|
66
|
+
|
|
67
|
+
| CLI Tool | Command | Config Locations |
|
|
68
|
+
|----------|---------|------------------|
|
|
69
|
+
| **Claude Code** | `claude-code` | `~/.claude.json` (user) / `.mcp.json` (project) |
|
|
70
|
+
| **Claude Desktop** | `claude-desktop` | `~/Library/Application Support/Claude/...` |
|
|
71
|
+
| **GitHub Copilot** | `copilot` | `~/.mcp.json` (user) / `.vscode/mcp.json` (project) |
|
|
72
|
+
| **Cursor** | `cursor` | `~/.cursor/mcp.json` (user) / `.cursor/mcp.json` (project) |
|
|
73
|
+
| **Windsurf** | `windsurf` | `~/.codeium/windsurf/mcp_config.json` |
|
|
74
|
+
| **Roo Code** | `roo-code` | `~/.roo/mcp.json` (user) / `.roo/mcp.json` (project) |
|
|
75
|
+
| **Zed** | `zed` | `~/.config/zed/settings.json` |
|
|
76
|
+
| **Factory Droid** | `factory-droid` | `~/.factory/mcp.json` (user) / `.factory/mcp.json` (project) |
|
|
77
|
+
|
|
78
|
+
### Setup Examples
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Claude Code (user scope - available in all projects)
|
|
82
|
+
npx @lvmk/jira-mcp setup -c claude-code -b https://jira.example.com -u admin -p secret
|
|
83
|
+
|
|
84
|
+
# Cursor (project scope - only in current project)
|
|
85
|
+
npx @lvmk/jira-mcp setup -c cursor -b https://jira.example.com -u admin -p secret -s project
|
|
86
|
+
|
|
87
|
+
# GitHub Copilot (VS Code project config)
|
|
88
|
+
npx @lvmk/jira-mcp setup -c copilot -b https://jira.example.com -u admin -p secret -s project
|
|
89
|
+
|
|
90
|
+
# Claude Desktop
|
|
91
|
+
npx @lvmk/jira-mcp setup -c claude-desktop -b https://jira.example.com -u admin -p secret
|
|
92
|
+
|
|
93
|
+
# Factory Droid
|
|
94
|
+
npx @lvmk/jira-mcp setup -c factory-droid -b https://jira.example.com -u admin -p secret
|
|
95
|
+
|
|
96
|
+
# Windsurf
|
|
97
|
+
npx @lvmk/jira-mcp setup -c windsurf -b https://jira.example.com -u admin -p secret
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Other Commands
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Show help
|
|
104
|
+
npx @lvmk/jira-mcp --help
|
|
105
|
+
|
|
106
|
+
# List supported CLI tools
|
|
107
|
+
npx @lvmk/jira-mcp list-clis
|
|
108
|
+
|
|
109
|
+
# Show version
|
|
110
|
+
npx @lvmk/jira-mcp --version
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Environment Variables
|
|
116
|
+
|
|
117
|
+
| Variable | Required | Description |
|
|
118
|
+
|----------|----------|-------------|
|
|
119
|
+
| `JIRA_BASE_URL` | ✅ | Base URL of Jira instance (e.g., `http://jira.example.com:8080`) |
|
|
120
|
+
| `JIRA_USERNAME` | ✅ | Username for authentication |
|
|
121
|
+
| `JIRA_PASSWORD` | ✅ | Password for authentication |
|
|
122
|
+
| `JIRA_API_VERSION` | ❌ | API version (default: `2`) |
|
|
123
|
+
|
|
124
|
+
## Available Tools
|
|
125
|
+
|
|
126
|
+
### Issue Tools
|
|
127
|
+
|
|
128
|
+
| Tool | Description |
|
|
129
|
+
|------|-------------|
|
|
130
|
+
| `jira_get_issue` | Get issue details by key |
|
|
131
|
+
| `jira_create_issue` | Create a new issue |
|
|
132
|
+
| `jira_update_issue` | Update issue fields |
|
|
133
|
+
| `jira_delete_issue` | Delete an issue |
|
|
134
|
+
| `jira_add_comment` | Add comment to issue |
|
|
135
|
+
| `jira_get_comments` | Get issue comments |
|
|
136
|
+
|
|
137
|
+
### Search Tools
|
|
138
|
+
|
|
139
|
+
| Tool | Description |
|
|
140
|
+
|------|-------------|
|
|
141
|
+
| `jira_search` | Search issues using JQL |
|
|
142
|
+
|
|
143
|
+
### Project Tools
|
|
144
|
+
|
|
145
|
+
| Tool | Description |
|
|
146
|
+
|------|-------------|
|
|
147
|
+
| `jira_list_projects` | List all accessible projects |
|
|
148
|
+
| `jira_get_project` | Get project details |
|
|
149
|
+
|
|
150
|
+
### Transition Tools
|
|
151
|
+
|
|
152
|
+
| Tool | Description |
|
|
153
|
+
|------|-------------|
|
|
154
|
+
| `jira_get_transitions` | Get available transitions for issue |
|
|
155
|
+
| `jira_transition_issue` | Transition issue to new status |
|
|
156
|
+
|
|
157
|
+
### User Tools
|
|
158
|
+
|
|
159
|
+
| Tool | Description |
|
|
160
|
+
|------|-------------|
|
|
161
|
+
| `jira_get_current_user` | Get authenticated user info |
|
|
162
|
+
| `jira_get_user` | Get user by username |
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## MCP Configuration Examples
|
|
167
|
+
|
|
168
|
+
### Claude Code
|
|
169
|
+
|
|
170
|
+
**Project-level** (`.mcp.json` in project root):
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"mcpServers": {
|
|
174
|
+
"jira": {
|
|
175
|
+
"command": "npx",
|
|
176
|
+
"args": ["-y", "@lvmk/jira-mcp"],
|
|
177
|
+
"env": {
|
|
178
|
+
"JIRA_BASE_URL": "http://jira.example.com:8080",
|
|
179
|
+
"JIRA_USERNAME": "your-username",
|
|
180
|
+
"JIRA_PASSWORD": "your-password"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**User-level** (`~/.claude.json`):
|
|
188
|
+
```json
|
|
189
|
+
{
|
|
190
|
+
"mcpServers": {
|
|
191
|
+
"jira": {
|
|
192
|
+
"command": "npx",
|
|
193
|
+
"args": ["-y", "@lvmk/jira-mcp"],
|
|
194
|
+
"env": {
|
|
195
|
+
"JIRA_BASE_URL": "http://jira.example.com:8080",
|
|
196
|
+
"JIRA_USERNAME": "your-username",
|
|
197
|
+
"JIRA_PASSWORD": "your-password"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### OpenCode
|
|
207
|
+
|
|
208
|
+
**File:** `~/.opencode.json` or `./.opencode.json`
|
|
209
|
+
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"mcpServers": {
|
|
213
|
+
"jira": {
|
|
214
|
+
"type": "local",
|
|
215
|
+
"command": ["npx", "-y", "@lvmk/jira-mcp"],
|
|
216
|
+
"env": {
|
|
217
|
+
"JIRA_BASE_URL": "http://jira.example.com:8080",
|
|
218
|
+
"JIRA_USERNAME": "your-username",
|
|
219
|
+
"JIRA_PASSWORD": "your-password"
|
|
220
|
+
},
|
|
221
|
+
"enabled": true
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
### Google Antigravity
|
|
230
|
+
|
|
231
|
+
**File:** Custom MCP config (via MCP Store → "View raw config")
|
|
232
|
+
|
|
233
|
+
```json
|
|
234
|
+
{
|
|
235
|
+
"mcpServers": {
|
|
236
|
+
"jira": {
|
|
237
|
+
"command": "npx",
|
|
238
|
+
"args": ["-y", "@lvmk/jira-mcp"],
|
|
239
|
+
"env": {
|
|
240
|
+
"JIRA_BASE_URL": "http://jira.example.com:8080",
|
|
241
|
+
"JIRA_USERNAME": "your-username",
|
|
242
|
+
"JIRA_PASSWORD": "your-password"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
### Amp
|
|
252
|
+
|
|
253
|
+
**File:** Can be added via agent command or `AGENTS.md` reference
|
|
254
|
+
|
|
255
|
+
MCP configuration (same format as Claude):
|
|
256
|
+
```json
|
|
257
|
+
{
|
|
258
|
+
"mcpServers": {
|
|
259
|
+
"jira": {
|
|
260
|
+
"command": "npx",
|
|
261
|
+
"args": ["-y", "@lvmk/jira-mcp"],
|
|
262
|
+
"env": {
|
|
263
|
+
"JIRA_BASE_URL": "http://jira.example.com:8080",
|
|
264
|
+
"JIRA_USERNAME": "your-username",
|
|
265
|
+
"JIRA_PASSWORD": "your-password"
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
### GitHub Copilot
|
|
275
|
+
|
|
276
|
+
**Project-level** (`.vscode/mcp.json`):
|
|
277
|
+
```json
|
|
278
|
+
{
|
|
279
|
+
"servers": {
|
|
280
|
+
"jira": {
|
|
281
|
+
"type": "stdio",
|
|
282
|
+
"command": "npx",
|
|
283
|
+
"args": ["-y", "@lvmk/jira-mcp"],
|
|
284
|
+
"env": {
|
|
285
|
+
"JIRA_BASE_URL": "http://jira.example.com:8080",
|
|
286
|
+
"JIRA_USERNAME": "your-username",
|
|
287
|
+
"JIRA_PASSWORD": "your-password"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**User-level** (VS Code `settings.json`):
|
|
295
|
+
```json
|
|
296
|
+
{
|
|
297
|
+
"github.copilot.chat.mcpServers": {
|
|
298
|
+
"jira": {
|
|
299
|
+
"type": "stdio",
|
|
300
|
+
"command": "npx",
|
|
301
|
+
"args": ["-y", "@lvmk/jira-mcp"],
|
|
302
|
+
"env": {
|
|
303
|
+
"JIRA_BASE_URL": "http://jira.example.com:8080",
|
|
304
|
+
"JIRA_USERNAME": "your-username",
|
|
305
|
+
"JIRA_PASSWORD": "your-password"
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
### Claude Desktop
|
|
315
|
+
|
|
316
|
+
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
317
|
+
|
|
318
|
+
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
319
|
+
|
|
320
|
+
**Linux:** `~/.config/Claude/claude_desktop_config.json`
|
|
321
|
+
|
|
322
|
+
```json
|
|
323
|
+
{
|
|
324
|
+
"mcpServers": {
|
|
325
|
+
"jira": {
|
|
326
|
+
"command": "npx",
|
|
327
|
+
"args": ["-y", "@lvmk/jira-mcp"],
|
|
328
|
+
"env": {
|
|
329
|
+
"JIRA_BASE_URL": "http://jira.example.com:8080",
|
|
330
|
+
"JIRA_USERNAME": "your-username",
|
|
331
|
+
"JIRA_PASSWORD": "your-password"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## Usage Examples
|
|
341
|
+
|
|
342
|
+
### Search for open bugs
|
|
343
|
+
```
|
|
344
|
+
Use jira_search with JQL: "project = PROJ AND issuetype = Bug AND status = Open"
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### Create a new task
|
|
348
|
+
```
|
|
349
|
+
Use jira_create_issue with:
|
|
350
|
+
- projectKey: "PROJ"
|
|
351
|
+
- summary: "Implement new feature"
|
|
352
|
+
- issueType: "Task"
|
|
353
|
+
- description: "Details about the feature..."
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### Transition an issue
|
|
357
|
+
```
|
|
358
|
+
1. Use jira_get_transitions with issueKey: "PROJ-123"
|
|
359
|
+
2. Use jira_transition_issue with:
|
|
360
|
+
- issueKey: "PROJ-123"
|
|
361
|
+
- transitionId: "21" (from step 1)
|
|
362
|
+
- comment: "Moving to In Progress"
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## Development Guide
|
|
368
|
+
|
|
369
|
+
Want to fork and develop your own version? Here's everything you need to know.
|
|
370
|
+
|
|
371
|
+
### Prerequisites
|
|
372
|
+
|
|
373
|
+
- **Node.js** >= 18.0.0
|
|
374
|
+
- **npm** >= 9.0.0
|
|
375
|
+
- A Jira Server instance for testing
|
|
376
|
+
|
|
377
|
+
### Getting Started
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
# Clone repository
|
|
381
|
+
git clone git@github.com:stommazh/jira-mcp.git
|
|
382
|
+
cd jira-mcp
|
|
383
|
+
|
|
384
|
+
# Install dependencies
|
|
385
|
+
npm install
|
|
386
|
+
|
|
387
|
+
# Build TypeScript
|
|
388
|
+
npm run build
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### Project Structure
|
|
392
|
+
|
|
393
|
+
```
|
|
394
|
+
jira-mcp/
|
|
395
|
+
├── src/
|
|
396
|
+
│ ├── index.ts # Main entry - CLI commands & MCP server
|
|
397
|
+
│ ├── config.ts # Environment config with Zod validation
|
|
398
|
+
│ ├── client.ts # Jira REST API client (Basic Auth)
|
|
399
|
+
│ ├── setup.ts # CLI setup for AI tool configuration
|
|
400
|
+
│ └── tools/
|
|
401
|
+
│ ├── index.ts # Tool exports
|
|
402
|
+
│ ├── issues.ts # Issue CRUD & comments
|
|
403
|
+
│ ├── search.ts # JQL search
|
|
404
|
+
│ ├── projects.ts # Project listing
|
|
405
|
+
│ ├── transitions.ts # Workflow transitions
|
|
406
|
+
│ └── users.ts # User info
|
|
407
|
+
├── test/
|
|
408
|
+
│ ├── client.test.ts # Client integration tests
|
|
409
|
+
│ └── tools.test.ts # Tool handler tests
|
|
410
|
+
├── dist/ # Compiled output
|
|
411
|
+
├── package.json
|
|
412
|
+
├── tsconfig.json
|
|
413
|
+
└── tsconfig.test.json
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
### Environment Setup
|
|
417
|
+
|
|
418
|
+
Create a `.env` file in the project root:
|
|
419
|
+
|
|
420
|
+
```bash
|
|
421
|
+
JIRA_BASE_URL=https://your-jira-instance.com
|
|
422
|
+
JIRA_USERNAME=your-username
|
|
423
|
+
JIRA_PASSWORD=your-password
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### Available Scripts
|
|
427
|
+
|
|
428
|
+
| Script | Description |
|
|
429
|
+
|--------|-------------|
|
|
430
|
+
| `npm run build` | Compile TypeScript to `dist/` |
|
|
431
|
+
| `npm run dev` | Watch mode compilation |
|
|
432
|
+
| `npm run start` | Run compiled server |
|
|
433
|
+
| `npm run test:all` | Build and run all tests |
|
|
434
|
+
| `npm run test` | Run client tests only |
|
|
435
|
+
| `npm run test:tools` | Run tool handler tests only |
|
|
436
|
+
| `npm run test:integration` | Run MCP integration tests (Claude Code, OpenCode) |
|
|
437
|
+
| `npm run clean` | Remove `dist/` and `dist-test/` |
|
|
438
|
+
|
|
439
|
+
### Running Locally
|
|
440
|
+
|
|
441
|
+
```bash
|
|
442
|
+
# Method 1: With environment variables
|
|
443
|
+
JIRA_BASE_URL=https://jira.example.com \
|
|
444
|
+
JIRA_USERNAME=admin \
|
|
445
|
+
JIRA_PASSWORD=secret \
|
|
446
|
+
node dist/index.js
|
|
447
|
+
|
|
448
|
+
# Method 2: With .env file (requires dotenv in your test)
|
|
449
|
+
npm run test:all
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### Testing CLI Commands
|
|
453
|
+
|
|
454
|
+
```bash
|
|
455
|
+
# Show help
|
|
456
|
+
node dist/index.js --help
|
|
457
|
+
|
|
458
|
+
# Setup command help
|
|
459
|
+
node dist/index.js setup --help
|
|
460
|
+
|
|
461
|
+
# List supported CLIs
|
|
462
|
+
node dist/index.js list-clis
|
|
463
|
+
|
|
464
|
+
# Test setup (creates config in current directory)
|
|
465
|
+
node dist/index.js setup -c cursor -b https://jira.test.com -u test -p test -s project
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### Adding New Tools
|
|
469
|
+
|
|
470
|
+
1. **Create tool file** in `src/tools/`:
|
|
471
|
+
|
|
472
|
+
```typescript
|
|
473
|
+
// src/tools/my-tool.ts
|
|
474
|
+
import { z } from 'zod';
|
|
475
|
+
import { JiraClient } from '../client.js';
|
|
476
|
+
|
|
477
|
+
export const myToolSchema = z.object({
|
|
478
|
+
param1: z.string().describe('Description'),
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
export function createMyTools(client: JiraClient) {
|
|
482
|
+
return {
|
|
483
|
+
jira_my_tool: async (args: z.infer<typeof myToolSchema>) => {
|
|
484
|
+
// Implementation
|
|
485
|
+
return {
|
|
486
|
+
content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],
|
|
487
|
+
};
|
|
488
|
+
},
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export const myToolDefinitions = [
|
|
493
|
+
{
|
|
494
|
+
name: 'jira_my_tool',
|
|
495
|
+
description: 'Tool description',
|
|
496
|
+
inputSchema: {
|
|
497
|
+
type: 'object' as const,
|
|
498
|
+
properties: { param1: { type: 'string', description: 'Description' } },
|
|
499
|
+
required: ['param1'],
|
|
500
|
+
},
|
|
501
|
+
},
|
|
502
|
+
];
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
2. **Export from `src/tools/index.ts`**:
|
|
506
|
+
|
|
507
|
+
```typescript
|
|
508
|
+
export * from './my-tool.js';
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
3. **Register in `src/index.ts`**:
|
|
512
|
+
|
|
513
|
+
```typescript
|
|
514
|
+
import { createMyTools, myToolDefinitions } from './tools/index.js';
|
|
515
|
+
|
|
516
|
+
// In runMcpServer():
|
|
517
|
+
const myTools = createMyTools(jiraClient);
|
|
518
|
+
|
|
519
|
+
const allToolHandlers = {
|
|
520
|
+
...issueTools,
|
|
521
|
+
...myTools, // Add here
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
const allToolDefinitions = [
|
|
525
|
+
...issueToolDefinitions,
|
|
526
|
+
...myToolDefinitions, // Add here
|
|
527
|
+
];
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
### Adding Support for New CLI Tools
|
|
531
|
+
|
|
532
|
+
Edit `src/setup.ts` and add your CLI to the `configs` object in `getConfigFileInfo()`:
|
|
533
|
+
|
|
534
|
+
```typescript
|
|
535
|
+
'my-new-cli': {
|
|
536
|
+
user: { path: path.join(home, '.my-cli', 'config.json'), wrapperKey: 'mcpServers', serverKey: 'jira' },
|
|
537
|
+
project: { path: path.join(cwd, '.my-cli', 'config.json'), wrapperKey: 'mcpServers', serverKey: 'jira' },
|
|
538
|
+
},
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
Then add it to the `SupportedCli` type and `validClis` array.
|
|
542
|
+
|
|
543
|
+
### Publishing Your Fork
|
|
544
|
+
|
|
545
|
+
```bash
|
|
546
|
+
# Update package.json with your package name
|
|
547
|
+
npm version patch # or minor/major
|
|
548
|
+
|
|
549
|
+
# Build and publish
|
|
550
|
+
npm run build
|
|
551
|
+
npm publish --access public
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
### MCP Protocol Notes
|
|
555
|
+
|
|
556
|
+
- Uses **stdio transport** for npx execution
|
|
557
|
+
- All tools return `{ content: [{ type: 'text', text: '...' }] }`
|
|
558
|
+
- Errors return `{ content: [...], isError: true }`
|
|
559
|
+
- Server logs go to `stderr` (not `stdout`) to avoid protocol interference
|
|
560
|
+
|
|
561
|
+
### Claude Code Lazy Loading (2025+)
|
|
562
|
+
|
|
563
|
+
Claude Code v2.1.7+ supports lazy tool loading via "Tool Search":
|
|
564
|
+
- Tools are discovered dynamically instead of pre-loaded
|
|
565
|
+
- Dramatically reduces context token usage (134k → ~5k tokens)
|
|
566
|
+
- No changes needed on MCP server side - it's handled by Claude Code
|
|
567
|
+
|
|
568
|
+
---
|
|
569
|
+
|
|
570
|
+
## Contributing
|
|
571
|
+
|
|
572
|
+
1. Fork the repository
|
|
573
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
574
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
575
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
576
|
+
5. Open a Pull Request
|
|
577
|
+
|
|
578
|
+
---
|
|
579
|
+
|
|
580
|
+
## License
|
|
581
|
+
|
|
582
|
+
MIT
|
|
583
|
+
|