agent-consultation-mcp 1.1.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/README.md +26 -12
- package/dist/index.js +31 -67
- package/dist/index.js.map +1 -1
- package/dist/installer/detector.d.ts +48 -0
- package/dist/installer/detector.js +164 -0
- package/dist/installer/detector.js.map +1 -0
- package/dist/installer/index.d.ts +7 -0
- package/dist/installer/index.js +10 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/installer/installer.d.ts +16 -0
- package/dist/installer/installer.js +253 -0
- package/dist/installer/installer.js.map +1 -0
- package/dist/installer/tools.d.ts +16 -0
- package/dist/installer/tools.js +327 -0
- package/dist/installer/tools.js.map +1 -0
- package/dist/installer/types.d.ts +68 -0
- package/dist/installer/types.js +5 -0
- package/dist/installer/types.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,40 +4,54 @@ An MCP (Model Context Protocol) server that allows AI agents like Claude Code to
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
+
- **Multi-Tool Auto-Install**: Automatically detects and configures MCP for Claude Code, Cursor, Windsurf, Cline, Continue, Zed, and more
|
|
7
8
|
- **Multi-Provider Support**: DeepSeek (Reasoner, Chat) and OpenAI (GPT-5.2, GPT-5.2 Pro)
|
|
8
9
|
- **Specialized Consultation Modes**: Debug, Code Analysis, Architecture Review, Plan Validation, Concept Explanation
|
|
9
10
|
- **Conversation Management**: Continue multi-turn conversations with context
|
|
10
11
|
- **Web UI**: Configure providers and API keys through a browser interface
|
|
11
12
|
- **Encrypted Storage**: API keys are encrypted at rest
|
|
12
13
|
|
|
13
|
-
## Quick Start (
|
|
14
|
+
## Quick Start (2 steps)
|
|
14
15
|
|
|
15
16
|
```bash
|
|
16
|
-
# 1. Auto-install to
|
|
17
|
+
# 1. Auto-install to all detected AI tools
|
|
17
18
|
npx agent-consultation-mcp --install
|
|
18
19
|
|
|
19
|
-
# 2.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# 3. Done! Start using in Claude Code
|
|
20
|
+
# 2. Configure your API key in the Web UI that opens automatically
|
|
21
|
+
# Done! Restart your AI tools and start using
|
|
23
22
|
```
|
|
24
23
|
|
|
25
24
|
## Installation
|
|
26
25
|
|
|
27
26
|
### Auto-Install (Recommended)
|
|
28
27
|
|
|
29
|
-
Automatically
|
|
28
|
+
Automatically detects installed AI tools and configures MCP for each:
|
|
30
29
|
|
|
31
30
|
```bash
|
|
32
31
|
npx agent-consultation-mcp --install
|
|
33
32
|
```
|
|
34
33
|
|
|
35
34
|
This will:
|
|
36
|
-
-
|
|
37
|
-
- Add
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
- Scan for installed AI tools (Claude Code, Cursor, Windsurf, OpenCode, VSCode Copilot, Cline, Continue, Zed, Roo Code)
|
|
36
|
+
- Add MCP configuration to each detected tool
|
|
37
|
+
- Open the Web UI to configure your API key
|
|
38
|
+
- Show which tools need to be restarted
|
|
39
|
+
|
|
40
|
+
### Supported AI Tools
|
|
41
|
+
|
|
42
|
+
| Tool | Config Location |
|
|
43
|
+
|------|-----------------|
|
|
44
|
+
| Claude Code | `~/.claude/mcp.json` |
|
|
45
|
+
| Cursor | `~/.cursor/mcp.json` |
|
|
46
|
+
| Windsurf | `~/.codeium/windsurf/mcp_config.json` |
|
|
47
|
+
| OpenCode | `~/.config/opencode/opencode.json` |
|
|
48
|
+
| VSCode Copilot | `~/Library/Application Support/Code/User/mcp.json` |
|
|
49
|
+
| Cline | VSCode globalStorage |
|
|
50
|
+
| Continue | `~/.continue/config.json` |
|
|
51
|
+
| Zed | `~/.config/zed/settings.json` |
|
|
52
|
+
| Roo Code | VSCode globalStorage |
|
|
53
|
+
|
|
54
|
+
### Manual Installation (Claude Code)
|
|
41
55
|
|
|
42
56
|
Add to `~/.claude/mcp.json`:
|
|
43
57
|
|
package/dist/index.js
CHANGED
|
@@ -2,69 +2,12 @@
|
|
|
2
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import * as fs from 'fs';
|
|
6
|
-
import * as path from 'path';
|
|
7
|
-
import * as os from 'os';
|
|
8
5
|
import { getConfigManager, CONSULTATION_MODES } from './config/index.js';
|
|
9
6
|
import { logger } from './utils/index.js';
|
|
10
7
|
import { consultAgent, continueConversation, endConversation, } from './server/index.js';
|
|
11
8
|
import { initializeProviders } from './providers/index.js';
|
|
12
9
|
import { startConfigUI, openWebUI } from './api/index.js';
|
|
13
|
-
|
|
14
|
-
* Get Claude Code MCP settings file path
|
|
15
|
-
*/
|
|
16
|
-
function getClaudeMcpPath() {
|
|
17
|
-
const homeDir = os.homedir();
|
|
18
|
-
return path.join(homeDir, '.claude', 'mcp.json');
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Install MCP to Claude Code settings
|
|
22
|
-
*/
|
|
23
|
-
async function installMcp() {
|
|
24
|
-
const mcpPath = getClaudeMcpPath();
|
|
25
|
-
const claudeDir = path.dirname(mcpPath);
|
|
26
|
-
console.log('🔧 Installing Agent Consultation MCP...\n');
|
|
27
|
-
// Create .claude directory if it doesn't exist
|
|
28
|
-
if (!fs.existsSync(claudeDir)) {
|
|
29
|
-
console.log(`Creating ${claudeDir}...`);
|
|
30
|
-
fs.mkdirSync(claudeDir, { recursive: true });
|
|
31
|
-
}
|
|
32
|
-
// Read existing config or create new one
|
|
33
|
-
let config = {};
|
|
34
|
-
if (fs.existsSync(mcpPath)) {
|
|
35
|
-
try {
|
|
36
|
-
const content = fs.readFileSync(mcpPath, 'utf-8');
|
|
37
|
-
config = JSON.parse(content);
|
|
38
|
-
console.log('Found existing mcp.json');
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
console.log('Creating new mcp.json');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
// Initialize mcpServers if not present
|
|
45
|
-
if (!config.mcpServers) {
|
|
46
|
-
config.mcpServers = {};
|
|
47
|
-
}
|
|
48
|
-
// Check if already installed
|
|
49
|
-
if (config.mcpServers['agent-consultation']) {
|
|
50
|
-
console.log('✅ Agent Consultation MCP is already installed!\n');
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
// Add MCP configuration
|
|
54
|
-
config.mcpServers['agent-consultation'] = {
|
|
55
|
-
command: 'npx',
|
|
56
|
-
args: ['-y', 'agent-consultation-mcp'],
|
|
57
|
-
};
|
|
58
|
-
// Write config
|
|
59
|
-
fs.writeFileSync(mcpPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
60
|
-
console.log('✅ Added agent-consultation to mcp.json\n');
|
|
61
|
-
}
|
|
62
|
-
console.log('📍 Config location:', mcpPath);
|
|
63
|
-
console.log('\n🚀 Next steps:');
|
|
64
|
-
console.log(' 1. Restart Claude Code to load the MCP');
|
|
65
|
-
console.log(' 2. Run: npx agent-consultation-mcp --config');
|
|
66
|
-
console.log(' 3. Add your DeepSeek API key in the web UI\n');
|
|
67
|
-
}
|
|
10
|
+
import { installToAllTools, printInstallSummary, SUPPORTED_TOOLS } from './installer/index.js';
|
|
68
11
|
/**
|
|
69
12
|
* Parse CLI arguments
|
|
70
13
|
*/
|
|
@@ -90,26 +33,30 @@ function parseArgs() {
|
|
|
90
33
|
}
|
|
91
34
|
// Check for help
|
|
92
35
|
if (args.includes('--help') || args.includes('-h')) {
|
|
36
|
+
const toolNames = SUPPORTED_TOOLS.map((t) => t.name).join(', ');
|
|
93
37
|
console.log(`
|
|
94
38
|
Agent Consultation MCP - Get second opinions from DeepSeek Reasoner
|
|
95
39
|
|
|
96
40
|
Usage:
|
|
97
41
|
npx agent-consultation-mcp Start MCP server (stdio transport)
|
|
98
|
-
npx agent-consultation-mcp --install Auto-install to
|
|
42
|
+
npx agent-consultation-mcp --install Auto-detect & install to all AI tools
|
|
99
43
|
npx agent-consultation-mcp --config Open configuration UI in browser
|
|
100
44
|
npx agent-consultation-mcp --help Show this help message
|
|
101
45
|
|
|
102
46
|
Options:
|
|
103
|
-
--install, -i Auto-add MCP to
|
|
47
|
+
--install, -i Auto-detect installed AI tools and add MCP to each
|
|
104
48
|
--config, -c Open configuration UI to manage API keys
|
|
105
49
|
--port <number>, -p Set port for config UI (default: 3456)
|
|
106
50
|
--help, -h Show this help message
|
|
107
51
|
|
|
52
|
+
Supported AI Tools:
|
|
53
|
+
${toolNames}
|
|
54
|
+
|
|
108
55
|
Quick Start:
|
|
109
|
-
1. npx agent-consultation-mcp --install
|
|
110
|
-
2. Restart
|
|
111
|
-
3. npx agent-consultation-mcp --config
|
|
112
|
-
4.
|
|
56
|
+
1. npx agent-consultation-mcp --install (auto-detects all tools)
|
|
57
|
+
2. Restart your AI tools to load the MCP
|
|
58
|
+
3. npx agent-consultation-mcp --config (configure API key)
|
|
59
|
+
4. Start using in any configured tool!
|
|
113
60
|
|
|
114
61
|
Supported Models:
|
|
115
62
|
- deepseek-reasoner (default) - Deep reasoning for complex tasks
|
|
@@ -133,10 +80,27 @@ Consultation Modes:
|
|
|
133
80
|
*/
|
|
134
81
|
async function main() {
|
|
135
82
|
const { mode, port } = parseArgs();
|
|
136
|
-
// Install mode -
|
|
83
|
+
// Install mode - auto-detect and install to all tools
|
|
137
84
|
if (mode === 'install') {
|
|
138
|
-
|
|
139
|
-
|
|
85
|
+
console.log('🔧 Agent Consultation MCP - Multi-Tool Installer\n');
|
|
86
|
+
console.log('Scanning for installed AI tools...\n');
|
|
87
|
+
const summary = installToAllTools();
|
|
88
|
+
printInstallSummary(summary);
|
|
89
|
+
// If any tools were installed, offer to open config UI
|
|
90
|
+
if (summary.installed.length > 0 || summary.skipped.length > 0) {
|
|
91
|
+
console.log('Opening configuration UI...\n');
|
|
92
|
+
try {
|
|
93
|
+
await startConfigUI({ openBrowser: true });
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
console.log('💡 Run "npx agent-consultation-mcp --config" to configure API keys.\n');
|
|
97
|
+
process.exit(0);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
process.exit(0);
|
|
102
|
+
}
|
|
103
|
+
return;
|
|
140
104
|
}
|
|
141
105
|
// Config UI mode
|
|
142
106
|
if (mode === 'config') {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE/F;;GAEG;AACH,SAAS,SAAS;IAChB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEnC,yBAAyB;IACzB,IAAI,IAAI,CAAC,QAAQ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AAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE;qBAC3E;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;IAEF,gCAAgC;IAChC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;AAChD,CAAC;AAED,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;IACxB,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;IACzB,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,MAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE;QACzC,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;KAChE,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool detection utilities for multi-tool installer
|
|
3
|
+
*/
|
|
4
|
+
import { ToolDefinition, DetectedTool, Platform } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Get current platform
|
|
7
|
+
*/
|
|
8
|
+
export declare function getPlatform(): Platform;
|
|
9
|
+
/**
|
|
10
|
+
* Get full config path for a tool
|
|
11
|
+
*/
|
|
12
|
+
export declare function getConfigPath(tool: ToolDefinition): string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Check if a binary exists in PATH using execFileSync (safe from injection)
|
|
15
|
+
*/
|
|
16
|
+
export declare function binaryExists(binaryName: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Check if a directory exists
|
|
19
|
+
*/
|
|
20
|
+
export declare function directoryExists(dirPath: string, relativePath?: boolean): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a file exists
|
|
23
|
+
*/
|
|
24
|
+
export declare function fileExists(filePath: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Check if MCP is already installed in config
|
|
27
|
+
*/
|
|
28
|
+
export declare function isMcpInstalled(configPath: string, mcpKey: string, serverName: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Detect if a specific tool is installed
|
|
31
|
+
*/
|
|
32
|
+
export declare function detectTool(tool: ToolDefinition): DetectedTool;
|
|
33
|
+
/**
|
|
34
|
+
* Detect all installed tools
|
|
35
|
+
*/
|
|
36
|
+
export declare function detectAllTools(): DetectedTool[];
|
|
37
|
+
/**
|
|
38
|
+
* Get only installed tools
|
|
39
|
+
*/
|
|
40
|
+
export declare function getInstalledTools(): DetectedTool[];
|
|
41
|
+
/**
|
|
42
|
+
* Get tools that need MCP installation
|
|
43
|
+
*/
|
|
44
|
+
export declare function getToolsNeedingInstallation(): DetectedTool[];
|
|
45
|
+
/**
|
|
46
|
+
* Get tools where MCP is already installed
|
|
47
|
+
*/
|
|
48
|
+
export declare function getToolsWithMcpInstalled(): DetectedTool[];
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool detection utilities for multi-tool installer
|
|
3
|
+
*/
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
import * as os from 'os';
|
|
7
|
+
import { execFileSync } from 'child_process';
|
|
8
|
+
import { SUPPORTED_TOOLS } from './tools.js';
|
|
9
|
+
/**
|
|
10
|
+
* Get current platform
|
|
11
|
+
*/
|
|
12
|
+
export function getPlatform() {
|
|
13
|
+
const platform = process.platform;
|
|
14
|
+
if (platform === 'darwin' || platform === 'win32' || platform === 'linux') {
|
|
15
|
+
return platform;
|
|
16
|
+
}
|
|
17
|
+
// Default to linux for other Unix-like systems
|
|
18
|
+
return 'linux';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get full config path for a tool
|
|
22
|
+
*/
|
|
23
|
+
export function getConfigPath(tool) {
|
|
24
|
+
const platform = getPlatform();
|
|
25
|
+
const configPath = tool.configPaths[platform];
|
|
26
|
+
if (!configPath) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
if (configPath.relative) {
|
|
30
|
+
return path.join(os.homedir(), configPath.path);
|
|
31
|
+
}
|
|
32
|
+
return configPath.path;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Check if a binary exists in PATH using execFileSync (safe from injection)
|
|
36
|
+
*/
|
|
37
|
+
export function binaryExists(binaryName) {
|
|
38
|
+
try {
|
|
39
|
+
const command = process.platform === 'win32' ? 'where' : 'which';
|
|
40
|
+
// Using execFileSync is safe - binaryName is passed as argument, not shell-interpolated
|
|
41
|
+
execFileSync(command, [binaryName], { stdio: 'ignore' });
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Check if a directory exists
|
|
50
|
+
*/
|
|
51
|
+
export function directoryExists(dirPath, relativePath = true) {
|
|
52
|
+
const fullPath = relativePath ? path.join(os.homedir(), dirPath) : dirPath;
|
|
53
|
+
try {
|
|
54
|
+
return fs.existsSync(fullPath) && fs.statSync(fullPath).isDirectory();
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Check if a file exists
|
|
62
|
+
*/
|
|
63
|
+
export function fileExists(filePath) {
|
|
64
|
+
try {
|
|
65
|
+
return fs.existsSync(filePath) && fs.statSync(filePath).isFile();
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get nested value from object using dot notation
|
|
73
|
+
*/
|
|
74
|
+
function getNestedValue(obj, keyPath) {
|
|
75
|
+
const keys = keyPath.split('.');
|
|
76
|
+
let current = obj;
|
|
77
|
+
for (const key of keys) {
|
|
78
|
+
if (current === null || typeof current !== 'object') {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
current = current[key];
|
|
82
|
+
}
|
|
83
|
+
return current;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Check if MCP is already installed in config
|
|
87
|
+
*/
|
|
88
|
+
export function isMcpInstalled(configPath, mcpKey, serverName) {
|
|
89
|
+
try {
|
|
90
|
+
if (!fileExists(configPath)) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
const content = fs.readFileSync(configPath, 'utf-8');
|
|
94
|
+
const config = JSON.parse(content);
|
|
95
|
+
const mcpServers = getNestedValue(config, mcpKey);
|
|
96
|
+
if (!mcpServers || typeof mcpServers !== 'object') {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
return serverName in mcpServers;
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Detect if a specific tool is installed
|
|
107
|
+
*/
|
|
108
|
+
export function detectTool(tool) {
|
|
109
|
+
const platform = getPlatform();
|
|
110
|
+
const configPathObj = tool.configPaths[platform];
|
|
111
|
+
const configPath = getConfigPath(tool);
|
|
112
|
+
// Check if tool is installed
|
|
113
|
+
let installed = false;
|
|
114
|
+
// Check binary
|
|
115
|
+
if (tool.detection.binary) {
|
|
116
|
+
installed = installed || binaryExists(tool.detection.binary);
|
|
117
|
+
}
|
|
118
|
+
// Check directory
|
|
119
|
+
if (tool.detection.directory) {
|
|
120
|
+
installed = installed || directoryExists(tool.detection.directory);
|
|
121
|
+
}
|
|
122
|
+
// Check config file (for extensions without binary)
|
|
123
|
+
if (tool.detection.configFile && configPath) {
|
|
124
|
+
installed = installed || fileExists(configPath);
|
|
125
|
+
}
|
|
126
|
+
// Check config existence
|
|
127
|
+
const configExists = configPath ? fileExists(configPath) : false;
|
|
128
|
+
// Check if MCP already installed
|
|
129
|
+
const mcpAlreadyInstalled = configPath && configPathObj
|
|
130
|
+
? isMcpInstalled(configPath, configPathObj.mcpKey, tool.mcpConfig.serverName)
|
|
131
|
+
: false;
|
|
132
|
+
return {
|
|
133
|
+
tool,
|
|
134
|
+
installed,
|
|
135
|
+
configExists,
|
|
136
|
+
mcpAlreadyInstalled,
|
|
137
|
+
configPath: configPath || '',
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Detect all installed tools
|
|
142
|
+
*/
|
|
143
|
+
export function detectAllTools() {
|
|
144
|
+
return SUPPORTED_TOOLS.map(detectTool);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get only installed tools
|
|
148
|
+
*/
|
|
149
|
+
export function getInstalledTools() {
|
|
150
|
+
return detectAllTools().filter((t) => t.installed);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Get tools that need MCP installation
|
|
154
|
+
*/
|
|
155
|
+
export function getToolsNeedingInstallation() {
|
|
156
|
+
return detectAllTools().filter((t) => t.installed && !t.mcpAlreadyInstalled);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Get tools where MCP is already installed
|
|
160
|
+
*/
|
|
161
|
+
export function getToolsWithMcpInstalled() {
|
|
162
|
+
return detectAllTools().filter((t) => t.installed && t.mcpAlreadyInstalled);
|
|
163
|
+
}
|
|
164
|
+
//# source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AAC9E,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-tool MCP installer module
|
|
3
|
+
*/
|
|
4
|
+
export type { Platform, ToolConfigPath, ToolDefinition, DetectedTool, InstallResult, InstallSummary, } from './types.js';
|
|
5
|
+
export { SUPPORTED_TOOLS, getToolById, getToolIds } from './tools.js';
|
|
6
|
+
export { getPlatform, getConfigPath, binaryExists, directoryExists, fileExists, isMcpInstalled, detectTool, detectAllTools, getInstalledTools, getToolsNeedingInstallation, getToolsWithMcpInstalled, } from './detector.js';
|
|
7
|
+
export { installToTool, installToAllTools, printInstallSummary } from './installer.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-tool MCP installer module
|
|
3
|
+
*/
|
|
4
|
+
// Tool definitions
|
|
5
|
+
export { SUPPORTED_TOOLS, getToolById, getToolIds } from './tools.js';
|
|
6
|
+
// Detection utilities
|
|
7
|
+
export { getPlatform, getConfigPath, binaryExists, directoryExists, fileExists, isMcpInstalled, detectTool, detectAllTools, getInstalledTools, getToolsNeedingInstallation, getToolsWithMcpInstalled, } from './detector.js';
|
|
8
|
+
// Installation functions
|
|
9
|
+
export { installToTool, installToAllTools, printInstallSummary } from './installer.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/installer/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,mBAAmB;AACnB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEtE,sBAAsB;AACtB,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,eAAe,EACf,UAAU,EACV,cAAc,EACd,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,eAAe,CAAC;AAEvB,yBAAyB;AACzB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-tool MCP installer
|
|
3
|
+
*/
|
|
4
|
+
import { DetectedTool, InstallResult, InstallSummary } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Install MCP to a specific tool
|
|
7
|
+
*/
|
|
8
|
+
export declare function installToTool(detected: DetectedTool): InstallResult;
|
|
9
|
+
/**
|
|
10
|
+
* Install MCP to all detected tools
|
|
11
|
+
*/
|
|
12
|
+
export declare function installToAllTools(): InstallSummary;
|
|
13
|
+
/**
|
|
14
|
+
* Print installation summary to console
|
|
15
|
+
*/
|
|
16
|
+
export declare function printInstallSummary(summary: InstallSummary): void;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-tool MCP installer
|
|
3
|
+
*/
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
import { detectAllTools, getConfigPath, getPlatform, fileExists, } from './detector.js';
|
|
7
|
+
/**
|
|
8
|
+
* Set nested value in object using dot notation
|
|
9
|
+
*/
|
|
10
|
+
function setNestedValue(obj, keyPath, key, value) {
|
|
11
|
+
const keys = keyPath.split('.');
|
|
12
|
+
let current = obj;
|
|
13
|
+
// Navigate to the parent object, creating intermediate objects as needed
|
|
14
|
+
for (const k of keys) {
|
|
15
|
+
if (!(k in current) || typeof current[k] !== 'object' || current[k] === null) {
|
|
16
|
+
current[k] = {};
|
|
17
|
+
}
|
|
18
|
+
current = current[k];
|
|
19
|
+
}
|
|
20
|
+
// Set the value
|
|
21
|
+
current[key] = value;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get nested value from object using dot notation
|
|
25
|
+
*/
|
|
26
|
+
function getNestedValue(obj, keyPath) {
|
|
27
|
+
const keys = keyPath.split('.');
|
|
28
|
+
let current = obj;
|
|
29
|
+
for (const key of keys) {
|
|
30
|
+
if (current === null || typeof current !== 'object') {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
current = current[key];
|
|
34
|
+
}
|
|
35
|
+
return current;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Create MCP server configuration object
|
|
39
|
+
*/
|
|
40
|
+
function createMcpServerConfig(tool) {
|
|
41
|
+
// Special handling for Zed (uses different format)
|
|
42
|
+
if (tool.id === 'zed') {
|
|
43
|
+
return {
|
|
44
|
+
command: tool.mcpConfig.command,
|
|
45
|
+
args: tool.mcpConfig.args,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
// Special handling for Continue (uses transport wrapper)
|
|
49
|
+
if (tool.id === 'continue') {
|
|
50
|
+
return {
|
|
51
|
+
transport: {
|
|
52
|
+
type: 'stdio',
|
|
53
|
+
command: tool.mcpConfig.command,
|
|
54
|
+
args: tool.mcpConfig.args,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
// Special handling for OpenCode (uses type, command as array, enabled)
|
|
59
|
+
if (tool.id === 'opencode') {
|
|
60
|
+
return {
|
|
61
|
+
type: 'local',
|
|
62
|
+
command: [tool.mcpConfig.command, ...tool.mcpConfig.args],
|
|
63
|
+
enabled: true,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
// Special handling for VSCode Copilot (uses type: stdio)
|
|
67
|
+
if (tool.id === 'vscode-copilot') {
|
|
68
|
+
return {
|
|
69
|
+
type: 'stdio',
|
|
70
|
+
command: tool.mcpConfig.command,
|
|
71
|
+
args: tool.mcpConfig.args,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
// Standard format for most tools
|
|
75
|
+
return {
|
|
76
|
+
command: tool.mcpConfig.command,
|
|
77
|
+
args: tool.mcpConfig.args,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Install MCP to a specific tool
|
|
82
|
+
*/
|
|
83
|
+
export function installToTool(detected) {
|
|
84
|
+
const { tool } = detected;
|
|
85
|
+
const configPath = getConfigPath(tool);
|
|
86
|
+
if (!configPath) {
|
|
87
|
+
return {
|
|
88
|
+
tool,
|
|
89
|
+
success: false,
|
|
90
|
+
message: `No config path for platform ${getPlatform()}`,
|
|
91
|
+
error: 'Platform not supported',
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const platform = getPlatform();
|
|
95
|
+
const configPathObj = tool.configPaths[platform];
|
|
96
|
+
if (!configPathObj) {
|
|
97
|
+
return {
|
|
98
|
+
tool,
|
|
99
|
+
success: false,
|
|
100
|
+
message: `No config path for platform ${platform}`,
|
|
101
|
+
error: 'Platform not supported',
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
try {
|
|
105
|
+
// Ensure directory exists
|
|
106
|
+
const configDir = path.dirname(configPath);
|
|
107
|
+
if (!fs.existsSync(configDir)) {
|
|
108
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
109
|
+
}
|
|
110
|
+
// Read existing config or create new one
|
|
111
|
+
let config = {};
|
|
112
|
+
if (fileExists(configPath)) {
|
|
113
|
+
try {
|
|
114
|
+
const content = fs.readFileSync(configPath, 'utf-8');
|
|
115
|
+
config = JSON.parse(content);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
// If parse fails, start with empty config
|
|
119
|
+
config = {};
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// Check if already installed
|
|
123
|
+
const mcpServers = getNestedValue(config, configPathObj.mcpKey);
|
|
124
|
+
if (mcpServers &&
|
|
125
|
+
typeof mcpServers === 'object' &&
|
|
126
|
+
tool.mcpConfig.serverName in mcpServers) {
|
|
127
|
+
return {
|
|
128
|
+
tool,
|
|
129
|
+
success: true,
|
|
130
|
+
message: 'Already installed',
|
|
131
|
+
configPath,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
// Create MCP server config
|
|
135
|
+
const serverConfig = createMcpServerConfig(tool);
|
|
136
|
+
// Add MCP to config
|
|
137
|
+
setNestedValue(config, configPathObj.mcpKey, tool.mcpConfig.serverName, serverConfig);
|
|
138
|
+
// Write config
|
|
139
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
140
|
+
return {
|
|
141
|
+
tool,
|
|
142
|
+
success: true,
|
|
143
|
+
message: tool.notes || 'Installed successfully',
|
|
144
|
+
configPath,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
return {
|
|
149
|
+
tool,
|
|
150
|
+
success: false,
|
|
151
|
+
message: 'Installation failed',
|
|
152
|
+
configPath,
|
|
153
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Install MCP to all detected tools
|
|
159
|
+
*/
|
|
160
|
+
export function installToAllTools() {
|
|
161
|
+
const allTools = detectAllTools();
|
|
162
|
+
const detected = [];
|
|
163
|
+
const installed = [];
|
|
164
|
+
const skipped = [];
|
|
165
|
+
const errors = [];
|
|
166
|
+
for (const tool of allTools) {
|
|
167
|
+
if (!tool.installed) {
|
|
168
|
+
// Tool not installed on system
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
detected.push(tool);
|
|
172
|
+
if (tool.mcpAlreadyInstalled) {
|
|
173
|
+
// MCP already installed, skip
|
|
174
|
+
skipped.push(tool);
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
// Install MCP
|
|
178
|
+
const result = installToTool(tool);
|
|
179
|
+
if (result.success) {
|
|
180
|
+
installed.push(result);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
errors.push(result);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return { detected, installed, skipped, errors };
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Print installation summary to console
|
|
190
|
+
*/
|
|
191
|
+
export function printInstallSummary(summary) {
|
|
192
|
+
console.log('\n📊 Installation Summary\n');
|
|
193
|
+
console.log('─'.repeat(50));
|
|
194
|
+
// Detected tools
|
|
195
|
+
if (summary.detected.length === 0) {
|
|
196
|
+
console.log('❌ No supported AI tools detected on this system.\n');
|
|
197
|
+
console.log('Supported tools:');
|
|
198
|
+
console.log(' - Claude Code (Anthropic CLI)');
|
|
199
|
+
console.log(' - Cursor');
|
|
200
|
+
console.log(' - Windsurf');
|
|
201
|
+
console.log(' - OpenCode');
|
|
202
|
+
console.log(' - VSCode Copilot (GitHub Copilot)');
|
|
203
|
+
console.log(' - Cline (VSCode extension)');
|
|
204
|
+
console.log(' - Continue (VSCode extension)');
|
|
205
|
+
console.log(' - Zed');
|
|
206
|
+
console.log(' - Roo Code (VSCode extension)\n');
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
console.log(`\n🔍 Detected ${summary.detected.length} tool(s):\n`);
|
|
210
|
+
for (const tool of summary.detected) {
|
|
211
|
+
const status = tool.mcpAlreadyInstalled ? '✅ (already configured)' : '📦';
|
|
212
|
+
console.log(` ${status} ${tool.tool.name}`);
|
|
213
|
+
}
|
|
214
|
+
// Installed
|
|
215
|
+
if (summary.installed.length > 0) {
|
|
216
|
+
console.log(`\n✅ Installed to ${summary.installed.length} tool(s):\n`);
|
|
217
|
+
for (const result of summary.installed) {
|
|
218
|
+
console.log(` • ${result.tool.name}`);
|
|
219
|
+
console.log(` 📍 ${result.configPath}`);
|
|
220
|
+
if (result.tool.requiresRestart) {
|
|
221
|
+
console.log(` ⚠️ ${result.message}`);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// Skipped (already installed)
|
|
226
|
+
if (summary.skipped.length > 0) {
|
|
227
|
+
console.log(`\n⏭️ Skipped ${summary.skipped.length} tool(s) (already configured):\n`);
|
|
228
|
+
for (const tool of summary.skipped) {
|
|
229
|
+
console.log(` • ${tool.tool.name}`);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
// Errors
|
|
233
|
+
if (summary.errors.length > 0) {
|
|
234
|
+
console.log(`\n❌ Failed to install to ${summary.errors.length} tool(s):\n`);
|
|
235
|
+
for (const result of summary.errors) {
|
|
236
|
+
console.log(` • ${result.tool.name}: ${result.error}`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// Next steps
|
|
240
|
+
console.log('\n' + '─'.repeat(50));
|
|
241
|
+
console.log('\n🚀 Next steps:\n');
|
|
242
|
+
const needsRestart = summary.installed.filter((r) => r.tool.requiresRestart);
|
|
243
|
+
if (needsRestart.length > 0) {
|
|
244
|
+
console.log(' 1. Restart the following tools to load the MCP:');
|
|
245
|
+
for (const result of needsRestart) {
|
|
246
|
+
console.log(` - ${result.tool.name}`);
|
|
247
|
+
}
|
|
248
|
+
console.log('');
|
|
249
|
+
}
|
|
250
|
+
console.log(' 2. Configure your API key:');
|
|
251
|
+
console.log(' npx agent-consultation-mcp --config\n');
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=installer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installer.js","sourceRoot":"","sources":["../../src/installer/installer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EACL,cAAc,EACd,aAAa,EACb,WAAW,EACX,UAAU,GACX,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,SAAS,cAAc,CACrB,GAA4B,EAC5B,OAAe,EACf,GAAW,EACX,KAAc;IAEd,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,OAAO,GAAG,GAAG,CAAC;IAElB,yEAAyE;IACzE,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,CAAC,CAAC,K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ACb,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAElC,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC7E,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;QAClE,KAAK,MAAM,MAAM,IAAI,YAAY,EAAE,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,WAAW,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool definitions for multi-tool MCP installer
|
|
3
|
+
*/
|
|
4
|
+
import { ToolDefinition } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* All supported tools with their configurations
|
|
7
|
+
*/
|
|
8
|
+
export declare const SUPPORTED_TOOLS: ToolDefinition[];
|
|
9
|
+
/**
|
|
10
|
+
* Get tool by ID
|
|
11
|
+
*/
|
|
12
|
+
export declare function getToolById(id: string): ToolDefinition | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Get all tool IDs
|
|
15
|
+
*/
|
|
16
|
+
export declare function getToolIds(): string[];
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool definitions for multi-tool MCP installer
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Default MCP configuration for agent-consultation
|
|
6
|
+
*/
|
|
7
|
+
const DEFAULT_MCP_CONFIG = {
|
|
8
|
+
serverName: 'agent-consultation',
|
|
9
|
+
command: 'npx',
|
|
10
|
+
args: ['-y', 'agent-consultation-mcp'],
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* All supported tools with their configurations
|
|
14
|
+
*/
|
|
15
|
+
export const SUPPORTED_TOOLS = [
|
|
16
|
+
// Claude Code (Official Anthropic CLI)
|
|
17
|
+
{
|
|
18
|
+
id: 'claude-code',
|
|
19
|
+
name: 'Claude Code',
|
|
20
|
+
description: 'Anthropic\'s official CLI for Claude',
|
|
21
|
+
configPaths: {
|
|
22
|
+
darwin: {
|
|
23
|
+
path: '.claude/mcp.json',
|
|
24
|
+
relative: true,
|
|
25
|
+
mcpKey: 'mcpServers',
|
|
26
|
+
format: 'json',
|
|
27
|
+
},
|
|
28
|
+
linux: {
|
|
29
|
+
path: '.claude/mcp.json',
|
|
30
|
+
relative: true,
|
|
31
|
+
mcpKey: 'mcpServers',
|
|
32
|
+
format: 'json',
|
|
33
|
+
},
|
|
34
|
+
win32: {
|
|
35
|
+
path: '.claude/mcp.json',
|
|
36
|
+
relative: true,
|
|
37
|
+
mcpKey: 'mcpServers',
|
|
38
|
+
format: 'json',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
detection: {
|
|
42
|
+
binary: 'claude',
|
|
43
|
+
directory: '.claude',
|
|
44
|
+
},
|
|
45
|
+
mcpConfig: DEFAULT_MCP_CONFIG,
|
|
46
|
+
requiresRestart: true,
|
|
47
|
+
notes: 'Restart Claude Code to load the MCP',
|
|
48
|
+
},
|
|
49
|
+
// Cursor
|
|
50
|
+
{
|
|
51
|
+
id: 'cursor',
|
|
52
|
+
name: 'Cursor',
|
|
53
|
+
description: 'AI-first code editor',
|
|
54
|
+
configPaths: {
|
|
55
|
+
darwin: {
|
|
56
|
+
path: '.cursor/mcp.json',
|
|
57
|
+
relative: true,
|
|
58
|
+
mcpKey: 'mcpServers',
|
|
59
|
+
format: 'json',
|
|
60
|
+
},
|
|
61
|
+
linux: {
|
|
62
|
+
path: '.cursor/mcp.json',
|
|
63
|
+
relative: true,
|
|
64
|
+
mcpKey: 'mcpServers',
|
|
65
|
+
format: 'json',
|
|
66
|
+
},
|
|
67
|
+
win32: {
|
|
68
|
+
path: '.cursor/mcp.json',
|
|
69
|
+
relative: true,
|
|
70
|
+
mcpKey: 'mcpServers',
|
|
71
|
+
format: 'json',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
detection: {
|
|
75
|
+
binary: 'cursor',
|
|
76
|
+
directory: '.cursor',
|
|
77
|
+
},
|
|
78
|
+
mcpConfig: DEFAULT_MCP_CONFIG,
|
|
79
|
+
requiresRestart: true,
|
|
80
|
+
notes: 'Restart Cursor to load the MCP',
|
|
81
|
+
},
|
|
82
|
+
// Windsurf (Codeium)
|
|
83
|
+
{
|
|
84
|
+
id: 'windsurf',
|
|
85
|
+
name: 'Windsurf',
|
|
86
|
+
description: 'Codeium\'s AI-powered IDE',
|
|
87
|
+
configPaths: {
|
|
88
|
+
darwin: {
|
|
89
|
+
path: '.codeium/windsurf/mcp_config.json',
|
|
90
|
+
relative: true,
|
|
91
|
+
mcpKey: 'mcpServers',
|
|
92
|
+
format: 'json',
|
|
93
|
+
},
|
|
94
|
+
linux: {
|
|
95
|
+
path: '.codeium/windsurf/mcp_config.json',
|
|
96
|
+
relative: true,
|
|
97
|
+
mcpKey: 'mcpServers',
|
|
98
|
+
format: 'json',
|
|
99
|
+
},
|
|
100
|
+
win32: {
|
|
101
|
+
path: '.codeium/windsurf/mcp_config.json',
|
|
102
|
+
relative: true,
|
|
103
|
+
mcpKey: 'mcpServers',
|
|
104
|
+
format: 'json',
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
detection: {
|
|
108
|
+
binary: 'windsurf',
|
|
109
|
+
directory: '.codeium/windsurf',
|
|
110
|
+
},
|
|
111
|
+
mcpConfig: DEFAULT_MCP_CONFIG,
|
|
112
|
+
requiresRestart: true,
|
|
113
|
+
notes: 'Restart Windsurf to load the MCP',
|
|
114
|
+
},
|
|
115
|
+
// Cline (VSCode Extension)
|
|
116
|
+
{
|
|
117
|
+
id: 'cline',
|
|
118
|
+
name: 'Cline',
|
|
119
|
+
description: 'Autonomous coding agent for VSCode',
|
|
120
|
+
configPaths: {
|
|
121
|
+
darwin: {
|
|
122
|
+
path: 'Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json',
|
|
123
|
+
relative: true,
|
|
124
|
+
mcpKey: 'mcpServers',
|
|
125
|
+
format: 'json',
|
|
126
|
+
},
|
|
127
|
+
linux: {
|
|
128
|
+
path: '.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json',
|
|
129
|
+
relative: true,
|
|
130
|
+
mcpKey: 'mcpServers',
|
|
131
|
+
format: 'json',
|
|
132
|
+
},
|
|
133
|
+
win32: {
|
|
134
|
+
path: 'AppData/Roaming/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json',
|
|
135
|
+
relative: true,
|
|
136
|
+
mcpKey: 'mcpServers',
|
|
137
|
+
format: 'json',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
detection: {
|
|
141
|
+
vscodeExtension: 'saoudrizwan.claude-dev',
|
|
142
|
+
configFile: true,
|
|
143
|
+
},
|
|
144
|
+
mcpConfig: DEFAULT_MCP_CONFIG,
|
|
145
|
+
requiresRestart: false,
|
|
146
|
+
notes: 'Reload VSCode window or restart Cline extension',
|
|
147
|
+
},
|
|
148
|
+
// Continue (VSCode/JetBrains Extension)
|
|
149
|
+
{
|
|
150
|
+
id: 'continue',
|
|
151
|
+
name: 'Continue',
|
|
152
|
+
description: 'Open-source AI code assistant',
|
|
153
|
+
configPaths: {
|
|
154
|
+
darwin: {
|
|
155
|
+
path: '.continue/config.json',
|
|
156
|
+
relative: true,
|
|
157
|
+
mcpKey: 'experimental.modelContextProtocolServers',
|
|
158
|
+
format: 'json',
|
|
159
|
+
},
|
|
160
|
+
linux: {
|
|
161
|
+
path: '.continue/config.json',
|
|
162
|
+
relative: true,
|
|
163
|
+
mcpKey: 'experimental.modelContextProtocolServers',
|
|
164
|
+
format: 'json',
|
|
165
|
+
},
|
|
166
|
+
win32: {
|
|
167
|
+
path: '.continue/config.json',
|
|
168
|
+
relative: true,
|
|
169
|
+
mcpKey: 'experimental.modelContextProtocolServers',
|
|
170
|
+
format: 'json',
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
detection: {
|
|
174
|
+
directory: '.continue',
|
|
175
|
+
vscodeExtension: 'Continue.continue',
|
|
176
|
+
},
|
|
177
|
+
mcpConfig: {
|
|
178
|
+
serverName: 'agent-consultation',
|
|
179
|
+
command: 'npx',
|
|
180
|
+
args: ['-y', 'agent-consultation-mcp'],
|
|
181
|
+
},
|
|
182
|
+
requiresRestart: false,
|
|
183
|
+
notes: 'Reload Continue extension to load the MCP',
|
|
184
|
+
},
|
|
185
|
+
// Zed
|
|
186
|
+
{
|
|
187
|
+
id: 'zed',
|
|
188
|
+
name: 'Zed',
|
|
189
|
+
description: 'High-performance code editor',
|
|
190
|
+
configPaths: {
|
|
191
|
+
darwin: {
|
|
192
|
+
path: '.config/zed/settings.json',
|
|
193
|
+
relative: true,
|
|
194
|
+
mcpKey: 'context_servers',
|
|
195
|
+
format: 'json',
|
|
196
|
+
},
|
|
197
|
+
linux: {
|
|
198
|
+
path: '.config/zed/settings.json',
|
|
199
|
+
relative: true,
|
|
200
|
+
mcpKey: 'context_servers',
|
|
201
|
+
format: 'json',
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
detection: {
|
|
205
|
+
binary: 'zed',
|
|
206
|
+
directory: '.config/zed',
|
|
207
|
+
},
|
|
208
|
+
mcpConfig: {
|
|
209
|
+
serverName: 'agent-consultation',
|
|
210
|
+
command: 'npx',
|
|
211
|
+
args: ['-y', 'agent-consultation-mcp'],
|
|
212
|
+
},
|
|
213
|
+
requiresRestart: false,
|
|
214
|
+
notes: 'Zed will auto-reload the configuration',
|
|
215
|
+
},
|
|
216
|
+
// Roo Code (VSCode Extension - Roo-Cline fork)
|
|
217
|
+
{
|
|
218
|
+
id: 'roo-code',
|
|
219
|
+
name: 'Roo Code',
|
|
220
|
+
description: 'AI coding assistant (Cline fork)',
|
|
221
|
+
configPaths: {
|
|
222
|
+
darwin: {
|
|
223
|
+
path: 'Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json',
|
|
224
|
+
relative: true,
|
|
225
|
+
mcpKey: 'mcpServers',
|
|
226
|
+
format: 'json',
|
|
227
|
+
},
|
|
228
|
+
linux: {
|
|
229
|
+
path: '.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json',
|
|
230
|
+
relative: true,
|
|
231
|
+
mcpKey: 'mcpServers',
|
|
232
|
+
format: 'json',
|
|
233
|
+
},
|
|
234
|
+
win32: {
|
|
235
|
+
path: 'AppData/Roaming/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json',
|
|
236
|
+
relative: true,
|
|
237
|
+
mcpKey: 'mcpServers',
|
|
238
|
+
format: 'json',
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
detection: {
|
|
242
|
+
vscodeExtension: 'rooveterinaryinc.roo-cline',
|
|
243
|
+
configFile: true,
|
|
244
|
+
},
|
|
245
|
+
mcpConfig: DEFAULT_MCP_CONFIG,
|
|
246
|
+
requiresRestart: false,
|
|
247
|
+
notes: 'Reload VSCode window to load the MCP',
|
|
248
|
+
},
|
|
249
|
+
// OpenCode
|
|
250
|
+
{
|
|
251
|
+
id: 'opencode',
|
|
252
|
+
name: 'OpenCode',
|
|
253
|
+
description: 'AI-powered terminal coding assistant',
|
|
254
|
+
configPaths: {
|
|
255
|
+
darwin: {
|
|
256
|
+
path: '.config/opencode/opencode.json',
|
|
257
|
+
relative: true,
|
|
258
|
+
mcpKey: 'mcp',
|
|
259
|
+
format: 'json',
|
|
260
|
+
},
|
|
261
|
+
linux: {
|
|
262
|
+
path: '.config/opencode/opencode.json',
|
|
263
|
+
relative: true,
|
|
264
|
+
mcpKey: 'mcp',
|
|
265
|
+
format: 'json',
|
|
266
|
+
},
|
|
267
|
+
win32: {
|
|
268
|
+
path: '.config/opencode/opencode.json',
|
|
269
|
+
relative: true,
|
|
270
|
+
mcpKey: 'mcp',
|
|
271
|
+
format: 'json',
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
detection: {
|
|
275
|
+
binary: 'opencode',
|
|
276
|
+
directory: '.config/opencode',
|
|
277
|
+
},
|
|
278
|
+
mcpConfig: DEFAULT_MCP_CONFIG,
|
|
279
|
+
requiresRestart: false,
|
|
280
|
+
notes: 'OpenCode will auto-detect the new MCP server',
|
|
281
|
+
},
|
|
282
|
+
// VSCode GitHub Copilot (User MCP Config)
|
|
283
|
+
{
|
|
284
|
+
id: 'vscode-copilot',
|
|
285
|
+
name: 'VSCode Copilot',
|
|
286
|
+
description: 'GitHub Copilot in Visual Studio Code',
|
|
287
|
+
configPaths: {
|
|
288
|
+
darwin: {
|
|
289
|
+
path: 'Library/Application Support/Code/User/mcp.json',
|
|
290
|
+
relative: true,
|
|
291
|
+
mcpKey: 'servers',
|
|
292
|
+
format: 'json',
|
|
293
|
+
},
|
|
294
|
+
linux: {
|
|
295
|
+
path: '.config/Code/User/mcp.json',
|
|
296
|
+
relative: true,
|
|
297
|
+
mcpKey: 'servers',
|
|
298
|
+
format: 'json',
|
|
299
|
+
},
|
|
300
|
+
win32: {
|
|
301
|
+
path: 'AppData/Roaming/Code/User/mcp.json',
|
|
302
|
+
relative: true,
|
|
303
|
+
mcpKey: 'servers',
|
|
304
|
+
format: 'json',
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
detection: {
|
|
308
|
+
configFile: true,
|
|
309
|
+
},
|
|
310
|
+
mcpConfig: DEFAULT_MCP_CONFIG,
|
|
311
|
+
requiresRestart: false,
|
|
312
|
+
notes: 'Reload VSCode window to load the MCP',
|
|
313
|
+
},
|
|
314
|
+
];
|
|
315
|
+
/**
|
|
316
|
+
* Get tool by ID
|
|
317
|
+
*/
|
|
318
|
+
export function getToolById(id) {
|
|
319
|
+
return SUPPORTED_TOOLS.find((tool) => tool.id === id);
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Get all tool IDs
|
|
323
|
+
*/
|
|
324
|
+
export function getToolIds() {
|
|
325
|
+
return SUPPORTED_TOOLS.map((tool) => tool.id);
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/installer/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,MAAM,kBAAkB,GAAG;IACzB,UAAU,EAAE,oBAAoB;IAChC,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,CAAC,IAAI,EAAE,wBAAwB,CAAC;CACvC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C,uCAAuC;IACvC;QACE,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,sCAAsC;QACnD,WAAW,EAAE;YACX,MAAM,EAAE;gBACN,IAAI,EAAE,kBAAkB;gBACxB,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,YAAY;gBACpB,MAAM,EAAE,MAAM;aACf;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,kBAAkB;gBACxB,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,YAAY;gBACpB,MAAM,EAAE,MAAM;aACf;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,kBAAkB;gBACxB,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,YAAY;gBACpB,MAAM,EAAE,MAAM;aACf;SACF;QACD,SAAS,EAAE;YAC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,MAAM;aACf;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,4BAA4B;gBAClC,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,SAAS;gBACjB,MAAM,EAAE,MAAM;aACf;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,oCAAoC;gBAC1C,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,SAAS;gBACjB,MAAM,EAAE,MAAM;aACf;SACF;QACD,SAAS,EAAE;YACT,UAAU,EAAE,IAAI;SACjB;QACD,SAAS,EAAE,kBAAkB;QAC7B,eAAe,EAAE,KAAK;QACtB,KAAK,EAAE,sCAAsC;KAC9C;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,EAAU;IACpC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool configuration types for multi-tool installer
|
|
3
|
+
*/
|
|
4
|
+
export type Platform = 'darwin' | 'win32' | 'linux';
|
|
5
|
+
export interface ToolConfigPath {
|
|
6
|
+
/** Path relative to home directory or absolute */
|
|
7
|
+
path: string;
|
|
8
|
+
/** Whether path is relative to home directory */
|
|
9
|
+
relative: boolean;
|
|
10
|
+
/** JSON key path to mcpServers object (e.g., "mcpServers" or "context_servers") */
|
|
11
|
+
mcpKey: string;
|
|
12
|
+
/** Config format */
|
|
13
|
+
format: 'json' | 'yaml';
|
|
14
|
+
}
|
|
15
|
+
export interface ToolDefinition {
|
|
16
|
+
/** Tool identifier */
|
|
17
|
+
id: string;
|
|
18
|
+
/** Display name */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Tool description */
|
|
21
|
+
description: string;
|
|
22
|
+
/** Config paths per platform */
|
|
23
|
+
configPaths: Partial<Record<Platform, ToolConfigPath>>;
|
|
24
|
+
/** Detection methods */
|
|
25
|
+
detection: {
|
|
26
|
+
/** Check if binary exists in PATH */
|
|
27
|
+
binary?: string;
|
|
28
|
+
/** Check if directory exists (relative to home) */
|
|
29
|
+
directory?: string;
|
|
30
|
+
/** Check if config file exists */
|
|
31
|
+
configFile?: boolean;
|
|
32
|
+
/** VSCode extension ID to check */
|
|
33
|
+
vscodeExtension?: string;
|
|
34
|
+
};
|
|
35
|
+
/** MCP server configuration to add */
|
|
36
|
+
mcpConfig: {
|
|
37
|
+
/** Server name in config */
|
|
38
|
+
serverName: string;
|
|
39
|
+
/** Command to run */
|
|
40
|
+
command: string;
|
|
41
|
+
/** Command arguments */
|
|
42
|
+
args: string[];
|
|
43
|
+
};
|
|
44
|
+
/** Whether tool requires restart after installation */
|
|
45
|
+
requiresRestart: boolean;
|
|
46
|
+
/** Installation notes/instructions */
|
|
47
|
+
notes?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface DetectedTool {
|
|
50
|
+
tool: ToolDefinition;
|
|
51
|
+
installed: boolean;
|
|
52
|
+
configExists: boolean;
|
|
53
|
+
mcpAlreadyInstalled: boolean;
|
|
54
|
+
configPath: string;
|
|
55
|
+
}
|
|
56
|
+
export interface InstallResult {
|
|
57
|
+
tool: ToolDefinition;
|
|
58
|
+
success: boolean;
|
|
59
|
+
message: string;
|
|
60
|
+
configPath?: string;
|
|
61
|
+
error?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface InstallSummary {
|
|
64
|
+
detected: DetectedTool[];
|
|
65
|
+
installed: InstallResult[];
|
|
66
|
+
skipped: DetectedTool[];
|
|
67
|
+
errors: InstallResult[];
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/installer/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/package.json
CHANGED