claude-autopm 1.13.6 ā 1.13.8
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/install/install.js +46 -0
- package/package.json +1 -1
- package/scripts/mcp-handler.js +12 -1
package/install/install.js
CHANGED
|
@@ -42,6 +42,7 @@ class Installer {
|
|
|
42
42
|
'.claude/checklists',
|
|
43
43
|
'.claude/strategies',
|
|
44
44
|
'.claude/mcp',
|
|
45
|
+
'.claude/mcp-servers.json',
|
|
45
46
|
'.claude/.env.example',
|
|
46
47
|
'.claude/teams.json',
|
|
47
48
|
'.claude-code'
|
|
@@ -774,6 +775,48 @@ See: https://github.com/rafeekpro/ClaudeAutoPM
|
|
|
774
775
|
return processedContent;
|
|
775
776
|
}
|
|
776
777
|
|
|
778
|
+
setupMCPIntegration() {
|
|
779
|
+
const mcpServersPath = path.join(this.targetDir, '.claude', 'mcp-servers.json');
|
|
780
|
+
const configPath = path.join(this.targetDir, '.claude', 'config.json');
|
|
781
|
+
|
|
782
|
+
// Check if MCP servers configuration exists
|
|
783
|
+
if (!fs.existsSync(mcpServersPath)) {
|
|
784
|
+
return; // No MCP configuration, skip
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
try {
|
|
788
|
+
// Read config to check for active servers
|
|
789
|
+
let hasActiveServers = false;
|
|
790
|
+
if (fs.existsSync(configPath)) {
|
|
791
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
792
|
+
hasActiveServers = config.mcp?.activeServers?.length > 0;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
// Read mcp-servers.json to check for any configured servers
|
|
796
|
+
const mcpConfig = JSON.parse(fs.readFileSync(mcpServersPath, 'utf8'));
|
|
797
|
+
const hasServers = Object.keys(mcpConfig.mcpServers || {}).length > 0;
|
|
798
|
+
|
|
799
|
+
if (hasServers) {
|
|
800
|
+
this.printStep('Setting up Claude Code MCP integration...');
|
|
801
|
+
|
|
802
|
+
// Create .mcp.json for Claude Code
|
|
803
|
+
const mcpJsonPath = path.join(this.targetDir, '.mcp.json');
|
|
804
|
+
const claudeCodeConfig = {
|
|
805
|
+
mcpServers: mcpConfig.mcpServers
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
fs.writeFileSync(mcpJsonPath, JSON.stringify(claudeCodeConfig, null, 2));
|
|
809
|
+
this.printSuccess('.mcp.json created for Claude Code');
|
|
810
|
+
|
|
811
|
+
if (!hasActiveServers) {
|
|
812
|
+
this.printMsg('CYAN', 'š” Tip: Run "autopm mcp enable <server>" to activate servers');
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
} catch (error) {
|
|
816
|
+
this.printWarning(`Could not setup MCP integration: ${error.message}`);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
|
|
777
820
|
async setupGitHooks() {
|
|
778
821
|
const gitDir = path.join(this.targetDir, '.git');
|
|
779
822
|
if (!fs.existsSync(gitDir)) {
|
|
@@ -852,6 +895,9 @@ See: https://github.com/rafeekpro/ClaudeAutoPM
|
|
|
852
895
|
// Install CLAUDE.md
|
|
853
896
|
this.installClaudeMd();
|
|
854
897
|
|
|
898
|
+
// Setup MCP integration for Claude Code
|
|
899
|
+
this.setupMCPIntegration();
|
|
900
|
+
|
|
855
901
|
// Setup git hooks if requested
|
|
856
902
|
if (this.options.setupHooks) {
|
|
857
903
|
await this.setupGitHooks();
|
package/package.json
CHANGED
package/scripts/mcp-handler.js
CHANGED
|
@@ -277,13 +277,24 @@ class MCPHandler {
|
|
|
277
277
|
console.log(` ā
Synced: ${serverName}`);
|
|
278
278
|
});
|
|
279
279
|
|
|
280
|
-
// Write configuration
|
|
280
|
+
// Write configuration to .claude/mcp-servers.json (AutoPM format)
|
|
281
281
|
fs.writeFileSync(
|
|
282
282
|
this.mcpServersPath,
|
|
283
283
|
JSON.stringify(mcpConfig, null, 2)
|
|
284
284
|
);
|
|
285
285
|
|
|
286
|
+
// Write configuration to .mcp.json (Claude Code format)
|
|
287
|
+
const claudeCodeMcpPath = path.join(this.projectRoot, '.mcp.json');
|
|
288
|
+
const claudeCodeConfig = {
|
|
289
|
+
mcpServers: mcpConfig.mcpServers
|
|
290
|
+
};
|
|
291
|
+
fs.writeFileSync(
|
|
292
|
+
claudeCodeMcpPath,
|
|
293
|
+
JSON.stringify(claudeCodeConfig, null, 2)
|
|
294
|
+
);
|
|
295
|
+
|
|
286
296
|
console.log(`\nā
Configuration synced to ${this.mcpServersPath}`);
|
|
297
|
+
console.log(`ā
Claude Code config synced to ${claudeCodeMcpPath}`);
|
|
287
298
|
console.log(`š Active servers: ${activeServers.length}`);
|
|
288
299
|
console.log(`š¦ Total servers in file: ${Object.keys(mcpConfig.mcpServers).length}`);
|
|
289
300
|
}
|