@10kdevs/matha 0.1.2 → 0.1.3
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/commands/init.js +32 -0
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -132,6 +132,28 @@ export async function runInit(projectRoot = process.cwd(), deps) {
|
|
|
132
132
|
catch {
|
|
133
133
|
log('No git history found — cortex will build as commits accumulate');
|
|
134
134
|
}
|
|
135
|
+
// Write MCP server config
|
|
136
|
+
try {
|
|
137
|
+
const mcpServerPath = await resolveMcpServerPath(projectRoot);
|
|
138
|
+
const mcpConfigContent = {
|
|
139
|
+
mcpServers: {
|
|
140
|
+
matha: {
|
|
141
|
+
command: 'node',
|
|
142
|
+
args: [mcpServerPath, 'serve'],
|
|
143
|
+
description: 'MATHA persistent cognitive layer',
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
const mcpConfigPath = path.join(mathaDir, 'mcp-config.json');
|
|
148
|
+
await writeAtomic(mcpConfigPath, mcpConfigContent, { overwrite: true });
|
|
149
|
+
log('');
|
|
150
|
+
log('MCP server config written to .matha/mcp-config.json');
|
|
151
|
+
log('Add this to your IDE MCP settings:');
|
|
152
|
+
log(JSON.stringify(mcpConfigContent, null, 2));
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
log(`Warning: Could not write MCP config: ${err.message}`);
|
|
156
|
+
}
|
|
135
157
|
return {
|
|
136
158
|
projectRoot,
|
|
137
159
|
brainDir: '.matha',
|
|
@@ -264,3 +286,13 @@ async function defaultAsk(message) {
|
|
|
264
286
|
const prompts = await import('@inquirer/prompts');
|
|
265
287
|
return prompts.input({ message });
|
|
266
288
|
}
|
|
289
|
+
async function resolveMcpServerPath(projectRoot) {
|
|
290
|
+
// Try node_modules/.bin/matha first
|
|
291
|
+
const npmBinPath = path.join(projectRoot, 'node_modules', '.bin', 'matha');
|
|
292
|
+
if (await pathExists(npmBinPath)) {
|
|
293
|
+
return npmBinPath;
|
|
294
|
+
}
|
|
295
|
+
// Fall back to dist/index.js
|
|
296
|
+
const distPath = path.join(projectRoot, 'dist', 'index.js');
|
|
297
|
+
return distPath;
|
|
298
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@10kdevs/matha",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "The persistent cognitive layer for AI-assisted development. Gives AI agents the project context that currently only exists inside a senior engineer's head.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"bin": {
|