@intrig/mcp 0.0.1 → 0.0.15-15

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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * MCP server instructions for Intrig.
3
+ * Clarifies CLI vs MCP scope and provides framework-specific setup guidance.
4
+ */
5
+ export declare const SERVER_INSTRUCTIONS = "# Intrig MCP Server\n\n## Tool Scope\n\n**CLI (mutations)**: Project setup, configuration changes, code generation\n**MCP (discovery)**: Query generated SDK content, search endpoints/schemas, get documentation\n\nMCP is read-only. It queries the Intrig daemon but cannot modify projects.\n\n### CLI Responsibilities\n- `intrig init` - Initialize project\n- `intrig source add/remove` - Manage API sources\n- `intrig sync` - Download/update OpenAPI specs\n- `intrig generate` - Generate typed SDK code\n- `intrig daemon` - Start background service\n\n### MCP Capabilities\n- List registered projects\n- Get project details and sources\n- Search generated endpoints and schemas\n- Retrieve full documentation with types\n\n## Setup Workflow (CLI)\n\nFor new projects, guide users through these commands:\n\n```bash\nnpx intrig init # Create intrig.config.ts\nnpx intrig source add <name> <url> # Add OpenAPI spec URL\nnpx intrig sync --all # Download all specs\nnpx intrig generate # Generate SDK\nnpx intrig daemon # Start daemon (optional, auto-starts)\n```\n\n## Troubleshooting\n\n**If search returns no results or project has no sources:**\n1. Verify sources exist: user should run `npx intrig source list`\n2. Sync schemas: `npx intrig sync --all`\n3. Regenerate SDK: `npx intrig generate`\n4. Restart daemon if needed: `npx intrig daemon --restart`\n\n**If daemon not running:**\nMCP tools auto-start the daemon, but if issues persist: `npx intrig daemon`\n\n## Framework Setup\n\n### React\n```bash\nnpm install @intrig/react\n```\n\n```tsx\n// App root\nimport { IntrigProvider } from '@intrig/react';\n\n<IntrigProvider>\n <App />\n</IntrigProvider>\n```\n\nImports: `import { useGetUsers } from '@intrig/react/<source>/<operation>'`\n\n### Next.js\n```bash\nnpm install @intrig/next\n```\n\n```tsx\n// layout.tsx or _app.tsx\nimport { IntrigProvider } from '@intrig/next';\n\n<IntrigProvider>\n {children}\n</IntrigProvider>\n```\n\nImports: `import { useGetUsers } from '@intrig/next/<source>/<operation>'`\n\nServer components can use generated fetch functions directly without hooks.\n\n### NestJS (Coming Soon)\nServer-side client generation for NestJS is planned.\n\n## MCP Tool Flow\n\nTypical discovery workflow:\n1. `list_projects` - Find Intrig projects\n2. `get_project` - Get sources for a project\n3. `search` - Find endpoints by keyword (e.g., \"user\", \"POST /orders\")\n4. `get_documentation` - Get full details with request/response types\n\nIf steps 2-4 return empty results, the SDK likely hasn't been generated. Guide users to run CLI commands above.\n";
6
+ //# sourceMappingURL=instructions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../../../src/instructions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,mBAAmB,0nFA6F/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAuBnE;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CA+ErC;AAED;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAQjD"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAwBnE;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAgFrC;AAED;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAQjD"}
package/dist/main.js CHANGED
@@ -1337,6 +1337,102 @@ Use \`search\` with type="schema" to find current schema IDs.`
1337
1337
  }
1338
1338
  }
1339
1339
 
1340
+ // app/intrig-mcp/src/instructions.ts
1341
+ var SERVER_INSTRUCTIONS = `# Intrig MCP Server
1342
+
1343
+ ## Tool Scope
1344
+
1345
+ **CLI (mutations)**: Project setup, configuration changes, code generation
1346
+ **MCP (discovery)**: Query generated SDK content, search endpoints/schemas, get documentation
1347
+
1348
+ MCP is read-only. It queries the Intrig daemon but cannot modify projects.
1349
+
1350
+ ### CLI Responsibilities
1351
+ - \`intrig init\` - Initialize project
1352
+ - \`intrig source add/remove\` - Manage API sources
1353
+ - \`intrig sync\` - Download/update OpenAPI specs
1354
+ - \`intrig generate\` - Generate typed SDK code
1355
+ - \`intrig daemon\` - Start background service
1356
+
1357
+ ### MCP Capabilities
1358
+ - List registered projects
1359
+ - Get project details and sources
1360
+ - Search generated endpoints and schemas
1361
+ - Retrieve full documentation with types
1362
+
1363
+ ## Setup Workflow (CLI)
1364
+
1365
+ For new projects, guide users through these commands:
1366
+
1367
+ \`\`\`bash
1368
+ npx intrig init # Create intrig.config.ts
1369
+ npx intrig source add <name> <url> # Add OpenAPI spec URL
1370
+ npx intrig sync --all # Download all specs
1371
+ npx intrig generate # Generate SDK
1372
+ npx intrig daemon # Start daemon (optional, auto-starts)
1373
+ \`\`\`
1374
+
1375
+ ## Troubleshooting
1376
+
1377
+ **If search returns no results or project has no sources:**
1378
+ 1. Verify sources exist: user should run \`npx intrig source list\`
1379
+ 2. Sync schemas: \`npx intrig sync --all\`
1380
+ 3. Regenerate SDK: \`npx intrig generate\`
1381
+ 4. Restart daemon if needed: \`npx intrig daemon --restart\`
1382
+
1383
+ **If daemon not running:**
1384
+ MCP tools auto-start the daemon, but if issues persist: \`npx intrig daemon\`
1385
+
1386
+ ## Framework Setup
1387
+
1388
+ ### React
1389
+ \`\`\`bash
1390
+ npm install @intrig/react
1391
+ \`\`\`
1392
+
1393
+ \`\`\`tsx
1394
+ // App root
1395
+ import { IntrigProvider } from '@intrig/react';
1396
+
1397
+ <IntrigProvider>
1398
+ <App />
1399
+ </IntrigProvider>
1400
+ \`\`\`
1401
+
1402
+ Imports: \`import { useGetUsers } from '@intrig/react/<source>/<operation>'\`
1403
+
1404
+ ### Next.js
1405
+ \`\`\`bash
1406
+ npm install @intrig/next
1407
+ \`\`\`
1408
+
1409
+ \`\`\`tsx
1410
+ // layout.tsx or _app.tsx
1411
+ import { IntrigProvider } from '@intrig/next';
1412
+
1413
+ <IntrigProvider>
1414
+ {children}
1415
+ </IntrigProvider>
1416
+ \`\`\`
1417
+
1418
+ Imports: \`import { useGetUsers } from '@intrig/next/<source>/<operation>'\`
1419
+
1420
+ Server components can use generated fetch functions directly without hooks.
1421
+
1422
+ ### NestJS (Coming Soon)
1423
+ Server-side client generation for NestJS is planned.
1424
+
1425
+ ## MCP Tool Flow
1426
+
1427
+ Typical discovery workflow:
1428
+ 1. \`list_projects\` - Find Intrig projects
1429
+ 2. \`get_project\` - Get sources for a project
1430
+ 3. \`search\` - Find endpoints by keyword (e.g., "user", "POST /orders")
1431
+ 4. \`get_documentation\` - Get full details with request/response types
1432
+
1433
+ If steps 2-4 return empty results, the SDK likely hasn't been generated. Guide users to run CLI commands above.
1434
+ `;
1435
+
1340
1436
  // app/intrig-mcp/src/mcp/server.ts
1341
1437
  var TOOLS = [
1342
1438
  listProjectsTool,
@@ -1353,7 +1449,8 @@ function createServer() {
1353
1449
  {
1354
1450
  capabilities: {
1355
1451
  tools: {}
1356
- }
1452
+ },
1453
+ instructions: SERVER_INSTRUCTIONS
1357
1454
  }
1358
1455
  );
1359
1456
  server.setRequestHandler(ListToolsRequestSchema, async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intrig/mcp",
3
- "version": "0.0.1",
3
+ "version": "0.0.15-15",
4
4
  "description": "MCP server for Intrig - exposes API documentation and search capabilities to Claude Desktop and MCP-compatible IDEs",
5
5
  "type": "module",
6
6
  "main": "./dist/main.js",
@@ -45,7 +45,9 @@
45
45
  "name": "intrig-mcp",
46
46
  "sourceRoot": "app/intrig-mcp/src",
47
47
  "projectType": "application",
48
- "tags": ["mcp-server"],
48
+ "tags": [
49
+ "mcp-server"
50
+ ],
49
51
  "targets": {
50
52
  "build": {
51
53
  "executor": "@nx/esbuild:esbuild",