Files
msd-core/tests/context7-plugin-grant-parity.test.cjs
Tom Boucher 68a5258d45 fix(#2017): grant mcp__plugin_context7_context7__* for plugin-marketplace context7 (8 agents) (#2029)
* fix(#2017: grant mcp__plugin_context7_context7__* for plugin-marketplace context7

The 8 context7-using agents granted only mcp__context7__* (standalone server
form). Claude Code's plugin-marketplace context7 install names tools
mcp__plugin_context7_context7__*, so the grant never matched and every
researcher/planner/executor silently lost doc lookup (fell back to WebSearch).

- 8 agents: add mcp__plugin_context7_context7__* alongside mcp__context7__*.
- scripts/research-profiles.cjs: update the researcher profile tools to match.
- tests/context7-plugin-grant-parity.test.cjs: regression guard — no agent
  grants the standalone form without the plugin form.

Closes #2017

* docs(#2017): backfill changeset pr 2029
2026-07-05 17:15:48 -04:00

36 lines
1.5 KiB
JavaScript

'use strict';
// Regression guard for #2017 — agent `mcp__context7__*` grants only match a
// standalone context7 MCP server; the Claude Code plugin-marketplace install
// (`context7@claude-plugins-official`) names tools `mcp__plugin_context7_context7__*`,
// so every agent that uses context7 must grant BOTH forms or silently lose
// documentation lookup (falls back to WebSearch with no error).
const { describe, test } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('fs');
const path = require('path');
const AGENTS_DIR = path.join(__dirname, '..', 'agents');
function agentFiles() {
return fs.readdirSync(AGENTS_DIR).filter((f) => f.endsWith('.md')).map((f) => path.join(AGENTS_DIR, f));
}
describe('#2017 — context7 plugin-marketplace grant parity', () => {
const STANDALONE = 'mcp__context7__*';
const PLUGIN = 'mcp__plugin_context7_context7__*';
for (const file of agentFiles()) {
const name = path.basename(file);
const content = fs.readFileSync(file, 'utf8');
const toolsLine = (content.split(/\r?\n/).find((l) => /^tools:/.test(l)) || '');
test(`${name}: standalone context7 grant implies the plugin-marketplace grant`, () => {
if (!toolsLine.includes(STANDALONE)) return; // agent doesn't use context7 — skip
assert.ok(toolsLine.includes(PLUGIN),
`${name} grants ${STANDALONE} but not ${PLUGIN} (plugin-marketplace installs silently lose doc lookup — #2017)`);
});
}
});