mcp-agent-foundry 1.2.0 → 1.3.0
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 +5 -2
- package/scripts/postinstall.js +78 -0
- package/scripts/preuninstall.js +67 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-agent-foundry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Multi-Agent AI Orchestration with Git Worktree Isolation for Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
"lint:fix": "eslint src --ext .ts --fix",
|
|
20
20
|
"typecheck": "tsc --noEmit",
|
|
21
21
|
"clean": "rm -rf dist",
|
|
22
|
-
"prepublishOnly": "npm run build"
|
|
22
|
+
"prepublishOnly": "npm run build",
|
|
23
|
+
"postinstall": "node scripts/postinstall.js",
|
|
24
|
+
"preuninstall": "node scripts/preuninstall.js"
|
|
23
25
|
},
|
|
24
26
|
"engines": {
|
|
25
27
|
"node": ">=20.0.0"
|
|
@@ -81,6 +83,7 @@
|
|
|
81
83
|
},
|
|
82
84
|
"files": [
|
|
83
85
|
"dist",
|
|
86
|
+
"scripts",
|
|
84
87
|
"config",
|
|
85
88
|
"LICENSE",
|
|
86
89
|
"README.md"
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Postinstall script for Agent Foundry
|
|
5
|
+
* Automatically registers the MCP server with Claude Code
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { execFileSync } from 'child_process';
|
|
9
|
+
|
|
10
|
+
const SERVER_NAME = 'agent-foundry';
|
|
11
|
+
|
|
12
|
+
function checkClaudeCLI() {
|
|
13
|
+
try {
|
|
14
|
+
execFileSync('claude', ['--version'], { stdio: 'ignore' });
|
|
15
|
+
return true;
|
|
16
|
+
} catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function isAlreadyRegistered() {
|
|
22
|
+
try {
|
|
23
|
+
const result = execFileSync('claude', ['mcp', 'list'], {
|
|
24
|
+
encoding: 'utf-8',
|
|
25
|
+
stdio: ['pipe', 'pipe', 'ignore']
|
|
26
|
+
});
|
|
27
|
+
// Check if agent-foundry appears in the list
|
|
28
|
+
// Output format: "agent-foundry: agent-foundry start - ..."
|
|
29
|
+
return result.includes(`${SERVER_NAME}:`);
|
|
30
|
+
} catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function registerWithClaudeCode() {
|
|
36
|
+
try {
|
|
37
|
+
execFileSync('claude', ['mcp', 'add', '-s', 'user', SERVER_NAME, '--', SERVER_NAME, 'start'], {
|
|
38
|
+
stdio: 'ignore'
|
|
39
|
+
});
|
|
40
|
+
return true;
|
|
41
|
+
} catch {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function main() {
|
|
47
|
+
// Check if Claude CLI is available
|
|
48
|
+
if (!checkClaudeCLI()) {
|
|
49
|
+
console.log('');
|
|
50
|
+
console.log('Note: Could not auto-register with Claude Code (claude CLI not found).');
|
|
51
|
+
console.log(`To manually register, run: claude mcp add --scope user ${SERVER_NAME} -- ${SERVER_NAME} start`);
|
|
52
|
+
console.log('');
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Check if already registered
|
|
57
|
+
if (isAlreadyRegistered()) {
|
|
58
|
+
console.log('');
|
|
59
|
+
console.log(`Agent Foundry is already registered with Claude Code.`);
|
|
60
|
+
console.log('');
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Register with Claude Code
|
|
65
|
+
if (registerWithClaudeCode()) {
|
|
66
|
+
console.log('');
|
|
67
|
+
console.log('\x1b[32m\u2713\x1b[0m Agent Foundry registered with Claude Code');
|
|
68
|
+
console.log(' Available in all Claude Code sessions. Restart Claude Code to activate.');
|
|
69
|
+
console.log('');
|
|
70
|
+
} else {
|
|
71
|
+
console.log('');
|
|
72
|
+
console.log('Note: Could not auto-register with Claude Code.');
|
|
73
|
+
console.log(`To manually register, run: claude mcp add --scope user ${SERVER_NAME} -- ${SERVER_NAME} start`);
|
|
74
|
+
console.log('');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
main();
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Preuninstall script for Agent Foundry
|
|
5
|
+
* Removes the MCP server registration from Claude Code
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { execFileSync } from 'child_process';
|
|
9
|
+
|
|
10
|
+
const SERVER_NAME = 'agent-foundry';
|
|
11
|
+
|
|
12
|
+
function checkClaudeCLI() {
|
|
13
|
+
try {
|
|
14
|
+
execFileSync('claude', ['--version'], { stdio: 'ignore' });
|
|
15
|
+
return true;
|
|
16
|
+
} catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function isRegistered() {
|
|
22
|
+
try {
|
|
23
|
+
const result = execFileSync('claude', ['mcp', 'list'], {
|
|
24
|
+
encoding: 'utf-8',
|
|
25
|
+
stdio: ['pipe', 'pipe', 'ignore']
|
|
26
|
+
});
|
|
27
|
+
// Check if agent-foundry appears in the list
|
|
28
|
+
// Output format: "agent-foundry: agent-foundry start - ..."
|
|
29
|
+
return result.includes(`${SERVER_NAME}:`);
|
|
30
|
+
} catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function unregisterFromClaudeCode() {
|
|
36
|
+
try {
|
|
37
|
+
execFileSync('claude', ['mcp', 'remove', '-s', 'user', SERVER_NAME], {
|
|
38
|
+
stdio: 'ignore'
|
|
39
|
+
});
|
|
40
|
+
return true;
|
|
41
|
+
} catch {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function main() {
|
|
47
|
+
// Check if Claude CLI is available
|
|
48
|
+
if (!checkClaudeCLI()) {
|
|
49
|
+
// Claude CLI not found, nothing to unregister
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Check if registered
|
|
54
|
+
if (!isRegistered()) {
|
|
55
|
+
// Not registered, nothing to do
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Unregister from Claude Code
|
|
60
|
+
if (unregisterFromClaudeCode()) {
|
|
61
|
+
console.log('');
|
|
62
|
+
console.log('\x1b[32m\u2713\x1b[0m Agent Foundry unregistered from Claude Code');
|
|
63
|
+
console.log('');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
main();
|