Skip to content

Commit 0ccaa82

Browse files
committed
fix: simplify build process and update TypeScript configuration
- Replace Rollup with native TypeScript compilation - Update package.json scripts to use tsc and shx - Remove Rollup configuration files - Update import statements to use .js extensions - Enhance TypeScript base configuration - Standardize tsconfig.json across packages
1 parent 00a20b2 commit 0ccaa82

26 files changed

+542
-283
lines changed

core/http-client/core/http-client/CHANGELOG.md

-16
This file was deleted.

core/http-client/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../typescript-config/tsconfig.base.json",
2+
"extends": "@mcp-devtools/typescript-config/tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "./build",
55
"rootDir": "./src",

core/typescript-config/core/typescript-config/CHANGELOG.md

-16
This file was deleted.
+6-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2020",
4-
"module": "CommonJS",
5-
"moduleResolution": "Node",
3+
"target": "ES2022",
4+
"module": "Node16",
5+
"moduleResolution": "Node16",
66
"strict": true,
7+
"esModuleInterop": true,
78
"skipLibCheck": true,
89
"forceConsistentCasingInFileNames": true,
9-
"esModuleInterop": true
10+
"resolveJsonModule": true
1011
},
12+
"include": ["src/**/*"],
1113
"exclude": ["node_modules", "**/node_modules", "**/build", "**/dist"]
1214
}

packages/jira/package.json

+3-9
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@
66
"bin": {
77
"mcp-jira": "./build/index.js"
88
},
9-
"files": [
10-
"build"
11-
],
9+
"files": ["build"],
1210
"type": "module",
1311
"scripts": {
14-
"build:tsc": "rollup -c",
15-
"build:bundle": "pnpm run build:tsc",
16-
"build": "pnpm run build:tsc && npm run build:bundle && chmod +x build/index.js",
12+
"build": "tsc && shx chmod +x build/*.js",
1713
"prepare": "pnpm run build",
1814
"watch": "tsc --watch",
1915
"inspector": "npx @modelcontextprotocol/inspector build/index.js"
@@ -26,13 +22,11 @@
2622
},
2723
"devDependencies": {
2824
"@mcp-devtools/typescript-config": "workspace:*",
29-
"@rollup/plugin-commonjs": "^28.0.3",
30-
"@rollup/plugin-json": "^6.1.0",
31-
"@rollup/plugin-node-resolve": "^16.0.0",
3225
"@types/node": "^22.13.9",
3326
"@types/qs": "^6.9.14",
3427
"rollup": "^4.35.0",
3528
"rollup-plugin-typescript2": "^0.36.0",
29+
"shx": "^0.3.4",
3630
"typescript": "^5.8.2"
3731
}
3832
}

packages/jira/packages/jira/CHANGELOG.md

-15
This file was deleted.

packages/jira/rollup.config.js

-73
This file was deleted.

packages/jira/src/api.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { JIRA_URL, getAttachmentAuthHeaders, getAuthHeaders } from "./config";
1+
import {
2+
JIRA_URL,
3+
getAttachmentAuthHeaders,
4+
getAuthHeaders,
5+
} from "./config.js";
26
// Using Node.js built-in fetch API
37
import type {
48
JiraAttachmentResponse,
@@ -8,7 +12,7 @@ import type {
812
JiraStatus,
913
JiraTicketResponse,
1014
JiraUser,
11-
} from "./types";
15+
} from "./types.js";
1216

1317
/**
1418
* Execute a JQL query

packages/jira/src/index.ts

+27-25
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
11
#!/usr/bin/env node
22

3-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp';
4-
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio';
5-
import { validateConfig } from './config';
6-
import { registerTools } from './tools';
3+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5+
import { validateConfig } from "./config.js";
6+
import { registerTools } from "./tools.js";
77

88
/**
99
* Main function to start the Jira MCP server
1010
*/
1111
async function main(): Promise<void> {
12-
try {
13-
// Validate configuration
14-
if (!validateConfig()) {
15-
console.error('Missing required environment variables: JIRA_URL, JIRA_API_MAIL, or JIRA_API_KEY');
16-
process.exit(1);
17-
}
12+
try {
13+
// Validate configuration
14+
if (!validateConfig()) {
15+
console.error(
16+
"Missing required environment variables: JIRA_URL, JIRA_API_MAIL, or JIRA_API_KEY",
17+
);
18+
process.exit(1);
19+
}
1820

19-
// Initialize server
20-
const server = new McpServer({
21-
name: "jira-mcp-server",
22-
version: "1.0.0"
23-
});
21+
// Initialize server
22+
const server = new McpServer({
23+
name: "jira-mcp-server",
24+
version: "1.0.0",
25+
});
2426

25-
// Register all tools
26-
registerTools(server);
27+
// Register all tools
28+
registerTools(server);
2729

28-
// Connect to transport
29-
const transport = new StdioServerTransport();
30-
await server.connect(transport);
30+
// Connect to transport
31+
const transport = new StdioServerTransport();
32+
await server.connect(transport);
3133

32-
console.error('Jira MCP Server started');
33-
} catch (error) {
34-
console.error('Failed to start Jira MCP Server:', error);
35-
process.exit(1);
36-
}
34+
console.error("Jira MCP Server started");
35+
} catch (error) {
36+
console.error("Failed to start Jira MCP Server:", error);
37+
process.exit(1);
38+
}
3739
}
3840

3941
// Start the server

packages/jira/src/tools.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
registerQueryAssignableTool,
1212
registerAddAttachmentFromUrlTool,
1313
registerAddAttachmentFromConfluenceTool
14-
} from './tools/index';
14+
} from './tools/index.js';
1515

1616
/**
1717
* Register all tools for the Jira MCP server
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
1-
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp';
2-
import * as jiraApi from '../api';
1+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
32
import { z } from "zod";
3+
import * as jiraApi from "../api.js";
44

55
/**
66
* Register the add_attachment_from_confluence tool
77
*/
8-
export const registerAddAttachmentFromConfluenceTool = (server: McpServer): void => {
9-
server.tool(
10-
"add_attachment_from_confluence",
11-
{
12-
issueIdOrKey: z.string().describe("Issue ID or key to add attachment to"),
13-
pageId: z.string().describe("Confluence page ID"),
14-
attachmentName: z.string().describe("Name of the attachment in Confluence")
15-
},
16-
async ({ issueIdOrKey, pageId, attachmentName }) => {
17-
const response = await jiraApi.addAttachmentFromConfluence(issueIdOrKey, pageId, attachmentName);
18-
19-
return {
20-
content: [{
21-
type: "text",
22-
text: `Attachment added: ${JSON.stringify(response, null, 2)}`
23-
}]
24-
};
25-
}
26-
);
27-
};
8+
export const registerAddAttachmentFromConfluenceTool = (
9+
server: McpServer,
10+
): void => {
11+
server.tool(
12+
"add_attachment_from_confluence",
13+
{
14+
issueIdOrKey: z.string().describe("Issue ID or key to add attachment to"),
15+
pageId: z.string().describe("Confluence page ID"),
16+
attachmentName: z
17+
.string()
18+
.describe("Name of the attachment in Confluence"),
19+
},
20+
async ({ issueIdOrKey, pageId, attachmentName }) => {
21+
const response = await jiraApi.addAttachmentFromConfluence(
22+
issueIdOrKey,
23+
pageId,
24+
attachmentName,
25+
);
26+
27+
return {
28+
content: [
29+
{
30+
type: "text",
31+
text: `Attachment added: ${JSON.stringify(response, null, 2)}`,
32+
},
33+
],
34+
};
35+
},
36+
);
37+
};
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp';
2-
import * as jiraApi from '../api';
1+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
32
import { z } from "zod";
3+
import * as jiraApi from "../api.js";
44

55
/**
66
* Register the add_attachment_from_public_url tool
77
*/
88
export const registerAddAttachmentFromUrlTool = (server: McpServer): void => {
9-
server.tool(
10-
"add_attachment_from_public_url",
11-
{
12-
issueIdOrKey: z.string().describe("Issue ID or key to add attachment to"),
13-
imageUrl: z.string().describe("Public URL of the image to attach")
14-
},
15-
async ({ issueIdOrKey, imageUrl }) => {
16-
const response = await jiraApi.addAttachment(issueIdOrKey, imageUrl);
17-
18-
return {
19-
content: [{
20-
type: "text",
21-
text: `Attachment added: ${JSON.stringify(response, null, 2)}`
22-
}]
23-
};
24-
}
25-
);
26-
};
9+
server.tool(
10+
"add_attachment_from_public_url",
11+
{
12+
issueIdOrKey: z.string().describe("Issue ID or key to add attachment to"),
13+
imageUrl: z.string().describe("Public URL of the image to attach"),
14+
},
15+
async ({ issueIdOrKey, imageUrl }) => {
16+
const response = await jiraApi.addAttachment(issueIdOrKey, imageUrl);
17+
18+
return {
19+
content: [
20+
{
21+
type: "text",
22+
text: `Attachment added: ${JSON.stringify(response, null, 2)}`,
23+
},
24+
],
25+
};
26+
},
27+
);
28+
};

packages/jira/src/tools/assignTicket.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
1+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
22
import { z } from "zod";
3-
import * as jiraApi from "../api";
3+
import * as jiraApi from "../api.js";
44

55
/**
66
* Register the assign_ticket tool

0 commit comments

Comments
 (0)