|
1 | 1 | #!/usr/bin/env node
|
2 | 2 |
|
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"; |
7 | 7 |
|
8 | 8 | /**
|
9 | 9 | * Main function to start the Jira MCP server
|
10 | 10 | */
|
11 | 11 | 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 | + } |
18 | 20 |
|
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 | + }); |
24 | 26 |
|
25 |
| - // Register all tools |
26 |
| - registerTools(server); |
| 27 | + // Register all tools |
| 28 | + registerTools(server); |
27 | 29 |
|
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); |
31 | 33 |
|
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 | + } |
37 | 39 | }
|
38 | 40 |
|
39 | 41 | // Start the server
|
|
0 commit comments