@lanonasis/cli 3.0.8 → 3.0.10
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.
|
@@ -29,10 +29,7 @@ export class LanonasisMCPServer {
|
|
|
29
29
|
// Initialize config and API client
|
|
30
30
|
this.config = new CLIConfig();
|
|
31
31
|
this.apiClient = new APIClient();
|
|
32
|
-
//
|
|
33
|
-
this.registerTools();
|
|
34
|
-
this.registerResources();
|
|
35
|
-
this.registerPrompts();
|
|
32
|
+
// Note: registerTools is now async and called in initialize()
|
|
36
33
|
// Setup error handling
|
|
37
34
|
this.setupErrorHandling();
|
|
38
35
|
}
|
|
@@ -56,6 +53,10 @@ export class LanonasisMCPServer {
|
|
|
56
53
|
this.apiClient = new APIClient();
|
|
57
54
|
// APIClient will use the config internally
|
|
58
55
|
}
|
|
56
|
+
// Register tools, resources, and prompts after config is loaded
|
|
57
|
+
await this.registerTools();
|
|
58
|
+
await this.registerResources();
|
|
59
|
+
await this.registerPrompts();
|
|
59
60
|
if (this.options.verbose) {
|
|
60
61
|
console.log(chalk.cyan('🚀 Lanonasis MCP Server initialized'));
|
|
61
62
|
console.log(chalk.gray(`API URL: ${apiUrl}`));
|
|
@@ -65,9 +66,9 @@ export class LanonasisMCPServer {
|
|
|
65
66
|
/**
|
|
66
67
|
* Register MCP tools
|
|
67
68
|
*/
|
|
68
|
-
registerTools() {
|
|
69
|
-
// Import request schemas
|
|
70
|
-
const { ListToolsRequestSchema, CallToolRequestSchema } =
|
|
69
|
+
async registerTools() {
|
|
70
|
+
// Import request schemas dynamically for ES modules
|
|
71
|
+
const { ListToolsRequestSchema, CallToolRequestSchema } = await import('@modelcontextprotocol/sdk/types.js');
|
|
71
72
|
// List available tools
|
|
72
73
|
this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
73
74
|
tools: [
|
|
@@ -337,8 +338,9 @@ export class LanonasisMCPServer {
|
|
|
337
338
|
/**
|
|
338
339
|
* Register MCP resources
|
|
339
340
|
*/
|
|
340
|
-
registerResources() {
|
|
341
|
-
|
|
341
|
+
async registerResources() {
|
|
342
|
+
const { ListResourcesRequestSchema, ReadResourceRequestSchema } = await import('@modelcontextprotocol/sdk/types.js');
|
|
343
|
+
this.server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
|
342
344
|
resources: [
|
|
343
345
|
{
|
|
344
346
|
uri: 'memory://recent',
|
|
@@ -366,7 +368,7 @@ export class LanonasisMCPServer {
|
|
|
366
368
|
}
|
|
367
369
|
]
|
|
368
370
|
}));
|
|
369
|
-
this.server.setRequestHandler(
|
|
371
|
+
this.server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
370
372
|
const { uri } = request.params;
|
|
371
373
|
try {
|
|
372
374
|
const content = await this.handleResourceRead(uri);
|
|
@@ -388,8 +390,9 @@ export class LanonasisMCPServer {
|
|
|
388
390
|
/**
|
|
389
391
|
* Register MCP prompts
|
|
390
392
|
*/
|
|
391
|
-
registerPrompts() {
|
|
392
|
-
|
|
393
|
+
async registerPrompts() {
|
|
394
|
+
const { ListPromptsRequestSchema, GetPromptRequestSchema } = await import('@modelcontextprotocol/sdk/types.js');
|
|
395
|
+
this.server.setRequestHandler(ListPromptsRequestSchema, async () => ({
|
|
393
396
|
prompts: [
|
|
394
397
|
{
|
|
395
398
|
name: 'create_memory',
|
|
@@ -420,7 +423,7 @@ export class LanonasisMCPServer {
|
|
|
420
423
|
}
|
|
421
424
|
]
|
|
422
425
|
}));
|
|
423
|
-
this.server.setRequestHandler(
|
|
426
|
+
this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
424
427
|
const { name, arguments: args } = request.params;
|
|
425
428
|
const prompts = {
|
|
426
429
|
create_memory: {
|
package/package.json
CHANGED