@neurynae/toolcairn-mcp 0.10.6 → 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 +51 -64
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4107,6 +4107,14 @@ async function scanProject(projectRoot, options = {}) {
|
|
|
4107
4107
|
const categories = graph?.tool?.categories;
|
|
4108
4108
|
const github_url = githubUrls.get(key) ?? local_github_url;
|
|
4109
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);
|
|
4110
4118
|
confirmed.push({
|
|
4111
4119
|
name: name2,
|
|
4112
4120
|
source,
|
|
@@ -4118,7 +4126,12 @@ async function scanProject(projectRoot, options = {}) {
|
|
|
4118
4126
|
canonical_name: canonical,
|
|
4119
4127
|
categories,
|
|
4120
4128
|
match_method: matchMethod,
|
|
4121
|
-
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
|
|
4122
4135
|
});
|
|
4123
4136
|
}
|
|
4124
4137
|
confirmed.sort((a, b) => {
|
|
@@ -4317,72 +4330,46 @@ var TOOLCAIRN_MCP_ENTRY = IS_WINDOWS ? {
|
|
|
4317
4330
|
}
|
|
4318
4331
|
};
|
|
4319
4332
|
var CORE_RULES = `
|
|
4320
|
-
## ToolCairn \u2014 Tool Intelligence
|
|
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
|
-
|
|
4350
|
-
|
|
4351
|
-
project_root + action \u2014 the server atomically updates config.json and appends to
|
|
4352
|
-
audit-log.jsonl.
|
|
4353
|
-
6. **When encountering an error with a tool**: Call \`check_issue\` before debugging \u2014
|
|
4354
|
-
it may be a known issue with an open GitHub ticket.
|
|
4355
|
-
7. **When user asks to compare tools**: Call \`compare_tools\`.
|
|
4356
|
-
8. **When user chooses a non-indexed/proprietary tool**: Call \`update_project_config\`
|
|
4357
|
-
with \`data: { source: "non_oss" }\`.
|
|
4358
|
-
|
|
4359
|
-
### Available ToolCairn MCP Tools
|
|
4360
|
-
|
|
4361
|
-
| Tool | When to use |
|
|
4362
|
-
|------|------------|
|
|
4363
|
-
| \`classify_prompt\` | User describes a task \u2014 determine if tool search needed |
|
|
4364
|
-
| \`refine_requirement\` | Decompose vague use case into searchable tool needs |
|
|
4365
|
-
| \`search_tools\` | Find the best tool for a specific need |
|
|
4366
|
-
| \`search_tools_respond\` | Answer clarification questions from search_tools |
|
|
4367
|
-
| \`get_stack\` | Get recommended tool stack for a use case |
|
|
4368
|
-
| \`check_issue\` | Check if an error is a known tool bug before debugging |
|
|
4369
|
-
| \`check_compatibility\` | Check if two tools work well together |
|
|
4370
|
-
| \`compare_tools\` | Compare two tools with health and graph data |
|
|
4371
|
-
| \`report_outcome\` | Report whether a recommended tool worked (improves future results) |
|
|
4372
|
-
| \`toolcairn_init\` | One-call project bootstrap (auto-discovers + writes config.json) |
|
|
4373
|
-
| \`read_project_config\` | Read .toolcairn/config.json from disk (returns structured snapshot) |
|
|
4374
|
-
| \`update_project_config\` | Apply a mutation (add_tool / remove_tool / update_tool / add_evaluation) |
|
|
4375
|
-
| \`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 |
|
|
4376
4364
|
|
|
4377
4365
|
### Rules
|
|
4378
4366
|
|
|
4379
|
-
-
|
|
4380
|
-
-
|
|
4381
|
-
-
|
|
4382
|
-
-
|
|
4383
|
-
-
|
|
4384
|
-
-
|
|
4385
|
-
- **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.
|
|
4386
4373
|
`;
|
|
4387
4374
|
function getClaudeInstructions() {
|
|
4388
4375
|
return {
|