fix: install native Cursor hook and MCP config (#1543)

* fix: install native cursor hook and MCP config

* fix: avoid false healthy stdio mcp probes
This commit is contained in:
Affaan Mustafa
2026-04-21 18:35:21 -04:00
committed by GitHub
parent 8c422a76f4
commit 92e0c7e9ff
8 changed files with 249 additions and 52 deletions

View File

@@ -122,6 +122,15 @@ function runTests() {
)),
'Should preserve non-rule Cursor platform files'
);
assert.ok(
plan.operations.some(operation => (
operation.sourceRelativePath === '.mcp.json'
&& operation.destinationPath === path.join(projectRoot, '.cursor', 'mcp.json')
&& operation.kind === 'merge-json'
&& operation.strategy === 'merge-json'
)),
'Should materialize Cursor MCP config at the native project path'
);
assert.ok(
plan.operations.some(operation => (
operation.sourceRelativePath === '.cursor/rules/common-agents.md'

View File

@@ -93,6 +93,9 @@ function runTests() {
const hooksJson = plan.operations.find(operation => (
normalizedRelativePath(operation.sourceRelativePath) === '.cursor/hooks.json'
));
const mcpJson = plan.operations.find(operation => (
normalizedRelativePath(operation.sourceRelativePath) === '.mcp.json'
));
const preserved = plan.operations.find(operation => (
normalizedRelativePath(operation.sourceRelativePath) === '.cursor/rules/common-coding-style.md'
));
@@ -100,6 +103,10 @@ function runTests() {
assert.ok(hooksJson, 'Should preserve non-rule Cursor platform config files');
assert.strictEqual(hooksJson.strategy, 'preserve-relative-path');
assert.strictEqual(hooksJson.destinationPath, path.join(projectRoot, '.cursor', 'hooks.json'));
assert.ok(mcpJson, 'Should materialize a Cursor MCP config from the shared root MCP config');
assert.strictEqual(mcpJson.kind, 'merge-json');
assert.strictEqual(mcpJson.strategy, 'merge-json');
assert.strictEqual(mcpJson.destinationPath, path.join(projectRoot, '.cursor', 'mcp.json'));
assert.ok(preserved, 'Should include flattened Cursor rule scaffold operations');
assert.strictEqual(preserved.strategy, 'flatten-copy');
@@ -201,6 +208,14 @@ function runTests() {
)),
'Should preserve non-rule Cursor platform config files'
);
assert.ok(
plan.operations.some(operation => (
normalizedRelativePath(operation.sourceRelativePath) === '.mcp.json'
&& operation.kind === 'merge-json'
&& operation.destinationPath === path.join(projectRoot, '.cursor', 'mcp.json')
)),
'Should materialize a project-level Cursor MCP config'
);
assert.ok(
!plan.operations.some(operation => (
operation.destinationPath === path.join(projectRoot, '.cursor', 'rules', 'README.mdc')