valent-pipeline 0.2.13 → 0.2.14
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/package.json +1 -1
- package/src/commands/init.js +12 -11
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -123,22 +123,23 @@ export async function init(options = {}) {
|
|
|
123
123
|
} catch (err) {
|
|
124
124
|
console.warn(` Warning: Failed to install ${mcpPackage}. Run "npm install -g ${mcpPackage}" manually.`);
|
|
125
125
|
}
|
|
126
|
-
// Register in .
|
|
127
|
-
const
|
|
128
|
-
let
|
|
129
|
-
if (fileExists(
|
|
126
|
+
// Register in .mcp.json (project-scope MCP config)
|
|
127
|
+
const mcpJsonPath = join(projectRoot, '.mcp.json');
|
|
128
|
+
let mcpConfig = {};
|
|
129
|
+
if (fileExists(mcpJsonPath)) {
|
|
130
130
|
try {
|
|
131
|
-
|
|
131
|
+
mcpConfig = JSON.parse(readFileSync(mcpJsonPath, 'utf-8'));
|
|
132
132
|
} catch { /* start fresh if parse fails */ }
|
|
133
133
|
}
|
|
134
|
-
if (!
|
|
135
|
-
if (!
|
|
136
|
-
|
|
134
|
+
if (!mcpConfig.mcpServers) mcpConfig.mcpServers = {};
|
|
135
|
+
if (!mcpConfig.mcpServers[mcpName]) {
|
|
136
|
+
mcpConfig.mcpServers[mcpName] = {
|
|
137
|
+
type: 'stdio',
|
|
137
138
|
command: 'npx',
|
|
138
|
-
args: [mcpPackage]
|
|
139
|
+
args: ['-y', mcpPackage]
|
|
139
140
|
};
|
|
140
|
-
writeFileSafe(
|
|
141
|
-
console.log(` Registered ${mcpName} in .
|
|
141
|
+
writeFileSafe(mcpJsonPath, JSON.stringify(mcpConfig, null, 2) + '\n');
|
|
142
|
+
console.log(` Registered ${mcpName} in .mcp.json`);
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
|