@agllama/mcp 0.5.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 +248 -0
- package/dist/api-client.d.ts +120 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +421 -0
- package/dist/api-client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +673 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/backlog.d.ts +22 -0
- package/dist/tools/backlog.d.ts.map +1 -0
- package/dist/tools/backlog.js +109 -0
- package/dist/tools/backlog.js.map +1 -0
- package/dist/tools/boardConfig.d.ts +77 -0
- package/dist/tools/boardConfig.d.ts.map +1 -0
- package/dist/tools/boardConfig.js +154 -0
- package/dist/tools/boardConfig.js.map +1 -0
- package/dist/tools/boardTemplates.d.ts +47 -0
- package/dist/tools/boardTemplates.d.ts.map +1 -0
- package/dist/tools/boardTemplates.js +119 -0
- package/dist/tools/boardTemplates.js.map +1 -0
- package/dist/tools/boards.d.ts +62 -0
- package/dist/tools/boards.d.ts.map +1 -0
- package/dist/tools/boards.js +260 -0
- package/dist/tools/boards.js.map +1 -0
- package/dist/tools/comments.d.ts +82 -0
- package/dist/tools/comments.d.ts.map +1 -0
- package/dist/tools/comments.js +275 -0
- package/dist/tools/comments.js.map +1 -0
- package/dist/tools/connect.d.ts +7 -0
- package/dist/tools/connect.d.ts.map +1 -0
- package/dist/tools/connect.js +50 -0
- package/dist/tools/connect.js.map +1 -0
- package/dist/tools/context.d.ts +19 -0
- package/dist/tools/context.d.ts.map +1 -0
- package/dist/tools/context.js +136 -0
- package/dist/tools/context.js.map +1 -0
- package/dist/tools/documents.d.ts +99 -0
- package/dist/tools/documents.d.ts.map +1 -0
- package/dist/tools/documents.js +252 -0
- package/dist/tools/documents.js.map +1 -0
- package/dist/tools/help.d.ts +13 -0
- package/dist/tools/help.d.ts.map +1 -0
- package/dist/tools/help.js +485 -0
- package/dist/tools/help.js.map +1 -0
- package/dist/tools/index.d.ts +21 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +21 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/issueLinks.d.ts +45 -0
- package/dist/tools/issueLinks.d.ts.map +1 -0
- package/dist/tools/issueLinks.js +147 -0
- package/dist/tools/issueLinks.js.map +1 -0
- package/dist/tools/issues.d.ts +307 -0
- package/dist/tools/issues.d.ts.map +1 -0
- package/dist/tools/issues.js +715 -0
- package/dist/tools/issues.js.map +1 -0
- package/dist/tools/labels.d.ts +56 -0
- package/dist/tools/labels.d.ts.map +1 -0
- package/dist/tools/labels.js +213 -0
- package/dist/tools/labels.js.map +1 -0
- package/dist/tools/members.d.ts +13 -0
- package/dist/tools/members.d.ts.map +1 -0
- package/dist/tools/members.js +43 -0
- package/dist/tools/members.js.map +1 -0
- package/dist/tools/organizations.d.ts +35 -0
- package/dist/tools/organizations.d.ts.map +1 -0
- package/dist/tools/organizations.js +116 -0
- package/dist/tools/organizations.js.map +1 -0
- package/dist/tools/projects.d.ts +67 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +165 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/search.d.ts +34 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +85 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/session.d.ts +38 -0
- package/dist/tools/session.d.ts.map +1 -0
- package/dist/tools/session.js +158 -0
- package/dist/tools/session.js.map +1 -0
- package/dist/tools/sprints.d.ts +141 -0
- package/dist/tools/sprints.d.ts.map +1 -0
- package/dist/tools/sprints.js +470 -0
- package/dist/tools/sprints.js.map +1 -0
- package/dist/tools/status.d.ts +22 -0
- package/dist/tools/status.d.ts.map +1 -0
- package/dist/tools/status.js +81 -0
- package/dist/tools/status.js.map +1 -0
- package/dist/tools/workflows.d.ts +137 -0
- package/dist/tools/workflows.d.ts.map +1 -0
- package/dist/tools/workflows.js +355 -0
- package/dist/tools/workflows.js.map +1 -0
- package/dist/types.d.ts +434 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/column-instructions.d.ts +21 -0
- package/dist/utils/column-instructions.d.ts.map +1 -0
- package/dist/utils/column-instructions.js +54 -0
- package/dist/utils/column-instructions.js.map +1 -0
- package/package.json +63 -0
package/dist/server.js
ADDED
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
|
+
import {
|
|
5
|
+
// Session helper
|
|
6
|
+
getSessionDefaults,
|
|
7
|
+
// Connection & Context
|
|
8
|
+
connectToolName, connectToolDescription, connectToolSchema, executeConnect, contextToolName, contextToolDescription, contextToolSchema, executeContext,
|
|
9
|
+
// Issues
|
|
10
|
+
getIssueToolName, getIssueToolDescription, getIssueToolSchema, executeGetIssue, createIssueToolName, createIssueToolDescription, createIssueToolSchema, executeCreateIssue, updateIssueToolName, updateIssueToolDescription, updateIssueToolSchema, executeUpdateIssue, deleteIssueToolName, deleteIssueToolDescription, deleteIssueToolSchema, executeDeleteIssue,
|
|
11
|
+
// Batch Operations
|
|
12
|
+
batchCreateIssuesToolName, batchCreateIssuesToolDescription, batchCreateIssuesToolSchema, executeBatchCreateIssues, batchUpdateStatusToolName, batchUpdateStatusToolDescription, batchUpdateStatusToolSchema, executeBatchUpdateStatus, batchUpdateIssuesToolName, batchUpdateIssuesToolDescription, batchUpdateIssuesToolSchema, executeBatchUpdateIssues,
|
|
13
|
+
// Status
|
|
14
|
+
updateStatusToolName, updateStatusToolDescription, updateStatusToolSchema, executeUpdateStatus,
|
|
15
|
+
// Sprints
|
|
16
|
+
listSprintsToolName, listSprintsToolDescription, listSprintsToolSchema, executeListSprints, createSprintToolName, createSprintToolDescription, createSprintToolSchema, executeCreateSprint, addToSprintToolName, addToSprintToolDescription, addToSprintToolSchema, executeAddToSprint,
|
|
17
|
+
// Search
|
|
18
|
+
searchToolName, searchToolDescription, searchToolSchema, executeSearch,
|
|
19
|
+
// Organizations
|
|
20
|
+
listOrganizationsToolName, listOrganizationsToolDescription, listOrganizationsToolSchema, executeListOrganizations, getOrganizationToolName, getOrganizationToolDescription, getOrganizationToolSchema, executeGetOrganization, createOrganizationToolName, createOrganizationToolDescription, createOrganizationToolSchema, executeCreateOrganization,
|
|
21
|
+
// Projects
|
|
22
|
+
listProjectsToolName, listProjectsToolDescription, listProjectsToolSchema, executeListProjects, getProjectToolName, getProjectToolDescription, getProjectToolSchema, executeGetProject, createProjectToolName, createProjectToolDescription, createProjectToolSchema, executeCreateProject, updateProjectToolName, updateProjectToolDescription, updateProjectToolSchema, executeUpdateProject,
|
|
23
|
+
// Boards
|
|
24
|
+
listBoardsToolName, listBoardsToolDescription, listBoardsToolSchema, executeListBoards, getBoardToolName, getBoardToolDescription, getBoardToolSchema, executeGetBoard, moveIssueOnBoardToolName, moveIssueOnBoardToolDescription, moveIssueOnBoardToolSchema, executeMoveIssueOnBoard,
|
|
25
|
+
// Board Config
|
|
26
|
+
getBoardConfigToolName, getBoardConfigToolDescription, getBoardConfigToolSchema, executeGetBoardConfig, updateColumnConfigToolName, updateColumnConfigToolDescription, updateColumnConfigToolSchema, executeUpdateColumnConfig, getColumnInstructionsToolName, getColumnInstructionsToolDescription, getColumnInstructionsToolSchema, executeGetColumnInstructions,
|
|
27
|
+
// Board Templates
|
|
28
|
+
listBoardTemplatesToolName, listBoardTemplatesToolDescription, listBoardTemplatesToolSchema, executeListBoardTemplates, applyBoardTemplateToolName, applyBoardTemplateToolDescription, applyBoardTemplateToolSchema, executeApplyBoardTemplate, cloneBoardConfigToolName, cloneBoardConfigToolDescription, cloneBoardConfigToolSchema, executeCloneBoardConfig,
|
|
29
|
+
// Backlog
|
|
30
|
+
getBacklogToolName, getBacklogToolDescription, getBacklogToolSchema, executeGetBacklog,
|
|
31
|
+
// Comments
|
|
32
|
+
listCommentsToolName, listCommentsToolDescription, listCommentsToolSchema, executeListComments, addCommentToolName, addCommentToolDescription, addCommentToolSchema, executeAddComment, updateCommentToolName, updateCommentToolDescription, updateCommentToolSchema, executeUpdateComment, deleteCommentToolName, deleteCommentToolDescription, deleteCommentToolSchema, executeDeleteComment,
|
|
33
|
+
// Labels
|
|
34
|
+
listLabelsToolName, listLabelsToolDescription, listLabelsToolSchema, executeListLabels, createLabelToolName, createLabelToolDescription, createLabelToolSchema, executeCreateLabel, deleteLabelToolName, deleteLabelToolDescription, deleteLabelToolSchema, executeDeleteLabel,
|
|
35
|
+
// Members
|
|
36
|
+
listMembersToolName, listMembersToolDescription, listMembersToolSchema, executeListMembers,
|
|
37
|
+
// Issue Links
|
|
38
|
+
createIssueLinkToolName, createIssueLinkToolDescription, createIssueLinkToolSchema, executeCreateIssueLink, deleteIssueLinkToolName, deleteIssueLinkToolDescription, deleteIssueLinkToolSchema, executeDeleteIssueLink,
|
|
39
|
+
// Sprint Lifecycle
|
|
40
|
+
getSprintToolName, getSprintToolDescription, getSprintToolSchema, executeGetSprint, startSprintToolName, startSprintToolDescription, startSprintToolSchema, executeStartSprint, completeSprintToolName, completeSprintToolDescription, completeSprintToolSchema, executeCompleteSprint, updateSprintToolName, updateSprintToolDescription, updateSprintToolSchema, executeUpdateSprint, deleteSprintToolName, deleteSprintToolDescription, deleteSprintToolSchema, executeDeleteSprint,
|
|
41
|
+
// Claude Workflows
|
|
42
|
+
createWorkflowToolName, createWorkflowToolDescription, createWorkflowToolSchema, executeCreateWorkflow, updateWorkflowToolName, updateWorkflowToolDescription, updateWorkflowToolSchema, executeUpdateWorkflow, listWorkflowsToolName, listWorkflowsToolDescription, listWorkflowsToolSchema, executeListWorkflows, getWorkflowToolName, getWorkflowToolDescription, getWorkflowToolSchema, executeGetWorkflow, runWorkflowToolName, runWorkflowToolDescription, runWorkflowToolSchema, executeRunWorkflow, suggestWorkflowToolName, suggestWorkflowToolDescription, suggestWorkflowToolSchema, executeSuggestWorkflow,
|
|
43
|
+
// Documents
|
|
44
|
+
listDocsToolName, listDocsToolDescription, listDocsToolSchema, executeListDocs, getDocToolName, getDocToolDescription, getDocToolSchema, executeGetDoc, createDocToolName, createDocToolDescription, createDocToolSchema, executeCreateDoc, updateDocToolName, updateDocToolDescription, updateDocToolSchema, executeUpdateDoc, deleteDocToolName, deleteDocToolDescription, deleteDocToolSchema, executeDeleteDoc,
|
|
45
|
+
// Help
|
|
46
|
+
helpToolName, helpToolDescription, helpToolSchema, executeHelp,
|
|
47
|
+
// Session
|
|
48
|
+
setContextToolName, setContextToolDescription, setContextToolSchema, executeSetContext, resumeToolName, resumeToolDescription, resumeToolSchema, executeResume, clearSessionToolName, clearSessionToolDescription, clearSessionToolSchema, executeClearSession, } from './tools/index.js';
|
|
49
|
+
/**
|
|
50
|
+
* Generate session header string for tool responses.
|
|
51
|
+
* Format: [Session: org/project/sprint] or [Session: none]
|
|
52
|
+
*/
|
|
53
|
+
async function getSessionHeader() {
|
|
54
|
+
try {
|
|
55
|
+
const session = await getSessionDefaults();
|
|
56
|
+
if (!session?.orgSlug) {
|
|
57
|
+
return '[Session: none]';
|
|
58
|
+
}
|
|
59
|
+
const parts = [session.orgSlug];
|
|
60
|
+
if (session.projectKey)
|
|
61
|
+
parts.push(session.projectKey);
|
|
62
|
+
if (session.sprintId)
|
|
63
|
+
parts.push(session.sprintId.slice(0, 8) + '...');
|
|
64
|
+
return `[Session: ${parts.join('/')}]`;
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return '[Session: unavailable]';
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// Convert Zod schema to JSON Schema for MCP
|
|
71
|
+
function zodToJsonSchema(schema) {
|
|
72
|
+
const shape = schema.shape || (schema._def?.shape ? schema._def.shape() : {});
|
|
73
|
+
const properties = {};
|
|
74
|
+
const required = [];
|
|
75
|
+
// Helper to get the inner type from optional/nullable wrappers
|
|
76
|
+
function getInnerTypeName(def) {
|
|
77
|
+
const typeName = def?.typeName;
|
|
78
|
+
// Unwrap ZodOptional -> get inner type
|
|
79
|
+
if (typeName === 'ZodOptional' && def.innerType?._def) {
|
|
80
|
+
return getInnerTypeName(def.innerType._def);
|
|
81
|
+
}
|
|
82
|
+
// Unwrap ZodNullable -> get inner type
|
|
83
|
+
if (typeName === 'ZodNullable' && def.innerType?._def) {
|
|
84
|
+
return getInnerTypeName(def.innerType._def);
|
|
85
|
+
}
|
|
86
|
+
return typeName || 'ZodString';
|
|
87
|
+
}
|
|
88
|
+
for (const [key, value] of Object.entries(shape)) {
|
|
89
|
+
const fieldDef = value;
|
|
90
|
+
const def = fieldDef._def;
|
|
91
|
+
const innerTypeName = getInnerTypeName(def || {});
|
|
92
|
+
let type = 'string';
|
|
93
|
+
let enumValues;
|
|
94
|
+
let additionalProperties;
|
|
95
|
+
if (innerTypeName === 'ZodNumber') {
|
|
96
|
+
type = 'number';
|
|
97
|
+
}
|
|
98
|
+
else if (innerTypeName === 'ZodBoolean') {
|
|
99
|
+
type = 'boolean';
|
|
100
|
+
}
|
|
101
|
+
else if (innerTypeName === 'ZodArray') {
|
|
102
|
+
type = 'array';
|
|
103
|
+
}
|
|
104
|
+
else if (innerTypeName === 'ZodRecord') {
|
|
105
|
+
// ZodRecord maps to JSON Schema object with additionalProperties
|
|
106
|
+
type = 'object';
|
|
107
|
+
additionalProperties = { type: 'string' };
|
|
108
|
+
}
|
|
109
|
+
else if (innerTypeName === 'ZodEnum') {
|
|
110
|
+
// For enums, we need to get values from the right level
|
|
111
|
+
enumValues = def?.values || def?.innerType?._def?.values;
|
|
112
|
+
}
|
|
113
|
+
const prop = { type };
|
|
114
|
+
if (enumValues) {
|
|
115
|
+
prop.enum = enumValues;
|
|
116
|
+
}
|
|
117
|
+
if (additionalProperties) {
|
|
118
|
+
prop.additionalProperties = additionalProperties;
|
|
119
|
+
}
|
|
120
|
+
if (def?.description || fieldDef.description) {
|
|
121
|
+
prop.description = def?.description || fieldDef.description;
|
|
122
|
+
}
|
|
123
|
+
properties[key] = prop;
|
|
124
|
+
// Check if required (not optional or nullable)
|
|
125
|
+
const isOptional = def?.typeName === 'ZodOptional' || def?.typeName === 'ZodNullable';
|
|
126
|
+
if (!isOptional) {
|
|
127
|
+
required.push(key);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
type: 'object',
|
|
132
|
+
properties,
|
|
133
|
+
required: required.length > 0 ? required : undefined,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
// Tool definitions for MCP
|
|
137
|
+
const tools = [
|
|
138
|
+
// Connection & Context
|
|
139
|
+
{
|
|
140
|
+
name: connectToolName,
|
|
141
|
+
description: connectToolDescription,
|
|
142
|
+
inputSchema: zodToJsonSchema(connectToolSchema),
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: contextToolName,
|
|
146
|
+
description: contextToolDescription,
|
|
147
|
+
inputSchema: zodToJsonSchema(contextToolSchema),
|
|
148
|
+
},
|
|
149
|
+
// Organizations
|
|
150
|
+
{
|
|
151
|
+
name: listOrganizationsToolName,
|
|
152
|
+
description: listOrganizationsToolDescription,
|
|
153
|
+
inputSchema: zodToJsonSchema(listOrganizationsToolSchema),
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: getOrganizationToolName,
|
|
157
|
+
description: getOrganizationToolDescription,
|
|
158
|
+
inputSchema: zodToJsonSchema(getOrganizationToolSchema),
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: createOrganizationToolName,
|
|
162
|
+
description: createOrganizationToolDescription,
|
|
163
|
+
inputSchema: zodToJsonSchema(createOrganizationToolSchema),
|
|
164
|
+
},
|
|
165
|
+
// Projects
|
|
166
|
+
{
|
|
167
|
+
name: listProjectsToolName,
|
|
168
|
+
description: listProjectsToolDescription,
|
|
169
|
+
inputSchema: zodToJsonSchema(listProjectsToolSchema),
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: getProjectToolName,
|
|
173
|
+
description: getProjectToolDescription,
|
|
174
|
+
inputSchema: zodToJsonSchema(getProjectToolSchema),
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: createProjectToolName,
|
|
178
|
+
description: createProjectToolDescription,
|
|
179
|
+
inputSchema: zodToJsonSchema(createProjectToolSchema),
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: updateProjectToolName,
|
|
183
|
+
description: updateProjectToolDescription,
|
|
184
|
+
inputSchema: zodToJsonSchema(updateProjectToolSchema),
|
|
185
|
+
},
|
|
186
|
+
// Issues
|
|
187
|
+
{
|
|
188
|
+
name: getIssueToolName,
|
|
189
|
+
description: getIssueToolDescription,
|
|
190
|
+
inputSchema: zodToJsonSchema(getIssueToolSchema),
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: createIssueToolName,
|
|
194
|
+
description: createIssueToolDescription,
|
|
195
|
+
inputSchema: zodToJsonSchema(createIssueToolSchema),
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: updateIssueToolName,
|
|
199
|
+
description: updateIssueToolDescription,
|
|
200
|
+
inputSchema: zodToJsonSchema(updateIssueToolSchema),
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: deleteIssueToolName,
|
|
204
|
+
description: deleteIssueToolDescription,
|
|
205
|
+
inputSchema: zodToJsonSchema(deleteIssueToolSchema),
|
|
206
|
+
},
|
|
207
|
+
// Batch Operations
|
|
208
|
+
{
|
|
209
|
+
name: batchCreateIssuesToolName,
|
|
210
|
+
description: batchCreateIssuesToolDescription,
|
|
211
|
+
inputSchema: zodToJsonSchema(batchCreateIssuesToolSchema),
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: batchUpdateStatusToolName,
|
|
215
|
+
description: batchUpdateStatusToolDescription,
|
|
216
|
+
inputSchema: zodToJsonSchema(batchUpdateStatusToolSchema),
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: batchUpdateIssuesToolName,
|
|
220
|
+
description: batchUpdateIssuesToolDescription,
|
|
221
|
+
inputSchema: zodToJsonSchema(batchUpdateIssuesToolSchema),
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: updateStatusToolName,
|
|
225
|
+
description: updateStatusToolDescription,
|
|
226
|
+
inputSchema: zodToJsonSchema(updateStatusToolSchema),
|
|
227
|
+
},
|
|
228
|
+
// Boards
|
|
229
|
+
{
|
|
230
|
+
name: listBoardsToolName,
|
|
231
|
+
description: listBoardsToolDescription,
|
|
232
|
+
inputSchema: zodToJsonSchema(listBoardsToolSchema),
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: getBoardToolName,
|
|
236
|
+
description: getBoardToolDescription,
|
|
237
|
+
inputSchema: zodToJsonSchema(getBoardToolSchema),
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: moveIssueOnBoardToolName,
|
|
241
|
+
description: moveIssueOnBoardToolDescription,
|
|
242
|
+
inputSchema: zodToJsonSchema(moveIssueOnBoardToolSchema),
|
|
243
|
+
},
|
|
244
|
+
// Board Config
|
|
245
|
+
{
|
|
246
|
+
name: getBoardConfigToolName,
|
|
247
|
+
description: getBoardConfigToolDescription,
|
|
248
|
+
inputSchema: zodToJsonSchema(getBoardConfigToolSchema),
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
name: updateColumnConfigToolName,
|
|
252
|
+
description: updateColumnConfigToolDescription,
|
|
253
|
+
inputSchema: zodToJsonSchema(updateColumnConfigToolSchema),
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
name: getColumnInstructionsToolName,
|
|
257
|
+
description: getColumnInstructionsToolDescription,
|
|
258
|
+
inputSchema: zodToJsonSchema(getColumnInstructionsToolSchema),
|
|
259
|
+
},
|
|
260
|
+
// Board Templates
|
|
261
|
+
{
|
|
262
|
+
name: listBoardTemplatesToolName,
|
|
263
|
+
description: listBoardTemplatesToolDescription,
|
|
264
|
+
inputSchema: zodToJsonSchema(listBoardTemplatesToolSchema),
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: applyBoardTemplateToolName,
|
|
268
|
+
description: applyBoardTemplateToolDescription,
|
|
269
|
+
inputSchema: zodToJsonSchema(applyBoardTemplateToolSchema),
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: cloneBoardConfigToolName,
|
|
273
|
+
description: cloneBoardConfigToolDescription,
|
|
274
|
+
inputSchema: zodToJsonSchema(cloneBoardConfigToolSchema),
|
|
275
|
+
},
|
|
276
|
+
// Backlog
|
|
277
|
+
{
|
|
278
|
+
name: getBacklogToolName,
|
|
279
|
+
description: getBacklogToolDescription,
|
|
280
|
+
inputSchema: zodToJsonSchema(getBacklogToolSchema),
|
|
281
|
+
},
|
|
282
|
+
// Sprints
|
|
283
|
+
{
|
|
284
|
+
name: listSprintsToolName,
|
|
285
|
+
description: listSprintsToolDescription,
|
|
286
|
+
inputSchema: zodToJsonSchema(listSprintsToolSchema),
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: createSprintToolName,
|
|
290
|
+
description: createSprintToolDescription,
|
|
291
|
+
inputSchema: zodToJsonSchema(createSprintToolSchema),
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: addToSprintToolName,
|
|
295
|
+
description: addToSprintToolDescription,
|
|
296
|
+
inputSchema: zodToJsonSchema(addToSprintToolSchema),
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: getSprintToolName,
|
|
300
|
+
description: getSprintToolDescription,
|
|
301
|
+
inputSchema: zodToJsonSchema(getSprintToolSchema),
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
name: startSprintToolName,
|
|
305
|
+
description: startSprintToolDescription,
|
|
306
|
+
inputSchema: zodToJsonSchema(startSprintToolSchema),
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: completeSprintToolName,
|
|
310
|
+
description: completeSprintToolDescription,
|
|
311
|
+
inputSchema: zodToJsonSchema(completeSprintToolSchema),
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: updateSprintToolName,
|
|
315
|
+
description: updateSprintToolDescription,
|
|
316
|
+
inputSchema: zodToJsonSchema(updateSprintToolSchema),
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
name: deleteSprintToolName,
|
|
320
|
+
description: deleteSprintToolDescription,
|
|
321
|
+
inputSchema: zodToJsonSchema(deleteSprintToolSchema),
|
|
322
|
+
},
|
|
323
|
+
// Comments
|
|
324
|
+
{
|
|
325
|
+
name: listCommentsToolName,
|
|
326
|
+
description: listCommentsToolDescription,
|
|
327
|
+
inputSchema: zodToJsonSchema(listCommentsToolSchema),
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
name: addCommentToolName,
|
|
331
|
+
description: addCommentToolDescription,
|
|
332
|
+
inputSchema: zodToJsonSchema(addCommentToolSchema),
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
name: updateCommentToolName,
|
|
336
|
+
description: updateCommentToolDescription,
|
|
337
|
+
inputSchema: zodToJsonSchema(updateCommentToolSchema),
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
name: deleteCommentToolName,
|
|
341
|
+
description: deleteCommentToolDescription,
|
|
342
|
+
inputSchema: zodToJsonSchema(deleteCommentToolSchema),
|
|
343
|
+
},
|
|
344
|
+
// Labels
|
|
345
|
+
{
|
|
346
|
+
name: listLabelsToolName,
|
|
347
|
+
description: listLabelsToolDescription,
|
|
348
|
+
inputSchema: zodToJsonSchema(listLabelsToolSchema),
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: createLabelToolName,
|
|
352
|
+
description: createLabelToolDescription,
|
|
353
|
+
inputSchema: zodToJsonSchema(createLabelToolSchema),
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
name: deleteLabelToolName,
|
|
357
|
+
description: deleteLabelToolDescription,
|
|
358
|
+
inputSchema: zodToJsonSchema(deleteLabelToolSchema),
|
|
359
|
+
},
|
|
360
|
+
// Members
|
|
361
|
+
{
|
|
362
|
+
name: listMembersToolName,
|
|
363
|
+
description: listMembersToolDescription,
|
|
364
|
+
inputSchema: zodToJsonSchema(listMembersToolSchema),
|
|
365
|
+
},
|
|
366
|
+
// Issue Links
|
|
367
|
+
{
|
|
368
|
+
name: createIssueLinkToolName,
|
|
369
|
+
description: createIssueLinkToolDescription,
|
|
370
|
+
inputSchema: zodToJsonSchema(createIssueLinkToolSchema),
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
name: deleteIssueLinkToolName,
|
|
374
|
+
description: deleteIssueLinkToolDescription,
|
|
375
|
+
inputSchema: zodToJsonSchema(deleteIssueLinkToolSchema),
|
|
376
|
+
},
|
|
377
|
+
// Search
|
|
378
|
+
{
|
|
379
|
+
name: searchToolName,
|
|
380
|
+
description: searchToolDescription,
|
|
381
|
+
inputSchema: zodToJsonSchema(searchToolSchema),
|
|
382
|
+
},
|
|
383
|
+
// Claude Workflows
|
|
384
|
+
{
|
|
385
|
+
name: createWorkflowToolName,
|
|
386
|
+
description: createWorkflowToolDescription,
|
|
387
|
+
inputSchema: zodToJsonSchema(createWorkflowToolSchema),
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
name: updateWorkflowToolName,
|
|
391
|
+
description: updateWorkflowToolDescription,
|
|
392
|
+
inputSchema: zodToJsonSchema(updateWorkflowToolSchema),
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
name: listWorkflowsToolName,
|
|
396
|
+
description: listWorkflowsToolDescription,
|
|
397
|
+
inputSchema: zodToJsonSchema(listWorkflowsToolSchema),
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
name: getWorkflowToolName,
|
|
401
|
+
description: getWorkflowToolDescription,
|
|
402
|
+
inputSchema: zodToJsonSchema(getWorkflowToolSchema),
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
name: runWorkflowToolName,
|
|
406
|
+
description: runWorkflowToolDescription,
|
|
407
|
+
inputSchema: zodToJsonSchema(runWorkflowToolSchema),
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
name: suggestWorkflowToolName,
|
|
411
|
+
description: suggestWorkflowToolDescription,
|
|
412
|
+
inputSchema: zodToJsonSchema(suggestWorkflowToolSchema),
|
|
413
|
+
},
|
|
414
|
+
// Documents
|
|
415
|
+
{
|
|
416
|
+
name: listDocsToolName,
|
|
417
|
+
description: listDocsToolDescription,
|
|
418
|
+
inputSchema: zodToJsonSchema(listDocsToolSchema),
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
name: getDocToolName,
|
|
422
|
+
description: getDocToolDescription,
|
|
423
|
+
inputSchema: zodToJsonSchema(getDocToolSchema),
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: createDocToolName,
|
|
427
|
+
description: createDocToolDescription,
|
|
428
|
+
inputSchema: zodToJsonSchema(createDocToolSchema),
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
name: updateDocToolName,
|
|
432
|
+
description: updateDocToolDescription,
|
|
433
|
+
inputSchema: zodToJsonSchema(updateDocToolSchema),
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
name: deleteDocToolName,
|
|
437
|
+
description: deleteDocToolDescription,
|
|
438
|
+
inputSchema: zodToJsonSchema(deleteDocToolSchema),
|
|
439
|
+
},
|
|
440
|
+
// Help
|
|
441
|
+
{
|
|
442
|
+
name: helpToolName,
|
|
443
|
+
description: helpToolDescription,
|
|
444
|
+
inputSchema: zodToJsonSchema(helpToolSchema),
|
|
445
|
+
},
|
|
446
|
+
// Session
|
|
447
|
+
{
|
|
448
|
+
name: setContextToolName,
|
|
449
|
+
description: setContextToolDescription,
|
|
450
|
+
inputSchema: zodToJsonSchema(setContextToolSchema),
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
name: resumeToolName,
|
|
454
|
+
description: resumeToolDescription,
|
|
455
|
+
inputSchema: zodToJsonSchema(resumeToolSchema),
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
name: clearSessionToolName,
|
|
459
|
+
description: clearSessionToolDescription,
|
|
460
|
+
inputSchema: zodToJsonSchema(clearSessionToolSchema),
|
|
461
|
+
},
|
|
462
|
+
];
|
|
463
|
+
// Tool execution handler
|
|
464
|
+
async function executeTool(name, args) {
|
|
465
|
+
switch (name) {
|
|
466
|
+
// Connection & Context
|
|
467
|
+
case connectToolName:
|
|
468
|
+
return executeConnect();
|
|
469
|
+
case contextToolName:
|
|
470
|
+
return executeContext(contextToolSchema.parse(args));
|
|
471
|
+
// Organizations
|
|
472
|
+
case listOrganizationsToolName:
|
|
473
|
+
return executeListOrganizations();
|
|
474
|
+
case getOrganizationToolName:
|
|
475
|
+
return executeGetOrganization(getOrganizationToolSchema.parse(args));
|
|
476
|
+
case createOrganizationToolName:
|
|
477
|
+
return executeCreateOrganization(createOrganizationToolSchema.parse(args));
|
|
478
|
+
// Projects
|
|
479
|
+
case listProjectsToolName:
|
|
480
|
+
return executeListProjects(listProjectsToolSchema.parse(args));
|
|
481
|
+
case getProjectToolName:
|
|
482
|
+
return executeGetProject(getProjectToolSchema.parse(args));
|
|
483
|
+
case createProjectToolName:
|
|
484
|
+
return executeCreateProject(createProjectToolSchema.parse(args));
|
|
485
|
+
case updateProjectToolName:
|
|
486
|
+
return executeUpdateProject(updateProjectToolSchema.parse(args));
|
|
487
|
+
// Issues
|
|
488
|
+
case getIssueToolName:
|
|
489
|
+
return executeGetIssue(getIssueToolSchema.parse(args));
|
|
490
|
+
case createIssueToolName:
|
|
491
|
+
return executeCreateIssue(createIssueToolSchema.parse(args));
|
|
492
|
+
case updateIssueToolName:
|
|
493
|
+
return executeUpdateIssue(updateIssueToolSchema.parse(args));
|
|
494
|
+
case deleteIssueToolName:
|
|
495
|
+
return executeDeleteIssue(deleteIssueToolSchema.parse(args));
|
|
496
|
+
// Batch Operations
|
|
497
|
+
case batchCreateIssuesToolName:
|
|
498
|
+
return executeBatchCreateIssues(batchCreateIssuesToolSchema.parse(args));
|
|
499
|
+
case batchUpdateStatusToolName:
|
|
500
|
+
return executeBatchUpdateStatus(batchUpdateStatusToolSchema.parse(args));
|
|
501
|
+
case batchUpdateIssuesToolName:
|
|
502
|
+
return executeBatchUpdateIssues(batchUpdateIssuesToolSchema.parse(args));
|
|
503
|
+
case updateStatusToolName:
|
|
504
|
+
return executeUpdateStatus(updateStatusToolSchema.parse(args));
|
|
505
|
+
// Boards
|
|
506
|
+
case listBoardsToolName:
|
|
507
|
+
return executeListBoards(listBoardsToolSchema.parse(args));
|
|
508
|
+
case getBoardToolName:
|
|
509
|
+
return executeGetBoard(getBoardToolSchema.parse(args));
|
|
510
|
+
case moveIssueOnBoardToolName:
|
|
511
|
+
return executeMoveIssueOnBoard(moveIssueOnBoardToolSchema.parse(args));
|
|
512
|
+
// Board Config
|
|
513
|
+
case getBoardConfigToolName:
|
|
514
|
+
return executeGetBoardConfig(getBoardConfigToolSchema.parse(args));
|
|
515
|
+
case updateColumnConfigToolName:
|
|
516
|
+
return executeUpdateColumnConfig(updateColumnConfigToolSchema.parse(args));
|
|
517
|
+
case getColumnInstructionsToolName:
|
|
518
|
+
return executeGetColumnInstructions(getColumnInstructionsToolSchema.parse(args));
|
|
519
|
+
// Board Templates
|
|
520
|
+
case listBoardTemplatesToolName:
|
|
521
|
+
return executeListBoardTemplates(listBoardTemplatesToolSchema.parse(args));
|
|
522
|
+
case applyBoardTemplateToolName:
|
|
523
|
+
return executeApplyBoardTemplate(applyBoardTemplateToolSchema.parse(args));
|
|
524
|
+
case cloneBoardConfigToolName:
|
|
525
|
+
return executeCloneBoardConfig(cloneBoardConfigToolSchema.parse(args));
|
|
526
|
+
// Backlog
|
|
527
|
+
case getBacklogToolName:
|
|
528
|
+
return executeGetBacklog(getBacklogToolSchema.parse(args));
|
|
529
|
+
// Sprints
|
|
530
|
+
case listSprintsToolName:
|
|
531
|
+
return executeListSprints(listSprintsToolSchema.parse(args));
|
|
532
|
+
case createSprintToolName:
|
|
533
|
+
return executeCreateSprint(createSprintToolSchema.parse(args));
|
|
534
|
+
case addToSprintToolName:
|
|
535
|
+
return executeAddToSprint(addToSprintToolSchema.parse(args));
|
|
536
|
+
case getSprintToolName:
|
|
537
|
+
return executeGetSprint(getSprintToolSchema.parse(args));
|
|
538
|
+
case startSprintToolName:
|
|
539
|
+
return executeStartSprint(startSprintToolSchema.parse(args));
|
|
540
|
+
case completeSprintToolName:
|
|
541
|
+
return executeCompleteSprint(completeSprintToolSchema.parse(args));
|
|
542
|
+
case updateSprintToolName:
|
|
543
|
+
return executeUpdateSprint(updateSprintToolSchema.parse(args));
|
|
544
|
+
case deleteSprintToolName:
|
|
545
|
+
return executeDeleteSprint(deleteSprintToolSchema.parse(args));
|
|
546
|
+
// Comments
|
|
547
|
+
case listCommentsToolName:
|
|
548
|
+
return executeListComments(listCommentsToolSchema.parse(args));
|
|
549
|
+
case addCommentToolName:
|
|
550
|
+
return executeAddComment(addCommentToolSchema.parse(args));
|
|
551
|
+
case updateCommentToolName:
|
|
552
|
+
return executeUpdateComment(updateCommentToolSchema.parse(args));
|
|
553
|
+
case deleteCommentToolName:
|
|
554
|
+
return executeDeleteComment(deleteCommentToolSchema.parse(args));
|
|
555
|
+
// Labels
|
|
556
|
+
case listLabelsToolName:
|
|
557
|
+
return executeListLabels(listLabelsToolSchema.parse(args));
|
|
558
|
+
case createLabelToolName:
|
|
559
|
+
return executeCreateLabel(createLabelToolSchema.parse(args));
|
|
560
|
+
case deleteLabelToolName:
|
|
561
|
+
return executeDeleteLabel(deleteLabelToolSchema.parse(args));
|
|
562
|
+
// Members
|
|
563
|
+
case listMembersToolName:
|
|
564
|
+
return executeListMembers(listMembersToolSchema.parse(args));
|
|
565
|
+
// Issue Links
|
|
566
|
+
case createIssueLinkToolName:
|
|
567
|
+
return executeCreateIssueLink(createIssueLinkToolSchema.parse(args));
|
|
568
|
+
case deleteIssueLinkToolName:
|
|
569
|
+
return executeDeleteIssueLink(deleteIssueLinkToolSchema.parse(args));
|
|
570
|
+
// Search
|
|
571
|
+
case searchToolName:
|
|
572
|
+
return executeSearch(searchToolSchema.parse(args));
|
|
573
|
+
// Claude Workflows
|
|
574
|
+
case createWorkflowToolName:
|
|
575
|
+
return executeCreateWorkflow(createWorkflowToolSchema.parse(args));
|
|
576
|
+
case updateWorkflowToolName:
|
|
577
|
+
return executeUpdateWorkflow(updateWorkflowToolSchema.parse(args));
|
|
578
|
+
case listWorkflowsToolName:
|
|
579
|
+
return executeListWorkflows(listWorkflowsToolSchema.parse(args));
|
|
580
|
+
case getWorkflowToolName:
|
|
581
|
+
return executeGetWorkflow(getWorkflowToolSchema.parse(args));
|
|
582
|
+
case runWorkflowToolName:
|
|
583
|
+
return executeRunWorkflow(runWorkflowToolSchema.parse(args));
|
|
584
|
+
case suggestWorkflowToolName:
|
|
585
|
+
return executeSuggestWorkflow(suggestWorkflowToolSchema.parse(args));
|
|
586
|
+
// Documents
|
|
587
|
+
case listDocsToolName:
|
|
588
|
+
return executeListDocs(listDocsToolSchema.parse(args));
|
|
589
|
+
case getDocToolName:
|
|
590
|
+
return executeGetDoc(getDocToolSchema.parse(args));
|
|
591
|
+
case createDocToolName:
|
|
592
|
+
return executeCreateDoc(createDocToolSchema.parse(args));
|
|
593
|
+
case updateDocToolName:
|
|
594
|
+
return executeUpdateDoc(updateDocToolSchema.parse(args));
|
|
595
|
+
case deleteDocToolName:
|
|
596
|
+
return executeDeleteDoc(deleteDocToolSchema.parse(args));
|
|
597
|
+
// Help
|
|
598
|
+
case helpToolName:
|
|
599
|
+
return executeHelp(helpToolSchema.parse(args));
|
|
600
|
+
// Session
|
|
601
|
+
case setContextToolName:
|
|
602
|
+
return executeSetContext(setContextToolSchema.parse(args));
|
|
603
|
+
case resumeToolName:
|
|
604
|
+
return executeResume();
|
|
605
|
+
case clearSessionToolName:
|
|
606
|
+
return executeClearSession();
|
|
607
|
+
default:
|
|
608
|
+
return JSON.stringify({
|
|
609
|
+
success: false,
|
|
610
|
+
error: `Unknown tool: ${name}`,
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
export async function createServer() {
|
|
615
|
+
const server = new Server({
|
|
616
|
+
name: 'llama-mcp',
|
|
617
|
+
version: '0.1.0',
|
|
618
|
+
}, {
|
|
619
|
+
capabilities: {
|
|
620
|
+
tools: {},
|
|
621
|
+
},
|
|
622
|
+
});
|
|
623
|
+
// Handle list tools request
|
|
624
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
625
|
+
return { tools };
|
|
626
|
+
});
|
|
627
|
+
// Handle tool execution
|
|
628
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
629
|
+
const { name, arguments: args } = request.params;
|
|
630
|
+
try {
|
|
631
|
+
const result = await executeTool(name, args);
|
|
632
|
+
// Add session header to all responses (except session tools themselves)
|
|
633
|
+
const sessionTools = ['llama_set_context', 'llama_resume', 'llama_clear_session'];
|
|
634
|
+
let finalResult = result;
|
|
635
|
+
if (!sessionTools.includes(name)) {
|
|
636
|
+
const header = await getSessionHeader();
|
|
637
|
+
finalResult = `${header}\n\n${result}`;
|
|
638
|
+
}
|
|
639
|
+
return {
|
|
640
|
+
content: [
|
|
641
|
+
{
|
|
642
|
+
type: 'text',
|
|
643
|
+
text: finalResult,
|
|
644
|
+
},
|
|
645
|
+
],
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
catch (error) {
|
|
649
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
650
|
+
return {
|
|
651
|
+
content: [
|
|
652
|
+
{
|
|
653
|
+
type: 'text',
|
|
654
|
+
text: JSON.stringify({
|
|
655
|
+
success: false,
|
|
656
|
+
error: errorMessage,
|
|
657
|
+
}),
|
|
658
|
+
},
|
|
659
|
+
],
|
|
660
|
+
isError: true,
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
return server;
|
|
665
|
+
}
|
|
666
|
+
export async function runServer() {
|
|
667
|
+
const server = await createServer();
|
|
668
|
+
const transport = new StdioServerTransport();
|
|
669
|
+
await server.connect(transport);
|
|
670
|
+
// Log to stderr (not stdout - that's for MCP communication)
|
|
671
|
+
console.error('Llama MCP server started');
|
|
672
|
+
}
|
|
673
|
+
//# sourceMappingURL=server.js.map
|