@elixium.ai/mcp-server 0.1.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/dist/index.js ADDED
@@ -0,0 +1,134 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
+ import axios from "axios";
6
+ const API_KEY = process.env.ELIXIUM_API_KEY;
7
+ const API_URL = process.env.ELIXIUM_API_URL || "https://elixium.ai/api";
8
+ if (!API_KEY) {
9
+ console.error("Error: ELIXIUM_API_KEY environment variable is required");
10
+ process.exit(1);
11
+ }
12
+ const client = axios.create({
13
+ baseURL: API_URL,
14
+ headers: {
15
+ "x-api-key": API_KEY,
16
+ "Content-Type": "application/json",
17
+ },
18
+ });
19
+ const server = new Server({
20
+ name: "elixium-mcp-server",
21
+ version: "0.1.0",
22
+ }, {
23
+ capabilities: {
24
+ tools: {},
25
+ },
26
+ });
27
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
28
+ return {
29
+ tools: [
30
+ {
31
+ name: "list_stories",
32
+ description: "List all stories on the Elixium board",
33
+ inputSchema: {
34
+ type: "object",
35
+ properties: {},
36
+ },
37
+ },
38
+ {
39
+ name: "create_story",
40
+ description: "Create a new story on the Elixium board",
41
+ inputSchema: {
42
+ type: "object",
43
+ properties: {
44
+ title: {
45
+ type: "string",
46
+ description: "Title of the story",
47
+ },
48
+ description: {
49
+ type: "string",
50
+ description: "Description of the story",
51
+ },
52
+ lane: {
53
+ type: "string",
54
+ description: "Lane to add the story to (BACKLOG, ICEBOX, CURRENT)",
55
+ enum: ["BACKLOG", "ICEBOX", "CURRENT"],
56
+ },
57
+ points: {
58
+ type: "number",
59
+ description: "Story points (0, 1, 2, 3, 5, 8)",
60
+ },
61
+ },
62
+ required: ["title"],
63
+ },
64
+ },
65
+ {
66
+ name: "get_iteration_context",
67
+ description: "Get the current iteration context (current stories and backlog) for AI planning",
68
+ inputSchema: {
69
+ type: "object",
70
+ properties: {},
71
+ },
72
+ },
73
+ ],
74
+ };
75
+ });
76
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
77
+ try {
78
+ switch (request.params.name) {
79
+ case "list_stories": {
80
+ const response = await client.get("/stories");
81
+ return {
82
+ content: [
83
+ {
84
+ type: "text",
85
+ text: JSON.stringify(response.data, null, 2),
86
+ },
87
+ ],
88
+ };
89
+ }
90
+ case "create_story": {
91
+ const args = request.params.arguments;
92
+ const response = await client.post("/stories", args);
93
+ return {
94
+ content: [
95
+ {
96
+ type: "text",
97
+ text: JSON.stringify(response.data, null, 2),
98
+ },
99
+ ],
100
+ };
101
+ }
102
+ case "get_iteration_context": {
103
+ const response = await client.get("/context");
104
+ return {
105
+ content: [
106
+ {
107
+ type: "text",
108
+ text: JSON.stringify(response.data, null, 2),
109
+ },
110
+ ],
111
+ };
112
+ }
113
+ default:
114
+ throw new Error("Unknown tool");
115
+ }
116
+ }
117
+ catch (error) {
118
+ console.error("Error executing tool:", error.message);
119
+ if (error.response) {
120
+ console.error("Response data:", error.response.data);
121
+ }
122
+ return {
123
+ content: [
124
+ {
125
+ type: "text",
126
+ text: `Error: ${error.message}`,
127
+ },
128
+ ],
129
+ isError: true,
130
+ };
131
+ }
132
+ });
133
+ const transport = new StdioServerTransport();
134
+ await server.connect(transport);
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@elixium.ai/mcp-server",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "MCP Server for Elixium.ai",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "main": "dist/index.js",
10
+ "bin": {
11
+ "elixium-mcp-server": "./dist/index.js"
12
+ },
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "start": "node dist/index.js",
16
+ "dev": "ts-node src/index.ts"
17
+ },
18
+ "dependencies": {
19
+ "@modelcontextprotocol/sdk": "^0.6.0",
20
+ "axios": "^1.6.0",
21
+ "zod": "^3.22.0"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "^20.0.0",
25
+ "ts-node": "^10.9.0",
26
+ "typescript": "^5.3.0"
27
+ }
28
+ }
package/src/index.ts ADDED
@@ -0,0 +1,151 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+ import {
6
+ CallToolRequestSchema,
7
+ ListToolsRequestSchema,
8
+ } from "@modelcontextprotocol/sdk/types.js";
9
+ import axios from "axios";
10
+ import { z } from "zod";
11
+
12
+ const API_KEY = process.env.ELIXIUM_API_KEY;
13
+ const API_URL = process.env.ELIXIUM_API_URL || "https://elixium.ai/api";
14
+
15
+ if (!API_KEY) {
16
+ console.error("Error: ELIXIUM_API_KEY environment variable is required");
17
+ process.exit(1);
18
+ }
19
+
20
+ const client = axios.create({
21
+ baseURL: API_URL,
22
+ headers: {
23
+ "x-api-key": API_KEY,
24
+ "Content-Type": "application/json",
25
+ },
26
+ });
27
+
28
+ const server = new Server(
29
+ {
30
+ name: "elixium-mcp-server",
31
+ version: "0.1.0",
32
+ },
33
+ {
34
+ capabilities: {
35
+ tools: {},
36
+ },
37
+ }
38
+ );
39
+
40
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
41
+ return {
42
+ tools: [
43
+ {
44
+ name: "list_stories",
45
+ description: "List all stories on the Elixium board",
46
+ inputSchema: {
47
+ type: "object",
48
+ properties: {},
49
+ },
50
+ },
51
+ {
52
+ name: "create_story",
53
+ description: "Create a new story on the Elixium board",
54
+ inputSchema: {
55
+ type: "object",
56
+ properties: {
57
+ title: {
58
+ type: "string",
59
+ description: "Title of the story",
60
+ },
61
+ description: {
62
+ type: "string",
63
+ description: "Description of the story",
64
+ },
65
+ lane: {
66
+ type: "string",
67
+ description: "Lane to add the story to (BACKLOG, ICEBOX, CURRENT)",
68
+ enum: ["BACKLOG", "ICEBOX", "CURRENT"],
69
+ },
70
+ points: {
71
+ type: "number",
72
+ description: "Story points (0, 1, 2, 3, 5, 8)",
73
+ },
74
+ },
75
+ required: ["title"],
76
+ },
77
+ },
78
+ {
79
+ name: "get_iteration_context",
80
+ description: "Get the current iteration context (current stories and backlog) for AI planning",
81
+ inputSchema: {
82
+ type: "object",
83
+ properties: {},
84
+ },
85
+ },
86
+ ],
87
+ };
88
+ });
89
+
90
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
91
+ try {
92
+ switch (request.params.name) {
93
+ case "list_stories": {
94
+ const response = await client.get("/stories");
95
+ return {
96
+ content: [
97
+ {
98
+ type: "text",
99
+ text: JSON.stringify(response.data, null, 2),
100
+ },
101
+ ],
102
+ };
103
+ }
104
+
105
+ case "create_story": {
106
+ const args = request.params.arguments as any;
107
+ const response = await client.post("/stories", args);
108
+ return {
109
+ content: [
110
+ {
111
+ type: "text",
112
+ text: JSON.stringify(response.data, null, 2),
113
+ },
114
+ ],
115
+ };
116
+ }
117
+
118
+ case "get_iteration_context": {
119
+ const response = await client.get("/context");
120
+ return {
121
+ content: [
122
+ {
123
+ type: "text",
124
+ text: JSON.stringify(response.data, null, 2),
125
+ },
126
+ ],
127
+ };
128
+ }
129
+
130
+ default:
131
+ throw new Error("Unknown tool");
132
+ }
133
+ } catch (error: any) {
134
+ console.error("Error executing tool:", error.message);
135
+ if (error.response) {
136
+ console.error("Response data:", error.response.data);
137
+ }
138
+ return {
139
+ content: [
140
+ {
141
+ type: "text",
142
+ text: `Error: ${error.message}`,
143
+ },
144
+ ],
145
+ isError: true,
146
+ };
147
+ }
148
+ });
149
+
150
+ const transport = new StdioServerTransport();
151
+ await server.connect(transport);
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "Node16",
5
+ "moduleResolution": "Node16",
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true
12
+ },
13
+ "include": ["src/**/*"]
14
+ }