@neurynae/toolcairn-mcp 0.1.2 → 0.1.3

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.
Files changed (105) hide show
  1. package/dist/chunk-B74KV6FC.js +59 -0
  2. package/dist/chunk-B74KV6FC.js.map +1 -0
  3. package/dist/dist-2HK3ZGXE.js +5989 -0
  4. package/dist/dist-2HK3ZGXE.js.map +1 -0
  5. package/dist/index.js +1582 -35
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/dist/index.d.ts +0 -2
  9. package/dist/index.d.ts.map +0 -1
  10. package/dist/middleware/event-logger.d.ts +0 -19
  11. package/dist/middleware/event-logger.d.ts.map +0 -1
  12. package/dist/middleware/event-logger.js +0 -138
  13. package/dist/middleware/event-logger.js.map +0 -1
  14. package/dist/schemas.d.ts +0 -2
  15. package/dist/schemas.d.ts.map +0 -1
  16. package/dist/schemas.js +0 -3
  17. package/dist/schemas.js.map +0 -1
  18. package/dist/server.d.ts +0 -3
  19. package/dist/server.d.ts.map +0 -1
  20. package/dist/server.js +0 -116
  21. package/dist/server.js.map +0 -1
  22. package/dist/server.prod.d.ts +0 -14
  23. package/dist/server.prod.d.ts.map +0 -1
  24. package/dist/server.prod.js +0 -127
  25. package/dist/server.prod.js.map +0 -1
  26. package/dist/templates/agent-instructions.d.ts +0 -22
  27. package/dist/templates/agent-instructions.d.ts.map +0 -1
  28. package/dist/templates/agent-instructions.js +0 -155
  29. package/dist/templates/agent-instructions.js.map +0 -1
  30. package/dist/tools/check-compatibility.d.ts +0 -100
  31. package/dist/tools/check-compatibility.d.ts.map +0 -1
  32. package/dist/tools/check-compatibility.js +0 -103
  33. package/dist/tools/check-compatibility.js.map +0 -1
  34. package/dist/tools/check-issue.d.ts +0 -126
  35. package/dist/tools/check-issue.d.ts.map +0 -1
  36. package/dist/tools/check-issue.js +0 -248
  37. package/dist/tools/check-issue.js.map +0 -1
  38. package/dist/tools/classify-prompt.d.ts +0 -101
  39. package/dist/tools/classify-prompt.d.ts.map +0 -1
  40. package/dist/tools/classify-prompt.js +0 -64
  41. package/dist/tools/classify-prompt.js.map +0 -1
  42. package/dist/tools/compare-tools.d.ts +0 -102
  43. package/dist/tools/compare-tools.d.ts.map +0 -1
  44. package/dist/tools/compare-tools.js +0 -178
  45. package/dist/tools/compare-tools.js.map +0 -1
  46. package/dist/tools/format-results.d.ts +0 -44
  47. package/dist/tools/format-results.d.ts.map +0 -1
  48. package/dist/tools/format-results.js +0 -114
  49. package/dist/tools/format-results.js.map +0 -1
  50. package/dist/tools/generate-tracker.d.ts +0 -7
  51. package/dist/tools/generate-tracker.d.ts.map +0 -1
  52. package/dist/tools/generate-tracker.js +0 -408
  53. package/dist/tools/generate-tracker.js.map +0 -1
  54. package/dist/tools/get-stack.d.ts +0 -105
  55. package/dist/tools/get-stack.d.ts.map +0 -1
  56. package/dist/tools/get-stack.js +0 -156
  57. package/dist/tools/get-stack.js.map +0 -1
  58. package/dist/tools/init-project-config.d.ts +0 -107
  59. package/dist/tools/init-project-config.d.ts.map +0 -1
  60. package/dist/tools/init-project-config.js +0 -52
  61. package/dist/tools/init-project-config.js.map +0 -1
  62. package/dist/tools/read-project-config.d.ts +0 -99
  63. package/dist/tools/read-project-config.d.ts.map +0 -1
  64. package/dist/tools/read-project-config.js +0 -78
  65. package/dist/tools/read-project-config.js.map +0 -1
  66. package/dist/tools/refine-requirement.d.ts +0 -105
  67. package/dist/tools/refine-requirement.d.ts.map +0 -1
  68. package/dist/tools/refine-requirement.js +0 -77
  69. package/dist/tools/refine-requirement.js.map +0 -1
  70. package/dist/tools/report-outcome.d.ts +0 -104
  71. package/dist/tools/report-outcome.d.ts.map +0 -1
  72. package/dist/tools/report-outcome.js +0 -108
  73. package/dist/tools/report-outcome.js.map +0 -1
  74. package/dist/tools/search-tools-respond.d.ts +0 -103
  75. package/dist/tools/search-tools-respond.d.ts.map +0 -1
  76. package/dist/tools/search-tools-respond.js +0 -91
  77. package/dist/tools/search-tools-respond.js.map +0 -1
  78. package/dist/tools/search-tools.d.ts +0 -104
  79. package/dist/tools/search-tools.d.ts.map +0 -1
  80. package/dist/tools/search-tools.js +0 -77
  81. package/dist/tools/search-tools.js.map +0 -1
  82. package/dist/tools/suggest-graph-update.d.ts +0 -117
  83. package/dist/tools/suggest-graph-update.d.ts.map +0 -1
  84. package/dist/tools/suggest-graph-update.js +0 -177
  85. package/dist/tools/suggest-graph-update.js.map +0 -1
  86. package/dist/tools/toolpilot-init.d.ts +0 -103
  87. package/dist/tools/toolpilot-init.d.ts.map +0 -1
  88. package/dist/tools/toolpilot-init.js +0 -117
  89. package/dist/tools/toolpilot-init.js.map +0 -1
  90. package/dist/tools/update-project-config.d.ts +0 -104
  91. package/dist/tools/update-project-config.d.ts.map +0 -1
  92. package/dist/tools/update-project-config.js +0 -117
  93. package/dist/tools/update-project-config.js.map +0 -1
  94. package/dist/tools/verify-suggestion.d.ts +0 -113
  95. package/dist/tools/verify-suggestion.d.ts.map +0 -1
  96. package/dist/tools/verify-suggestion.js +0 -223
  97. package/dist/tools/verify-suggestion.js.map +0 -1
  98. package/dist/transport.d.ts +0 -5
  99. package/dist/transport.d.ts.map +0 -1
  100. package/dist/transport.js +0 -13
  101. package/dist/transport.js.map +0 -1
  102. package/dist/utils.d.ts +0 -4
  103. package/dist/utils.d.ts.map +0 -1
  104. package/dist/utils.js +0 -12
  105. package/dist/utils.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,uBAAuB,EACvB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AC,sBAAsB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAC3F,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,WAAW,EACT,yZAAyZ;QAC3Z,WAAW,EAAE,sBAAsB;KACpC,EACD,gBAAgB,CAAC,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CACtF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Production MCP server — thin HTTP bridge.
3
- *
4
- * LOCAL tools (classify_prompt, *_config, toolpilot_init) run directly.
5
- * All other tools make a single HTTP call to the ToolPilot API via ToolPilotClient.
6
- *
7
- * This file is used when TOOLPILOT_MODE=production (npx @toolpilot/mcp).
8
- * It intentionally imports NOTHING from @toolpilot/graph, @toolpilot/search,
9
- * @toolpilot/vector, @toolpilot/db, or @toolpilot/queue so those packages
10
- * are not bundled into the published npm package.
11
- */
12
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
13
- export declare function buildProdServer(): Promise<McpServer>;
14
- //# sourceMappingURL=server.prod.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.prod.d.ts","sourceRoot":"","sources":["../src/server.prod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmEpE,wBAAsB,eAAe,IAAI,OAAO,CAAC,SAAS,CAAC,CA0K1D"}
@@ -1,127 +0,0 @@
1
- /**
2
- * Production MCP server — thin HTTP bridge.
3
- *
4
- * LOCAL tools (classify_prompt, *_config, toolpilot_init) run directly.
5
- * All other tools make a single HTTP call to the ToolPilot API via ToolPilotClient.
6
- *
7
- * This file is used when TOOLPILOT_MODE=production (npx @toolpilot/mcp).
8
- * It intentionally imports NOTHING from @toolpilot/graph, @toolpilot/search,
9
- * @toolpilot/vector, @toolpilot/db, or @toolpilot/queue so those packages
10
- * are not bundled into the published npm package.
11
- */
12
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
13
- import { config } from '@toolpilot/config';
14
- import { ToolPilotClient, loadOrCreateCredentials } from '@toolpilot/remote';
15
- import { handleClassifyPrompt, handleInitProjectConfig, handleReadProjectConfig, handleToolpilotInit, handleUpdateProjectConfig, } from '@toolpilot/tools';
16
- import { checkCompatibilitySchema, checkIssueSchema, classifyPromptSchema, compareToolsSchema, getStackSchema, initProjectConfigSchema, readProjectConfigSchema, refineRequirementSchema, reportOutcomeSchema, searchToolsRespondSchema, searchToolsSchema, suggestGraphUpdateSchema, toolpilotInitSchema, updateProjectConfigSchema, verifySuggestionSchema, } from '@toolpilot/tools';
17
- import pino from 'pino';
18
- import { withEventLogging } from './middleware/event-logger.js';
19
- const logger = pino({ name: '@toolpilot/mcp-server:prod' });
20
- const SETUP_INSTRUCTIONS = `
21
- # ToolPilot — Agent Setup Instructions
22
-
23
- You are connected to the ToolPilot MCP server. ToolPilot is your active tool intelligence co-pilot.
24
-
25
- ## On Every Session Start — Do This First
26
-
27
- Check whether \`.toolpilot/config.json\` exists in the project root.
28
-
29
- ### If it does NOT exist (new project or first-time setup):
30
- 1. List the project root files (package.json, requirements.txt, CLAUDE.md, .cursorrules, .mcp.json, etc.)
31
- 2. Call \`toolpilot_init\` with your agent type, project root path, and the list of detected files.
32
- 3. Call \`init_project_config\` — pass your project name, language, framework, and any tools you can detect.
33
- 4. Write the returned \`config_json\` to \`.toolpilot/config.json\`.
34
-
35
- ### If it DOES exist (returning to an existing project):
36
- 1. Read \`.toolpilot/config.json\` and call \`read_project_config\` with its content.
37
- 2. If \`stale_tools\` is non-empty, inform the user and offer to re-verify those tools.
38
- 3. If \`pending_evaluation\` is non-empty, offer to run \`search_tools\` or \`compare_tools\` to resolve them.
39
-
40
- ## When to Use ToolPilot Tools
41
-
42
- | Situation | Tool to call |
43
- |-----------|-------------|
44
- | User asks which tool to use for X | \`classify_prompt\` → \`refine_requirement\` → \`search_tools\` |
45
- | User needs to compare two tools | \`compare_tools\` |
46
- | User asks if tool A works with tool B | \`check_compatibility\` |
47
- | Error persists after 4+ retries AND docs checked | \`check_issue\` |
48
- | User asks for a recommended stack | \`get_stack\` |
49
- | search_tools returns empty or low confidence | \`verify_suggestion\` |
50
- | You discover a new tool relationship | \`suggest_graph_update\` |
51
- | A tool worked well or was replaced | \`report_outcome\` |
52
- | Tool added/removed from project | \`update_project_config\` |
53
- `.trim();
54
- export async function buildProdServer() {
55
- // Load or create anonymous API key
56
- const creds = await loadOrCreateCredentials();
57
- const remote = new ToolPilotClient({
58
- baseUrl: config.TOOLPILOT_API_URL,
59
- apiKey: creds.client_id,
60
- });
61
- logger.info({ apiUrl: config.TOOLPILOT_API_URL, clientId: `${creds.client_id.slice(0, 8)}...` }, 'Production MCP mode: connecting to remote API');
62
- const server = new McpServer({ name: 'toolpilot', version: '0.1.0' }, { instructions: SETUP_INSTRUCTIONS });
63
- // ── LOCAL tools (zero network, run on user's machine) ──────────────────────
64
- server.registerTool('classify_prompt', {
65
- description: 'Classify a developer prompt to determine if ToolPilot tool search is needed. Returns a structured classification prompt for the agent to evaluate.',
66
- inputSchema: classifyPromptSchema,
67
- }, withEventLogging('classify_prompt', async (args) => handleClassifyPrompt(args)));
68
- server.registerTool('toolpilot_init', {
69
- description: 'Set up ToolPilot integration for the current project. Generates agent instruction content, MCP config entry, and project config initializer.',
70
- inputSchema: toolpilotInitSchema,
71
- }, withEventLogging('toolpilot_init', async (args) => handleToolpilotInit(args)));
72
- server.registerTool('init_project_config', {
73
- description: 'Initialize a .toolpilot/config.json file for the current project. Returns the config JSON for the agent to write to disk.',
74
- inputSchema: initProjectConfigSchema,
75
- }, withEventLogging('init_project_config', async (args) => handleInitProjectConfig(args)));
76
- server.registerTool('read_project_config', {
77
- description: 'Parse and validate a .toolpilot/config.json file. Returns confirmed tools, pending evaluations, stale tools, and agent instructions.',
78
- inputSchema: readProjectConfigSchema,
79
- }, withEventLogging('read_project_config', async (args) => handleReadProjectConfig(args)));
80
- server.registerTool('update_project_config', {
81
- description: 'Apply a mutation to .toolpilot/config.json and return the updated content. Actions: add_tool, remove_tool, update_tool, add_evaluation.',
82
- inputSchema: updateProjectConfigSchema,
83
- }, withEventLogging('update_project_config', async (args) => handleUpdateProjectConfig(args)));
84
- // ── REMOTE tools (one HTTP call each to ToolPilot API) ────────────────────
85
- server.registerTool('search_tools', {
86
- description: 'Search for the best tool for a specific need using a natural language query. Initiates a guided discovery session with clarification questions when needed.',
87
- inputSchema: searchToolsSchema,
88
- }, withEventLogging('search_tools', async (args) => remote.searchTools(args)));
89
- server.registerTool('search_tools_respond', {
90
- description: 'Submit clarification answers for an in-progress tool search session and receive refined results.',
91
- inputSchema: searchToolsRespondSchema,
92
- }, withEventLogging('search_tools_respond', async (args) => remote.searchToolsRespond(args)));
93
- server.registerTool('get_stack', {
94
- description: 'Get a recommended tool stack for a specific use case with optional deployment and language constraints.',
95
- inputSchema: getStackSchema,
96
- }, withEventLogging('get_stack', async (args) => remote.getStack(args)));
97
- server.registerTool('check_compatibility', {
98
- description: 'Check compatibility between two tools. Returns direct graph relationships and inferred compatibility from shared neighbors.',
99
- inputSchema: checkCompatibilitySchema,
100
- }, withEventLogging('check_compatibility', async (args) => remote.checkCompatibility(args)));
101
- server.registerTool('compare_tools', {
102
- description: 'Compare two tools head-to-head using health signals, graph relationships, and community data.',
103
- inputSchema: compareToolsSchema,
104
- }, withEventLogging('compare_tools', async (args) => remote.compareTools(args)));
105
- server.registerTool('refine_requirement', {
106
- description: 'Decompose a vague user use-case into specific, searchable tool requirements.',
107
- inputSchema: refineRequirementSchema,
108
- }, withEventLogging('refine_requirement', async (args) => remote.refineRequirement(args)));
109
- server.registerTool('check_issue', {
110
- description: 'LAST RESORT — check GitHub Issues for a known error after 4+ retries and docs review.',
111
- inputSchema: checkIssueSchema,
112
- }, withEventLogging('check_issue', async (args) => remote.checkIssue(args)));
113
- server.registerTool('verify_suggestion', {
114
- description: 'Validate agent-suggested tools against the ToolPilot graph.',
115
- inputSchema: verifySuggestionSchema,
116
- }, withEventLogging('verify_suggestion', async (args) => remote.verifySuggestion(args)));
117
- server.registerTool('report_outcome', {
118
- description: 'Report the outcome of using a tool recommended by ToolPilot (fire-and-forget).',
119
- inputSchema: reportOutcomeSchema,
120
- }, withEventLogging('report_outcome', async (args) => remote.reportOutcome(args)));
121
- server.registerTool('suggest_graph_update', {
122
- description: 'Suggest a new tool, relationship, use case, or health update to the ToolPilot graph.',
123
- inputSchema: suggestGraphUpdateSchema,
124
- }, withEventLogging('suggest_graph_update', async (args) => remote.suggestGraphUpdate(args)));
125
- return server;
126
- }
127
- //# sourceMappingURL=server.prod.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.prod.js","sourceRoot":"","sources":["../src/server.prod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8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C,YAAY,CACjB,gBAAgB,EAChB;QACE,WAAW,EAAE,gFAAgF;QAC7F,WAAW,EAAE,mBAAmB;KACjC,EACD,gBAAgB,CAAC,gBAAgB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC/E,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,sBAAsB,EACtB;QACE,WAAW,EACT,sFAAsF;QACxF,WAAW,EAAE,wBAAwB;KACtC,EACD,gBAAgB,CAAC,sBAAsB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,22 +0,0 @@
1
- export type AgentType = 'claude' | 'cursor' | 'windsurf' | 'copilot' | 'copilot-cli' | 'opencode' | 'generic';
2
- interface InstructionTemplate {
3
- /** Target file path relative to project root */
4
- file_path: string;
5
- /** Whether to append to or create the file */
6
- mode: 'append' | 'create';
7
- /** Content to write/append */
8
- content: string;
9
- }
10
- export declare function getClaudeInstructions(): InstructionTemplate;
11
- export declare function getCursorInstructions(): InstructionTemplate;
12
- export declare function getWindsurfInstructions(): InstructionTemplate;
13
- export declare function getCopilotInstructions(): InstructionTemplate;
14
- export declare function getCopilotCliInstructions(): InstructionTemplate;
15
- export declare function getOpenCodeInstructions(): InstructionTemplate;
16
- export declare function getGenericInstructions(): InstructionTemplate;
17
- export declare function getInstructionsForAgent(agent: AgentType): InstructionTemplate;
18
- export declare function getMcpConfigEntry(serverPath?: string): Record<string, unknown>;
19
- /** Returns OpenCode-specific MCP config (opencode.json format under "mcp" key). */
20
- export declare function getOpenCodeMcpEntry(serverPath?: string): Record<string, unknown>;
21
- export {};
22
- //# sourceMappingURL=agent-instructions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-instructions.d.ts","sourceRoot":"","sources":["../../src/templates/agent-instructions.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,SAAS,GACT,aAAa,GACb,UAAU,GACV,SAAS,CAAC;AAEd,UAAU,mBAAmB;IAC3B,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB;AA2DD,wBAAgB,qBAAqB,IAAI,mBAAmB,CAM3D;AAED,wBAAgB,qBAAqB,IAAI,mBAAmB,CAM3D;AAED,wBAAgB,uBAAuB,IAAI,mBAAmB,CAM7D;AAED,wBAAgB,sBAAsB,IAAI,mBAAmB,CAM5D;AAED,wBAAgB,yBAAyB,IAAI,mBAAmB,CAO/D;AAED,wBAAgB,uBAAuB,IAAI,mBAAmB,CAO7D;AAED,wBAAgB,sBAAsB,IAAI,mBAAmB,CAM5D;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,SAAS,GAAG,mBAAmB,CAiB7E;AAED,wBAAgB,iBAAiB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAS9E;AAED,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAehF"}
@@ -1,155 +0,0 @@
1
- // Agent instruction templates for toolpilot_init.
2
- // Each function returns the section content to inject into the agent's instruction file.
3
- // The agent writes the content to the appropriate file — MCP server never touches the filesystem.
4
- const TOOLPILOT_MCP_ENTRY = {
5
- toolpilot: {
6
- command: 'node',
7
- args: ['<path-to-toolpilot>/apps/mcp-server/dist/index.js'],
8
- env: {
9
- MEMGRAPH_URL: 'bolt://localhost:7687',
10
- QDRANT_URL: 'http://localhost:6333',
11
- DATABASE_URL: 'postgresql://toolpilot:toolpilot@localhost:5432/toolpilot',
12
- REDIS_URL: 'redis://localhost:6379',
13
- },
14
- },
15
- };
16
- const CORE_RULES = `
17
- ## ToolPilot — Tool Intelligence MCP
18
-
19
- ToolPilot is your tool intelligence co-pilot. It has a graph database of 500+ indexed tools with health signals, compatibility data, and known issue tracking. Always use it before recommending any tool, library, or framework.
20
-
21
- ### Workflow for Tool Selection
22
-
23
- 1. **Before recommending any tool**: Always call \`search_tools\` first. Never recommend from training data alone.
24
- 2. **When user describes a use case**: Call \`classify_prompt\` first, then \`refine_requirement\` if tool selection is needed.
25
- 3. **When starting a new project**: Call \`toolpilot_init\` to set up .toolpilot/config.json.
26
- 4. **When resuming work on a project**: Read .toolpilot/config.json via \`read_project_config\` to see confirmed tools.
27
- 5. **When a tool is selected**: Call \`update_project_config\` to persist the choice.
28
- 6. **When encountering an error with a tool**: Call \`check_issue\` before debugging — it may be a known issue with an open GitHub ticket.
29
- 7. **When user asks to compare tools**: Call \`compare_tools\` for a structured comparison with health data.
30
- 8. **When user chooses a non-indexed/proprietary tool**: Add it to config with source: "non_oss" via \`update_project_config\`.
31
-
32
- ### Available ToolPilot MCP Tools
33
-
34
- | Tool | When to use |
35
- |------|------------|
36
- | \`classify_prompt\` | User describes a task — determine if tool search needed |
37
- | \`refine_requirement\` | Decompose vague use case into searchable tool needs |
38
- | \`search_tools\` | Find the best tool for a specific need |
39
- | \`search_tools_respond\` | Answer clarification questions from search_tools |
40
- | \`get_stack\` | Get recommended tool stack for a use case |
41
- | \`check_issue\` | Check if an error is a known tool bug before debugging |
42
- | \`check_compatibility\` | Check if two tools work well together |
43
- | \`compare_tools\` | Compare two tools with health and graph data |
44
- | \`report_outcome\` | Report whether a recommended tool worked (improves future results) |
45
- | \`toolpilot_init\` | Set up ToolPilot for a new project |
46
- | \`init_project_config\` | Initialize .toolpilot/config.json |
47
- | \`read_project_config\` | Parse .toolpilot/config.json to get confirmed tools |
48
- | \`update_project_config\` | Add/remove/update tools in .toolpilot/config.json |
49
- | \`suggest_graph_update\` | Suggest a new tool or relationship for the ToolPilot graph |
50
-
51
- ### Rules
52
-
53
- - NEVER recommend a tool without first checking ToolPilot unless the tool is already in .toolpilot/config.json
54
- - Always check .toolpilot/config.json at the start of a session if it exists
55
- - Prefer open-source tools from ToolPilot index; flag proprietary alternatives clearly
56
- - After selecting a tool, always call \`update_project_config\` to persist it
57
- - After using a tool successfully/unsuccessfully, call \`report_outcome\`
58
- `;
59
- export function getClaudeInstructions() {
60
- return {
61
- file_path: 'CLAUDE.md',
62
- mode: 'append',
63
- content: CORE_RULES,
64
- };
65
- }
66
- export function getCursorInstructions() {
67
- return {
68
- file_path: '.cursorrules',
69
- mode: 'append',
70
- content: CORE_RULES,
71
- };
72
- }
73
- export function getWindsurfInstructions() {
74
- return {
75
- file_path: '.windsurfrules',
76
- mode: 'append',
77
- content: CORE_RULES,
78
- };
79
- }
80
- export function getCopilotInstructions() {
81
- return {
82
- file_path: '.github/copilot-instructions.md',
83
- mode: 'create',
84
- content: `# GitHub Copilot Instructions\n${CORE_RULES}`,
85
- };
86
- }
87
- export function getCopilotCliInstructions() {
88
- // GitHub Copilot CLI reads .github/copilot-instructions.md and AGENTS.md
89
- return {
90
- file_path: '.github/copilot-instructions.md',
91
- mode: 'append',
92
- content: CORE_RULES,
93
- };
94
- }
95
- export function getOpenCodeInstructions() {
96
- // OpenCode reads AGENTS.md (falls back to CLAUDE.md if absent)
97
- return {
98
- file_path: 'AGENTS.md',
99
- mode: 'append',
100
- content: CORE_RULES,
101
- };
102
- }
103
- export function getGenericInstructions() {
104
- return {
105
- file_path: 'AI_INSTRUCTIONS.md',
106
- mode: 'create',
107
- content: `# AI Assistant Instructions\n${CORE_RULES}`,
108
- };
109
- }
110
- export function getInstructionsForAgent(agent) {
111
- switch (agent) {
112
- case 'claude':
113
- return getClaudeInstructions();
114
- case 'cursor':
115
- return getCursorInstructions();
116
- case 'windsurf':
117
- return getWindsurfInstructions();
118
- case 'copilot':
119
- return getCopilotInstructions();
120
- case 'copilot-cli':
121
- return getCopilotCliInstructions();
122
- case 'opencode':
123
- return getOpenCodeInstructions();
124
- case 'generic':
125
- return getGenericInstructions();
126
- }
127
- }
128
- export function getMcpConfigEntry(serverPath) {
129
- const entry = { ...TOOLPILOT_MCP_ENTRY };
130
- if (serverPath) {
131
- entry.toolpilot = {
132
- ...entry.toolpilot,
133
- args: [serverPath],
134
- };
135
- }
136
- return entry;
137
- }
138
- /** Returns OpenCode-specific MCP config (opencode.json format under "mcp" key). */
139
- export function getOpenCodeMcpEntry(serverPath) {
140
- const resolvedPath = serverPath ?? '<path-to-toolpilot>/apps/mcp-server/dist/index.js';
141
- return {
142
- toolpilot: {
143
- type: 'local',
144
- command: ['node', resolvedPath],
145
- env: {
146
- MEMGRAPH_URL: 'bolt://localhost:7687',
147
- QDRANT_URL: 'http://localhost:6333',
148
- DATABASE_URL: 'postgresql://toolpilot:toolpilot@localhost:5432/toolpilot',
149
- REDIS_URL: 'redis://localhost:6379',
150
- },
151
- enabled: true,
152
- },
153
- };
154
- }
155
- //# sourceMappingURL=agent-instructions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-instructions.js","sourceRoot":"","sources":["../../src/templates/agent-instructions.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,yFAAyF;AACzF,kGAAkG;AAoBlG,MAAM,mBAAmB,GAAG;IAC1B,SAAS,EAAE;QACT,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,CAAC,mDAAmD,CAAC;QAC3D,GAAG,EAAE;YACH,YAAY,EAAE,uBAAuB;YACrC,UAAU,EAAE,uBAAuB;YACnC,YAAY,EAAE,2DAA2D;YACzE,SAAS,EAAE,wBAAwB;SACpC;KACF;CACF,CAAC;AAEF,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0ClB,CAAC;AAEF,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,SAAS,EAAE,WAAW;QACtB,IAAI,EAAE,QAAQ;QAC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QACrC,KAAK,UAAU;YACb,OAAO,uBAAuB,EAAE,CAAC;QACnC,KAAK,SAAS;YACZ,OAAO,sBAAsB,EAAE,CAAC;IACpC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,UAAmB;IACnD,MAAM,KAAK,GAAG,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACzC,IAAI,UAAU,EAAE,CAAC;QACf,KAAK,CAAC,SAAS,GAAG;YAChB,GAAG,KAAK,CAAC,SAAS;YAClB,IAAI,EAAE,CAAC,UAAU,CAAC;SACnB,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,mBAAmB,CAAC,UAAmB;IACrD,MAAM,YAAY,GAAG,UAAU,IAAI,mDAAmD,CAAC;IACvF,OAAO;QACL,SAAS,EAAE;YACT,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC;YAC/B,GAAG,EAAE;gBACH,YAAY,EAAE,uBAAuB;gBACrC,UAAU,EAAE,uBAAuB;gBACnC,YAAY,EAAE,2DAA2D;gBACzE,SAAS,EAAE,wBAAwB;aACpC;YACD,OAAO,EAAE,IAAI;SACd;KACF,CAAC;AACJ,CAAC"}
@@ -1,100 +0,0 @@
1
- export declare function handleCheckCompatibility(args: {
2
- tool_a: string;
3
- tool_b: string;
4
- }): Promise<{
5
- [x: string]: unknown;
6
- content: ({
7
- type: "text";
8
- text: string;
9
- annotations?: {
10
- audience?: ("user" | "assistant")[] | undefined;
11
- priority?: number | undefined;
12
- lastModified?: string | undefined;
13
- } | undefined;
14
- _meta?: {
15
- [x: string]: unknown;
16
- } | undefined;
17
- } | {
18
- type: "image";
19
- data: string;
20
- mimeType: string;
21
- annotations?: {
22
- audience?: ("user" | "assistant")[] | undefined;
23
- priority?: number | undefined;
24
- lastModified?: string | undefined;
25
- } | undefined;
26
- _meta?: {
27
- [x: string]: unknown;
28
- } | undefined;
29
- } | {
30
- type: "audio";
31
- data: string;
32
- mimeType: string;
33
- annotations?: {
34
- audience?: ("user" | "assistant")[] | undefined;
35
- priority?: number | undefined;
36
- lastModified?: string | undefined;
37
- } | undefined;
38
- _meta?: {
39
- [x: string]: unknown;
40
- } | undefined;
41
- } | {
42
- uri: string;
43
- name: string;
44
- type: "resource_link";
45
- description?: string | undefined;
46
- mimeType?: string | undefined;
47
- annotations?: {
48
- audience?: ("user" | "assistant")[] | undefined;
49
- priority?: number | undefined;
50
- lastModified?: string | undefined;
51
- } | undefined;
52
- _meta?: {
53
- [x: string]: unknown;
54
- } | undefined;
55
- icons?: {
56
- src: string;
57
- mimeType?: string | undefined;
58
- sizes?: string[] | undefined;
59
- theme?: "light" | "dark" | undefined;
60
- }[] | undefined;
61
- title?: string | undefined;
62
- } | {
63
- type: "resource";
64
- resource: {
65
- uri: string;
66
- text: string;
67
- mimeType?: string | undefined;
68
- _meta?: {
69
- [x: string]: unknown;
70
- } | undefined;
71
- } | {
72
- uri: string;
73
- blob: string;
74
- mimeType?: string | undefined;
75
- _meta?: {
76
- [x: string]: unknown;
77
- } | undefined;
78
- };
79
- annotations?: {
80
- audience?: ("user" | "assistant")[] | undefined;
81
- priority?: number | undefined;
82
- lastModified?: string | undefined;
83
- } | undefined;
84
- _meta?: {
85
- [x: string]: unknown;
86
- } | undefined;
87
- })[];
88
- _meta?: {
89
- [x: string]: unknown;
90
- progressToken?: string | number | undefined;
91
- "io.modelcontextprotocol/related-task"?: {
92
- taskId: string;
93
- } | undefined;
94
- } | undefined;
95
- structuredContent?: {
96
- [x: string]: unknown;
97
- } | undefined;
98
- isError?: boolean | undefined;
99
- }>;
100
- //# sourceMappingURL=check-compatibility.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-compatibility.d.ts","sourceRoot":"","sources":["../../src/tools/check-compatibility.ts"],"names":[],"mappings":"AAaA,wBAAsB,wBAAwB,CAAC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8GtF"}
@@ -1,103 +0,0 @@
1
- import { MemgraphToolRepository } from '@toolpilot/graph';
2
- import pino from 'pino';
3
- import { errResult, okResult } from '../utils.js';
4
- const logger = pino({ name: '@toolpilot/mcp-server:check-compatibility' });
5
- const repo = new MemgraphToolRepository();
6
- const COMPATIBLE_TYPES = new Set(['COMPATIBLE_WITH', 'INTEGRATES_WITH', 'POPULAR_WITH']);
7
- const CONFLICT_TYPES = new Set(['CONFLICTS_WITH', 'BREAKS_FROM']);
8
- const REQUIRES_TYPES = new Set(['REQUIRES']);
9
- export async function handleCheckCompatibility(args) {
10
- try {
11
- logger.info({ tool_a: args.tool_a, tool_b: args.tool_b }, 'check_compatibility called');
12
- // Verify both tools exist
13
- const [existsA, existsB] = await Promise.all([
14
- repo.toolExists(args.tool_a),
15
- repo.toolExists(args.tool_b),
16
- ]);
17
- if (!existsA.ok || !existsA.data) {
18
- return errResult('tool_not_found', `Tool "${args.tool_a}" not found in the ToolPilot index`);
19
- }
20
- if (!existsB.ok || !existsB.data) {
21
- return errResult('tool_not_found', `Tool "${args.tool_b}" not found in the ToolPilot index`);
22
- }
23
- // Check direct edges between the two tools
24
- const edgesResult = await repo.getDirectEdges(args.tool_a, args.tool_b);
25
- if (!edgesResult.ok) {
26
- return errResult('graph_error', edgesResult.error.message);
27
- }
28
- const edges = edgesResult.data;
29
- let status = 'unknown';
30
- let confidence = 0.5;
31
- const signals = [];
32
- if (edges.length > 0) {
33
- // Direct edges — high confidence
34
- confidence = Math.max(...edges.map((e) => e.confidence));
35
- if (edges.some((e) => CONFLICT_TYPES.has(e.edgeType))) {
36
- status = 'conflicts';
37
- signals.push(`Direct ${edges.find((e) => CONFLICT_TYPES.has(e.edgeType))?.edgeType} edge found`);
38
- }
39
- else if (edges.some((e) => COMPATIBLE_TYPES.has(e.edgeType))) {
40
- status = 'compatible';
41
- signals.push(`Direct ${edges.find((e) => COMPATIBLE_TYPES.has(e.edgeType))?.edgeType} edge found`);
42
- }
43
- else if (edges.some((e) => REQUIRES_TYPES.has(e.edgeType))) {
44
- status = 'requires';
45
- signals.push('Direct REQUIRES relationship found');
46
- }
47
- }
48
- else {
49
- // No direct edges — check 2-hop paths via shared neighbors
50
- const [neighborsA, neighborsB] = await Promise.all([
51
- repo.getRelated(args.tool_a, 10),
52
- repo.getRelated(args.tool_b, 10),
53
- ]);
54
- if (neighborsA.ok && neighborsB.ok) {
55
- const namesA = new Set(neighborsA.data.map((t) => t.name));
56
- const namesB = new Set(neighborsB.data.map((t) => t.name));
57
- const sharedNeighbors = [...namesA].filter((n) => namesB.has(n));
58
- if (sharedNeighbors.length >= 3) {
59
- status = 'compatible';
60
- confidence = 0.6;
61
- signals.push(`${sharedNeighbors.length} shared graph neighbors suggest these tools are used together`);
62
- }
63
- else if (sharedNeighbors.length > 0) {
64
- status = 'unknown';
65
- confidence = 0.4;
66
- signals.push(`${sharedNeighbors.length} shared neighbors found — insufficient for strong inference`);
67
- }
68
- else {
69
- signals.push('No direct edges or shared neighbors — these tools may operate in different domains');
70
- }
71
- }
72
- }
73
- const recommendation = status === 'compatible'
74
- ? `${args.tool_a} and ${args.tool_b} can be used together.`
75
- : status === 'conflicts'
76
- ? `${args.tool_a} and ${args.tool_b} have known conflicts. Avoid using them in the same project.`
77
- : status === 'requires'
78
- ? 'One of these tools requires the other. Check the direction of the REQUIRES edge.'
79
- : 'No direct compatibility data. These tools may work together but it has not been verified.';
80
- return okResult({
81
- tool_a: args.tool_a,
82
- tool_b: args.tool_b,
83
- status,
84
- confidence: Math.round(confidence * 100) / 100,
85
- direct_edges: edges.map((e) => ({
86
- type: e.edgeType,
87
- direction: e.direction,
88
- confidence: Math.round(e.confidence * 100) / 100,
89
- effective_weight: Math.round(e.effective_weight * 100) / 100,
90
- })),
91
- signals,
92
- recommendation,
93
- suggest_graph_update: status === 'unknown'
94
- ? `If you discover compatibility data, call suggest_graph_update with suggestion_type: "new_edge" to contribute it back.`
95
- : null,
96
- });
97
- }
98
- catch (e) {
99
- logger.error({ err: e }, 'check_compatibility failed');
100
- return errResult('compatibility_error', e instanceof Error ? e.message : String(e));
101
- }
102
- }
103
- //# sourceMappingURL=check-compatibility.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-compatibility.js","sourceRoot":"","sources":["../../src/tools/check-compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,2CAA2C,EAAE,CAAC,CAAC;AAC3E,MAAM,IAAI,GAAG,IAAI,sBAAsB,EAAE,CAAC;AAE1C,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC;AACzF,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC,CAAC;AAClE,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAI7C,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,IAAwC;IACrF,IAAI,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,4BAA4B,CAAC,CAAC;QAExF,0BAA0B;QAC1B,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC3C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,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