@neurynae/toolcairn-mcp 0.10.5 → 0.10.7
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 +60 -67
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1001,8 +1001,10 @@ var suggestGraphUpdateSchema = {
|
|
|
1001
1001
|
tools: z.array(z.object({
|
|
1002
1002
|
tool_name: z.string().min(1),
|
|
1003
1003
|
github_url: z.string().url().optional(),
|
|
1004
|
-
description: z.string().optional()
|
|
1005
|
-
|
|
1004
|
+
description: z.string().optional(),
|
|
1005
|
+
ecosystem: z.string().min(1).optional()
|
|
1006
|
+
})).min(1).max(200).optional().describe('Batch of tools to stage for admin review. Use with suggestion_type="new_tool". Each entry may include `ecosystem` (npm/pypi/cargo/\u2026) so the engine can cross-check the authoritative github_url from the package registry. Overrides single-tool fields when present.'),
|
|
1007
|
+
ecosystem: z.string().min(1).optional(),
|
|
1006
1008
|
relationship: z.object({
|
|
1007
1009
|
source_tool: z.string(),
|
|
1008
1010
|
target_tool: z.string(),
|
|
@@ -4105,6 +4107,14 @@ async function scanProject(projectRoot, options = {}) {
|
|
|
4105
4107
|
const categories = graph?.tool?.categories;
|
|
4106
4108
|
const github_url = githubUrls.get(key) ?? local_github_url;
|
|
4107
4109
|
const version = locations.find((l) => l.resolved_version)?.resolved_version ?? locations[0]?.version_constraint;
|
|
4110
|
+
const toolRef = graph?.tool;
|
|
4111
|
+
const docs = toolRef?.docs ? {
|
|
4112
|
+
readme_url: toolRef.docs.readme_url ?? void 0,
|
|
4113
|
+
docs_url: toolRef.docs.docs_url ?? void 0,
|
|
4114
|
+
api_url: toolRef.docs.api_url ?? void 0,
|
|
4115
|
+
changelog_url: toolRef.docs.changelog_url ?? void 0
|
|
4116
|
+
} : void 0;
|
|
4117
|
+
const hasDocs = docs && Object.values(docs).some((v) => v !== void 0);
|
|
4108
4118
|
confirmed.push({
|
|
4109
4119
|
name: name2,
|
|
4110
4120
|
source,
|
|
@@ -4116,7 +4126,12 @@ async function scanProject(projectRoot, options = {}) {
|
|
|
4116
4126
|
canonical_name: canonical,
|
|
4117
4127
|
categories,
|
|
4118
4128
|
match_method: matchMethod,
|
|
4119
|
-
locations
|
|
4129
|
+
locations,
|
|
4130
|
+
description: toolRef?.description ?? void 0,
|
|
4131
|
+
license: toolRef?.license ?? void 0,
|
|
4132
|
+
homepage_url: toolRef?.homepage_url ?? void 0,
|
|
4133
|
+
docs: hasDocs ? docs : void 0,
|
|
4134
|
+
package_managers: toolRef?.package_managers && toolRef.package_managers.length > 0 ? toolRef.package_managers : void 0
|
|
4120
4135
|
});
|
|
4121
4136
|
}
|
|
4122
4137
|
confirmed.sort((a, b) => {
|
|
@@ -4315,72 +4330,46 @@ var TOOLCAIRN_MCP_ENTRY = IS_WINDOWS ? {
|
|
|
4315
4330
|
}
|
|
4316
4331
|
};
|
|
4317
4332
|
var CORE_RULES = `
|
|
4318
|
-
## ToolCairn \u2014 Tool Intelligence
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
###
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
project_root + action \u2014 the server atomically updates config.json and appends to
|
|
4350
|
-
audit-log.jsonl.
|
|
4351
|
-
6. **When encountering an error with a tool**: Call \`check_issue\` before debugging \u2014
|
|
4352
|
-
it may be a known issue with an open GitHub ticket.
|
|
4353
|
-
7. **When user asks to compare tools**: Call \`compare_tools\`.
|
|
4354
|
-
8. **When user chooses a non-indexed/proprietary tool**: Call \`update_project_config\`
|
|
4355
|
-
with \`data: { source: "non_oss" }\`.
|
|
4356
|
-
|
|
4357
|
-
### Available ToolCairn MCP Tools
|
|
4358
|
-
|
|
4359
|
-
| Tool | When to use |
|
|
4360
|
-
|------|------------|
|
|
4361
|
-
| \`classify_prompt\` | User describes a task \u2014 determine if tool search needed |
|
|
4362
|
-
| \`refine_requirement\` | Decompose vague use case into searchable tool needs |
|
|
4363
|
-
| \`search_tools\` | Find the best tool for a specific need |
|
|
4364
|
-
| \`search_tools_respond\` | Answer clarification questions from search_tools |
|
|
4365
|
-
| \`get_stack\` | Get recommended tool stack for a use case |
|
|
4366
|
-
| \`check_issue\` | Check if an error is a known tool bug before debugging |
|
|
4367
|
-
| \`check_compatibility\` | Check if two tools work well together |
|
|
4368
|
-
| \`compare_tools\` | Compare two tools with health and graph data |
|
|
4369
|
-
| \`report_outcome\` | Report whether a recommended tool worked (improves future results) |
|
|
4370
|
-
| \`toolcairn_init\` | One-call project bootstrap (auto-discovers + writes config.json) |
|
|
4371
|
-
| \`read_project_config\` | Read .toolcairn/config.json from disk (returns structured snapshot) |
|
|
4372
|
-
| \`update_project_config\` | Apply a mutation (add_tool / remove_tool / update_tool / add_evaluation) |
|
|
4373
|
-
| \`suggest_graph_update\` | Suggest a new tool or relationship for the ToolCairn graph |
|
|
4333
|
+
## ToolCairn MCP \u2014 Tool Intelligence
|
|
4334
|
+
|
|
4335
|
+
Graph-backed catalog of tools with health, compatibility, and issue data. Always consult before recommending a tool/library/framework. The server owns \`.toolcairn/config.json\` + \`audit-log.jsonl\` under a cross-process lock \u2014 never read/write these files directly; use the MCP tools.
|
|
4336
|
+
|
|
4337
|
+
### First-turn protocol
|
|
4338
|
+
|
|
4339
|
+
1. \`read_project_config({ project_root })\`. If \`status:"not_initialized"\`, call \`toolcairn_init\`. (Auto-init usually ran during \`toolcairn_auth\` already.)
|
|
4340
|
+
2. **If \`unknown_tools[]\` is non-empty** \u2014 BEFORE replying to the user:
|
|
4341
|
+
- \`suggest_graph_update({ suggestion_type:"new_tool", data:{ tools: <unknown_tools array> } })\` \u2014 entries are STAGED for admin review, NOT live.
|
|
4342
|
+
- \`update_project_config({ action:"mark_suggestions_sent", data:{ tool_names: <names that staged ok> } })\`.
|
|
4343
|
+
- Repeat per root in monorepos (each has its own list).
|
|
4344
|
+
|
|
4345
|
+
### Tool reference
|
|
4346
|
+
|
|
4347
|
+
| Tool | Trigger |
|
|
4348
|
+
|------|---------|
|
|
4349
|
+
| \`classify_prompt\` | User describes a task \u2014 decide whether tool search is needed |
|
|
4350
|
+
| \`refine_requirement\` | Decompose a use case into searchable sub-needs (required input for \`get_stack\`) |
|
|
4351
|
+
| \`search_tools\` | Find the best tool for one specific need |
|
|
4352
|
+
| \`search_tools_respond\` | Submit clarification answers for an in-progress search session |
|
|
4353
|
+
| \`get_stack\` | Build a version-compatible multi-layer stack for a use case |
|
|
4354
|
+
| \`compare_tools\` | Head-to-head comparison of two tools |
|
|
4355
|
+
| \`check_compatibility\` | Version-aware compatibility check between two tools |
|
|
4356
|
+
| \`check_issue\` | LAST RESORT \u2014 known-bug lookup after 4+ retries + docs review |
|
|
4357
|
+
| \`verify_suggestion\` | Validate agent-picked tool names against the graph |
|
|
4358
|
+
| \`report_outcome\` | Fire-and-forget feedback after using a recommended tool |
|
|
4359
|
+
| \`suggest_graph_update\` | Stage a new tool / edge / use-case for admin review (never writes live) |
|
|
4360
|
+
| \`toolcairn_init\` | Manual project re-scan (auto-init usually covers it) |
|
|
4361
|
+
| \`read_project_config\` | Load project snapshot (confirmed, pending, unknown, stale, metadata) |
|
|
4362
|
+
| \`update_project_config\` | Mutate confirmed tools or mark unknown suggestions sent |
|
|
4363
|
+
| \`toolcairn_auth\` | Login / status / logout for ToolCairn credentials |
|
|
4374
4364
|
|
|
4375
4365
|
### Rules
|
|
4376
4366
|
|
|
4377
|
-
-
|
|
4378
|
-
-
|
|
4379
|
-
-
|
|
4380
|
-
-
|
|
4381
|
-
-
|
|
4382
|
-
-
|
|
4383
|
-
- **Drain \`unknown_tools[]\` before your first reply** via \`suggest_graph_update\` (batch) + \`update_project_config\` action="mark_suggestions_sent". Staging-only \u2014 admin approval gates live promotion.
|
|
4367
|
+
- Never recommend a tool that isn't in \`confirmed_tools\` without first hitting \`search_tools\` / \`get_stack\`.
|
|
4368
|
+
- After selecting a tool: \`update_project_config({ action:"add_tool", tool_name, data: {...} })\`. Pass \`data.source:"non_oss"\` for proprietary picks.
|
|
4369
|
+
- After using a tool (success or failure): \`report_outcome\`.
|
|
4370
|
+
- Use \`check_issue\` only after docs + 4 retries \u2014 it's network-heavy.
|
|
4371
|
+
- Confirmed tools in config.json carry graph enrichment: \`description\`, \`license\`, \`homepage_url\`, \`docs.{readme_url,docs_url,api_url,changelog_url}\`, and \`package_managers[]\` with install commands. Prefer these over re-fetching.
|
|
4372
|
+
- Suggestions are STAGED; admin approval gates live-graph promotion.
|
|
4384
4373
|
`;
|
|
4385
4374
|
function getClaudeInstructions() {
|
|
4386
4375
|
return {
|
|
@@ -5106,7 +5095,11 @@ async function submitUnknownsToEngine(remote, pending) {
|
|
|
5106
5095
|
const res = await remote.suggestGraphUpdate({
|
|
5107
5096
|
suggestion_type: "new_tool",
|
|
5108
5097
|
data: {
|
|
5109
|
-
tools: pending.map((t) => ({
|
|
5098
|
+
tools: pending.map((t) => ({
|
|
5099
|
+
tool_name: t.name,
|
|
5100
|
+
github_url: t.github_url,
|
|
5101
|
+
ecosystem: t.ecosystem
|
|
5102
|
+
}))
|
|
5110
5103
|
},
|
|
5111
5104
|
confidence: 0.5
|
|
5112
5105
|
});
|