@mcpio/jira 2.1.1 → 2.2.1
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/dist/index.js +27 -8
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -3,8 +3,25 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
5
|
import axios from 'axios';
|
|
6
|
-
import
|
|
7
|
-
|
|
6
|
+
import { readFileSync } from 'fs';
|
|
7
|
+
import { resolve } from 'path';
|
|
8
|
+
try {
|
|
9
|
+
const envPath = resolve(process.cwd(), '.env');
|
|
10
|
+
const envContent = readFileSync(envPath, 'utf-8');
|
|
11
|
+
for (const line of envContent.split('\n')) {
|
|
12
|
+
const trimmed = line.trim();
|
|
13
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
14
|
+
continue;
|
|
15
|
+
const eqIndex = trimmed.indexOf('=');
|
|
16
|
+
if (eqIndex === -1)
|
|
17
|
+
continue;
|
|
18
|
+
const key = trimmed.slice(0, eqIndex).trim();
|
|
19
|
+
const value = trimmed.slice(eqIndex + 1).trim().replace(/^(['"])(.*)\1$/, '$2');
|
|
20
|
+
if (!process.env[key])
|
|
21
|
+
process.env[key] = value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
catch { }
|
|
8
25
|
function getRequiredEnv(name, fallback = null) {
|
|
9
26
|
const value = process.env[name];
|
|
10
27
|
if (value !== undefined && value !== '') {
|
|
@@ -736,10 +753,12 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
736
753
|
const { jql, maxResults = 50 } = a;
|
|
737
754
|
validateJQL(jql);
|
|
738
755
|
const validatedMaxResults = validateMaxResults(maxResults);
|
|
739
|
-
const response = await jiraApi.
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
756
|
+
const response = await jiraApi.get('/search/jql', {
|
|
757
|
+
params: {
|
|
758
|
+
jql,
|
|
759
|
+
maxResults: validatedMaxResults,
|
|
760
|
+
fields: 'summary,status,assignee,priority,created,updated,issuetype,parent,labels',
|
|
761
|
+
},
|
|
743
762
|
});
|
|
744
763
|
return createSuccessResponse({
|
|
745
764
|
total: response.data.total,
|
|
@@ -1048,9 +1067,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1048
1067
|
});
|
|
1049
1068
|
}
|
|
1050
1069
|
case 'jira_get_priorities': {
|
|
1051
|
-
const response = await jiraApi.get('/priority');
|
|
1070
|
+
const response = await jiraApi.get('/priority/search');
|
|
1052
1071
|
return createSuccessResponse({
|
|
1053
|
-
priorities: response.data.map((p) => ({
|
|
1072
|
+
priorities: response.data.values.map((p) => ({
|
|
1054
1073
|
id: p.id,
|
|
1055
1074
|
name: p.name,
|
|
1056
1075
|
description: p.description,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcpio/jira",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Model Context Protocol (MCP) server for Jira API
|
|
3
|
+
"version": "2.2.1",
|
|
4
|
+
"description": "Model Context Protocol (MCP) server for Jira Cloud API v3 with automatic Markdown-to-ADF conversion",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Volodymyr Press",
|
|
7
7
|
"email": "volodymyr.press.gpt@gmail.com"
|
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@modelcontextprotocol/sdk": "^1.20.2",
|
|
33
|
-
"axios": "^1.13.1"
|
|
34
|
-
"dotenv": "^17.2.3"
|
|
33
|
+
"axios": "^1.13.1"
|
|
35
34
|
},
|
|
36
35
|
"engines": {
|
|
37
36
|
"node": ">=18.0.0"
|