lexic-mcp 0.2.11 → 0.2.13

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 CHANGED
@@ -16,7 +16,7 @@
16
16
  */
17
17
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
18
18
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
19
- import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
19
+ import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
20
20
  const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : '0.0.0-dev';
21
21
  import { loadConfig } from './config.js';
22
22
  import { loadServerConfig, isOAuthMode } from './auth/config.js';
@@ -27,7 +27,7 @@ import { createStoreTool } from './core/store.js';
27
27
  import { createContextTool } from './core/context.js';
28
28
  import { createCreateProjectTool, createListProjectsTool, createGetProjectInfoTool } from './core/admin.js';
29
29
  import { createDomainTools } from './domains/index.js';
30
- import { createRunCreateTool, createRunStatusTool, createRunEstimateTool, createRunUpdateTool, createRunListTool } from './tools/runs.js';
30
+ import { createRunCreateTool, createRunStatusTool, createRunEstimateTool, createRunUpdateTool, createRunListTool, WORKFLOW_PROMPTS } from './tools/runs.js';
31
31
  import { createTaskCreateTool, createTaskNextTool, createTaskCompleteTool, createTaskFailTool, createTaskUpdateTool, createTaskListTool } from './tools/tasks.js';
32
32
  import { createWorkflowExecuteTool } from './tools/workflow-execute.js';
33
33
  import { createWorkflowTemplateListTool, createWorkflowTemplateGetTool, createWorkflowTemplateCreateFromRunTool, createWorkflowTemplateConfirmCreateTool } from './tools/workflow-templates.js';
@@ -249,8 +249,8 @@ async function runStdioServer() {
249
249
  const { domains, triggers } = await loadConfiguration(lexicClient);
250
250
  // Register tools — use a mutable reference so refreshTools() can update in-place
251
251
  const tools = await registerTools(lexicClient, triggers, domains);
252
- // Create MCP server with listChanged capability
253
- const server = new Server({ name: 'lexic-mcp', version: VERSION }, { capabilities: { tools: { listChanged: true } } });
252
+ // Create MCP server with listChanged capability and prompts support
253
+ const server = new Server({ name: 'lexic-mcp', version: VERSION }, { capabilities: { tools: { listChanged: true }, prompts: {} } });
254
254
  // Mutex to prevent concurrent reloads
255
255
  let reloadInProgress = false;
256
256
  /**
@@ -342,6 +342,33 @@ async function runStdioServer() {
342
342
  }))
343
343
  };
344
344
  });
345
+ // Prompts — expose lexic-run and any future workflow prompts as slash commands.
346
+ // Claude Code maps these to /lexic-run automatically when the MCP server is configured.
347
+ server.setRequestHandler(ListPromptsRequestSchema, async () => {
348
+ return {
349
+ prompts: WORKFLOW_PROMPTS.map(p => ({
350
+ name: p.name,
351
+ description: p.description,
352
+ arguments: p.arguments,
353
+ })),
354
+ };
355
+ });
356
+ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
357
+ const { name, arguments: promptArgs } = request.params;
358
+ const prompt = WORKFLOW_PROMPTS.find(p => p.name === name);
359
+ if (!prompt) {
360
+ throw new Error(`Unknown prompt: ${name}`);
361
+ }
362
+ // Substitute $ARGUMENTS placeholder with the caller-supplied value
363
+ const runArg = promptArgs?.run ?? '';
364
+ const text = runArg
365
+ ? prompt.text.replace(/\$ARGUMENTS/g, runArg)
366
+ : prompt.text;
367
+ return {
368
+ description: prompt.description,
369
+ messages: [{ role: 'user', content: { type: 'text', text } }],
370
+ };
371
+ });
345
372
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
346
373
  const { name, arguments: args } = request.params;
347
374
  const tool = tools.get(name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lexic-mcp",
3
- "version": "0.2.11",
3
+ "version": "0.2.13",
4
4
  "description": "MCP server connecting Claude Code to Lexic knowledge management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",