mcp-perplexity-pro 1.1.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 +638 -0
- package/bin/mcp-perplexity-pro +8 -0
- package/bin/mcp-perplexity-pro-stdio +9 -0
- package/dist/claude-code-bridge.d.ts +3 -0
- package/dist/claude-code-bridge.d.ts.map +1 -0
- package/dist/claude-code-bridge.js +111 -0
- package/dist/claude-code-bridge.js.map +1 -0
- package/dist/http-index.d.ts +3 -0
- package/dist/http-index.d.ts.map +1 -0
- package/dist/http-index.js +38 -0
- package/dist/http-index.js.map +1 -0
- package/dist/http-server.d.ts +33 -0
- package/dist/http-server.d.ts.map +1 -0
- package/dist/http-server.js +362 -0
- package/dist/http-server.js.map +1 -0
- package/dist/http-streaming-server.d.ts +4 -0
- package/dist/http-streaming-server.d.ts.map +1 -0
- package/dist/http-streaming-server.js +514 -0
- package/dist/http-streaming-server.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/launcher.d.ts +3 -0
- package/dist/launcher.d.ts.map +1 -0
- package/dist/launcher.js +209 -0
- package/dist/launcher.js.map +1 -0
- package/dist/mcp-server.d.ts +5 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +329 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/models.d.ts +45 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +284 -0
- package/dist/models.js.map +1 -0
- package/dist/perplexity-api.d.ts +59 -0
- package/dist/perplexity-api.d.ts.map +1 -0
- package/dist/perplexity-api.js +455 -0
- package/dist/perplexity-api.js.map +1 -0
- package/dist/port-utils.d.ts +31 -0
- package/dist/port-utils.d.ts.map +1 -0
- package/dist/port-utils.js +114 -0
- package/dist/port-utils.js.map +1 -0
- package/dist/project-manager.d.ts +91 -0
- package/dist/project-manager.d.ts.map +1 -0
- package/dist/project-manager.js +422 -0
- package/dist/project-manager.js.map +1 -0
- package/dist/simple-streaming.d.ts +26 -0
- package/dist/simple-streaming.d.ts.map +1 -0
- package/dist/simple-streaming.js +75 -0
- package/dist/simple-streaming.js.map +1 -0
- package/dist/sse-index.d.ts +3 -0
- package/dist/sse-index.d.ts.map +1 -0
- package/dist/sse-index.js +38 -0
- package/dist/sse-index.js.map +1 -0
- package/dist/sse-server.d.ts +4 -0
- package/dist/sse-server.d.ts.map +1 -0
- package/dist/sse-server.js +208 -0
- package/dist/sse-server.js.map +1 -0
- package/dist/stdio-bridge.d.ts +21 -0
- package/dist/stdio-bridge.d.ts.map +1 -0
- package/dist/stdio-bridge.js +157 -0
- package/dist/stdio-bridge.js.map +1 -0
- package/dist/stdio-server.d.ts +7 -0
- package/dist/stdio-server.d.ts.map +1 -0
- package/dist/stdio-server.js +396 -0
- package/dist/stdio-server.js.map +1 -0
- package/dist/storage.d.ts +65 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +328 -0
- package/dist/storage.js.map +1 -0
- package/dist/streaming-wrapper.d.ts +63 -0
- package/dist/streaming-wrapper.d.ts.map +1 -0
- package/dist/streaming-wrapper.js +452 -0
- package/dist/streaming-wrapper.js.map +1 -0
- package/dist/tools/async.d.ts +28 -0
- package/dist/tools/async.d.ts.map +1 -0
- package/dist/tools/async.js +167 -0
- package/dist/tools/async.js.map +1 -0
- package/dist/tools/chat.d.ts +29 -0
- package/dist/tools/chat.d.ts.map +1 -0
- package/dist/tools/chat.js +233 -0
- package/dist/tools/chat.js.map +1 -0
- package/dist/tools/projects.d.ts +19 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +219 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/query.d.ts +13 -0
- package/dist/tools/query.d.ts.map +1 -0
- package/dist/tools/query.js +178 -0
- package/dist/tools/query.js.map +1 -0
- package/dist/types.d.ts +330 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +90 -0
- package/dist/types.js.map +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createSSEServer } from './sse-server.js';
|
|
3
|
+
import { configSchema } from './types.js';
|
|
4
|
+
// Default port
|
|
5
|
+
let PORT = 8124;
|
|
6
|
+
// Parse command-line arguments for --port=XXXX
|
|
7
|
+
for (let i = 2; i < process.argv.length; i++) {
|
|
8
|
+
const arg = process.argv[i];
|
|
9
|
+
if (arg.startsWith('--port=')) {
|
|
10
|
+
const value = parseInt(arg.split('=')[1], 10);
|
|
11
|
+
if (!isNaN(value)) {
|
|
12
|
+
PORT = value;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
console.error('Invalid value for --port');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
// Load configuration
|
|
21
|
+
const config = {
|
|
22
|
+
api_key: process.env.PERPLEXITY_API_KEY || '',
|
|
23
|
+
default_model: 'sonar-reasoning-pro',
|
|
24
|
+
project_root: process.cwd(),
|
|
25
|
+
storage_path: '.perplexity',
|
|
26
|
+
};
|
|
27
|
+
// Validate configuration
|
|
28
|
+
const validatedConfig = configSchema.parse(config);
|
|
29
|
+
const app = createSSEServer(validatedConfig);
|
|
30
|
+
app.listen(PORT, () => {
|
|
31
|
+
console.log(`MCP Perplexity SSE Server listening on port ${PORT}`);
|
|
32
|
+
console.log(`Claude Code can connect using: claude mcp add --transport sse perplexity-sse http://localhost:${PORT}/sse`);
|
|
33
|
+
});
|
|
34
|
+
process.on('SIGINT', () => {
|
|
35
|
+
console.log('Shutting down SSE server...');
|
|
36
|
+
process.exit(0);
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=sse-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse-index.js","sourceRoot":"","sources":["../src/sse-index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,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AAiG,IAAI,MAAM,CAC5G,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;IACxB,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse-server.d.ts","sourceRoot":"","sources":["../src/sse-server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI1C,wBAAgB,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,+CA8NnE"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
import { handleAskPerplexity, handleResearchPerplexity } from './tools/query.js';
|
|
6
|
+
import { getModelSummary } from './models.js';
|
|
7
|
+
export function createSSEServer(config) {
|
|
8
|
+
const server = new Server({
|
|
9
|
+
name: 'mcp-perplexity-pro',
|
|
10
|
+
version: '1.0.0',
|
|
11
|
+
}, {
|
|
12
|
+
capabilities: {
|
|
13
|
+
tools: {},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
// List available tools
|
|
17
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
18
|
+
tools: [
|
|
19
|
+
{
|
|
20
|
+
name: 'ask_perplexity',
|
|
21
|
+
description: 'Query Perplexity with automatic model selection based on complexity.',
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
query: { type: 'string', description: 'Your question or prompt' },
|
|
26
|
+
project_name: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
description: 'Project name for organizing conversations (auto-detected if not provided)',
|
|
29
|
+
},
|
|
30
|
+
model: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
enum: [
|
|
33
|
+
'sonar',
|
|
34
|
+
'sonar-pro',
|
|
35
|
+
'sonar-reasoning',
|
|
36
|
+
'sonar-reasoning-pro',
|
|
37
|
+
'sonar-deep-research',
|
|
38
|
+
],
|
|
39
|
+
description: 'Override default model',
|
|
40
|
+
},
|
|
41
|
+
temperature: {
|
|
42
|
+
type: 'number',
|
|
43
|
+
minimum: 0,
|
|
44
|
+
maximum: 1,
|
|
45
|
+
description: '0.0-1.0, default 0.2',
|
|
46
|
+
},
|
|
47
|
+
max_tokens: { type: 'number', minimum: 1, description: 'Maximum response length' },
|
|
48
|
+
search_domain_filter: {
|
|
49
|
+
type: 'array',
|
|
50
|
+
items: { type: 'string' },
|
|
51
|
+
description: 'Limit search to specific domains',
|
|
52
|
+
},
|
|
53
|
+
return_images: { type: 'boolean', description: 'Include images in response' },
|
|
54
|
+
return_related_questions: {
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
description: 'Include related questions',
|
|
57
|
+
},
|
|
58
|
+
save_report: {
|
|
59
|
+
type: 'boolean',
|
|
60
|
+
description: 'Save response as a report to project directory',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
required: ['query'],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'research_perplexity',
|
|
68
|
+
description: 'Conduct comprehensive research using sonar-deep-research model.',
|
|
69
|
+
inputSchema: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
properties: {
|
|
72
|
+
topic: { type: 'string', description: 'Research topic or question' },
|
|
73
|
+
project_name: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
description: 'Project name for organizing research reports (auto-detected if not provided)',
|
|
76
|
+
},
|
|
77
|
+
save_report: { type: 'boolean', description: 'Save report to project directory' },
|
|
78
|
+
model: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
enum: [
|
|
81
|
+
'sonar',
|
|
82
|
+
'sonar-pro',
|
|
83
|
+
'sonar-reasoning',
|
|
84
|
+
'sonar-reasoning-pro',
|
|
85
|
+
'sonar-deep-research',
|
|
86
|
+
],
|
|
87
|
+
description: 'Override default model (defaults to sonar-deep-research)',
|
|
88
|
+
},
|
|
89
|
+
max_tokens: { type: 'number', minimum: 1, description: 'Maximum response length' },
|
|
90
|
+
},
|
|
91
|
+
required: ['topic'],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'model_info_perplexity',
|
|
96
|
+
description: 'Get detailed information about available Perplexity models.',
|
|
97
|
+
inputSchema: {
|
|
98
|
+
type: 'object',
|
|
99
|
+
properties: {},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
}));
|
|
104
|
+
// Handle tool calls
|
|
105
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
106
|
+
const { name, arguments: args } = request.params;
|
|
107
|
+
try {
|
|
108
|
+
switch (name) {
|
|
109
|
+
case 'ask_perplexity': {
|
|
110
|
+
const result = await handleAskPerplexity(args, config);
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
case 'research_perplexity': {
|
|
114
|
+
const result = await handleResearchPerplexity(args, config);
|
|
115
|
+
return {
|
|
116
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
case 'model_info_perplexity': {
|
|
120
|
+
const modelInfo = {
|
|
121
|
+
available_models: getModelSummary(),
|
|
122
|
+
default_model: config.default_model,
|
|
123
|
+
automatic_selection: 'Enabled - models selected based on query complexity and requirements',
|
|
124
|
+
override_capability: 'All tools accept optional "model" parameter to override automatic selection',
|
|
125
|
+
selection_factors: [
|
|
126
|
+
'Query complexity and length',
|
|
127
|
+
'Keywords indicating specific needs (research, analysis, etc.)',
|
|
128
|
+
'Task type (facts vs reasoning vs research)',
|
|
129
|
+
'Performance vs cost trade-offs',
|
|
130
|
+
],
|
|
131
|
+
};
|
|
132
|
+
return {
|
|
133
|
+
content: [{ type: 'text', text: JSON.stringify(modelInfo, null, 2) }],
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
default:
|
|
137
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
return {
|
|
142
|
+
content: [
|
|
143
|
+
{
|
|
144
|
+
type: 'text',
|
|
145
|
+
text: `Error: ${error instanceof Error ? error.message : String(error)}`,
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
isError: true,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
const app = express();
|
|
153
|
+
app.use(express.json());
|
|
154
|
+
// Add logging middleware
|
|
155
|
+
app.use((req, res, next) => {
|
|
156
|
+
console.log(`${new Date().toISOString()} - ${req.method} ${req.url}`);
|
|
157
|
+
next();
|
|
158
|
+
});
|
|
159
|
+
const transportMap = new Map();
|
|
160
|
+
// OAuth endpoints for Claude Code compatibility
|
|
161
|
+
app.post('/oauth/register', (req, res) => {
|
|
162
|
+
console.log('OAuth register request received:', req.body);
|
|
163
|
+
// Mock OAuth dynamic client registration
|
|
164
|
+
res.json({
|
|
165
|
+
client_id: 'perplexity-sse-client',
|
|
166
|
+
client_secret: 'mock-secret',
|
|
167
|
+
authorization_endpoint: `http://localhost:8124/oauth/authorize`,
|
|
168
|
+
token_endpoint: `http://localhost:8124/oauth/token`,
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
app.get('/oauth/authorize', (req, res) => {
|
|
172
|
+
// Mock OAuth authorization - auto-approve for local development
|
|
173
|
+
const { redirect_uri, state } = req.query;
|
|
174
|
+
res.redirect(`${redirect_uri}?code=mock-auth-code&state=${state}`);
|
|
175
|
+
});
|
|
176
|
+
app.post('/oauth/token', (req, res) => {
|
|
177
|
+
// Mock OAuth token exchange
|
|
178
|
+
res.json({
|
|
179
|
+
access_token: 'mock-access-token',
|
|
180
|
+
token_type: 'Bearer',
|
|
181
|
+
expires_in: 3600,
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
// SSE endpoint for real-time streaming
|
|
185
|
+
app.get('/sse', async (req, res) => {
|
|
186
|
+
const transport = new SSEServerTransport('/messages', res);
|
|
187
|
+
transportMap.set(transport.sessionId, transport);
|
|
188
|
+
await server.connect(transport);
|
|
189
|
+
});
|
|
190
|
+
// Messages endpoint for handling POST requests
|
|
191
|
+
app.post('/messages', (req, res) => {
|
|
192
|
+
const sessionId = req.query.sessionId;
|
|
193
|
+
if (!sessionId) {
|
|
194
|
+
console.error('Message received without sessionId');
|
|
195
|
+
res.status(400).json({ error: 'sessionId is required' });
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const transport = transportMap.get(sessionId);
|
|
199
|
+
if (transport) {
|
|
200
|
+
transport.handlePostMessage(req, res);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
res.status(404).json({ error: 'Session not found' });
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
return app;
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=sse-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse-server.js","sourceRoot":"","sources":["../src/sse-server.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAGnG,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,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ACvD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Stdio-HTTP Bridge for Claude Desktop
|
|
4
|
+
*
|
|
5
|
+
* This bridge provides stdio compatibility for Claude Desktop while using
|
|
6
|
+
* our modern HTTP transport internally. Best of both worlds:
|
|
7
|
+
* - Claude Desktop gets the stdio interface it expects
|
|
8
|
+
* - We use HTTP transport internally (future-proof, not deprecated)
|
|
9
|
+
* - Single codebase supports both transports
|
|
10
|
+
*/
|
|
11
|
+
export declare class StdioHttpBridge {
|
|
12
|
+
private httpPort;
|
|
13
|
+
private httpServerProcess;
|
|
14
|
+
private server;
|
|
15
|
+
constructor();
|
|
16
|
+
start(): Promise<void>;
|
|
17
|
+
private startHttpServer;
|
|
18
|
+
private waitForHttpServer;
|
|
19
|
+
private setupMcpHandlers;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=stdio-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio-bridge.d.ts","sourceRoot":"","sources":["../src/stdio-bridge.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG;AAaH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,iBAAiB,CAAa;IACtC,OAAO,CAAC,MAAM,CAAS;;IAoBjB,KAAK;YAYG,eAAe;YAqCf,iBAAiB;IAwB/B,OAAO,CAAC,gBAAgB;CA+CzB"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Stdio-HTTP Bridge for Claude Desktop
|
|
4
|
+
*
|
|
5
|
+
* This bridge provides stdio compatibility for Claude Desktop while using
|
|
6
|
+
* our modern HTTP transport internally. Best of both worlds:
|
|
7
|
+
* - Claude Desktop gets the stdio interface it expects
|
|
8
|
+
* - We use HTTP transport internally (future-proof, not deprecated)
|
|
9
|
+
* - Single codebase supports both transports
|
|
10
|
+
*/
|
|
11
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
12
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
13
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
14
|
+
import { spawn } from 'child_process';
|
|
15
|
+
import { join, dirname } from 'path';
|
|
16
|
+
import { fileURLToPath } from 'url';
|
|
17
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
+
const __dirname = dirname(__filename);
|
|
19
|
+
const projectRoot = dirname(__dirname);
|
|
20
|
+
export class StdioHttpBridge {
|
|
21
|
+
httpPort = 8125;
|
|
22
|
+
httpServerProcess = null;
|
|
23
|
+
server;
|
|
24
|
+
constructor() {
|
|
25
|
+
// Create MCP server with stdio transport
|
|
26
|
+
this.server = new Server({
|
|
27
|
+
name: 'mcp-perplexity-pro',
|
|
28
|
+
version: '1.0.0',
|
|
29
|
+
}, {
|
|
30
|
+
capabilities: {
|
|
31
|
+
tools: {},
|
|
32
|
+
progress: true,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
this.setupMcpHandlers();
|
|
36
|
+
}
|
|
37
|
+
async start() {
|
|
38
|
+
// Start HTTP server in background
|
|
39
|
+
await this.startHttpServer();
|
|
40
|
+
// Wait for HTTP server to be ready
|
|
41
|
+
await this.waitForHttpServer();
|
|
42
|
+
// Connect MCP server with stdio transport
|
|
43
|
+
const transport = new StdioServerTransport();
|
|
44
|
+
await this.server.connect(transport);
|
|
45
|
+
}
|
|
46
|
+
async startHttpServer() {
|
|
47
|
+
const launcherPath = join(projectRoot, 'dist', 'launcher.js');
|
|
48
|
+
this.httpServerProcess = spawn('node', [launcherPath, `--http-port=${this.httpPort}`], {
|
|
49
|
+
stdio: ['ignore', 'pipe', 'pipe'], // Capture output to prevent stdio pollution
|
|
50
|
+
env: { ...process.env },
|
|
51
|
+
cwd: projectRoot,
|
|
52
|
+
});
|
|
53
|
+
this.httpServerProcess.on('error', (error) => {
|
|
54
|
+
console.error(`HTTP server failed: ${error}`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
});
|
|
57
|
+
this.httpServerProcess.on('exit', (code) => {
|
|
58
|
+
if (code !== 0) {
|
|
59
|
+
console.error(`HTTP server exited with code ${code}`);
|
|
60
|
+
process.exit(code || 1);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
// Graceful shutdown
|
|
64
|
+
process.on('SIGINT', () => {
|
|
65
|
+
if (this.httpServerProcess) {
|
|
66
|
+
this.httpServerProcess.kill('SIGINT');
|
|
67
|
+
}
|
|
68
|
+
process.exit(0);
|
|
69
|
+
});
|
|
70
|
+
process.on('SIGTERM', () => {
|
|
71
|
+
if (this.httpServerProcess) {
|
|
72
|
+
this.httpServerProcess.kill('SIGTERM');
|
|
73
|
+
}
|
|
74
|
+
process.exit(0);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
async waitForHttpServer() {
|
|
78
|
+
const maxAttempts = 30; // 15 seconds
|
|
79
|
+
let attempts = 0;
|
|
80
|
+
while (attempts < maxAttempts) {
|
|
81
|
+
try {
|
|
82
|
+
const response = await fetch(`http://localhost:${this.httpPort}/health`);
|
|
83
|
+
if (response.ok) {
|
|
84
|
+
const health = await response.json();
|
|
85
|
+
if (health.status === 'healthy') {
|
|
86
|
+
return; // Server is ready
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
// Server not ready yet
|
|
92
|
+
}
|
|
93
|
+
attempts++;
|
|
94
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
95
|
+
}
|
|
96
|
+
throw new Error('HTTP server failed to start within 15 seconds');
|
|
97
|
+
}
|
|
98
|
+
setupMcpHandlers() {
|
|
99
|
+
// List tools - proxy to HTTP server
|
|
100
|
+
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
101
|
+
try {
|
|
102
|
+
const response = await fetch(`http://localhost:${this.httpPort}/api/tools`, {
|
|
103
|
+
method: 'GET',
|
|
104
|
+
headers: { 'Content-Type': 'application/json' },
|
|
105
|
+
});
|
|
106
|
+
if (!response.ok) {
|
|
107
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
108
|
+
}
|
|
109
|
+
const tools = await response.json();
|
|
110
|
+
return { tools };
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
throw new Error(`Failed to list tools: ${error}`);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
// Call tool - proxy to HTTP server
|
|
117
|
+
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
118
|
+
const { name, arguments: args } = request.params;
|
|
119
|
+
try {
|
|
120
|
+
const response = await fetch(`http://localhost:${this.httpPort}/api/tools/${name}`, {
|
|
121
|
+
method: 'POST',
|
|
122
|
+
headers: { 'Content-Type': 'application/json' },
|
|
123
|
+
body: JSON.stringify(args),
|
|
124
|
+
});
|
|
125
|
+
if (!response.ok) {
|
|
126
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
127
|
+
}
|
|
128
|
+
const result = await response.json();
|
|
129
|
+
return {
|
|
130
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
return {
|
|
135
|
+
content: [{ type: 'text', text: `Error: ${error}` }],
|
|
136
|
+
isError: true,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// Start the bridge
|
|
143
|
+
async function main() {
|
|
144
|
+
try {
|
|
145
|
+
const bridge = new StdioHttpBridge();
|
|
146
|
+
await bridge.start();
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
console.error(`Bridge startup failed: ${error}`);
|
|
150
|
+
process.exit(1);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
main().catch(error => {
|
|
154
|
+
console.error(`Bridge error: ${error}`);
|
|
155
|
+
process.exit(1);
|
|
156
|
+
});
|
|
157
|
+
//# sourceMappingURL=stdio-bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio-bridge.js","sourceRoot":"","sources":["../src/stdio-bridge.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACnG,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACtC,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEvC,MAAM,OAAO,eAAe;IAClB,QAAQ,GAAG,IAAI,CAAC;IAChB,iBAAiB,GAAQ,IAAI,CAAC;IAC9B,MAAM,CAAS;IAEvB;QACE,yCAAyC;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CACtB;YACE,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,OAAO;SACjB,EACD;YACE,YAAY,EAAE;gBACZ,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,IAAI;aACf;SACF,CACF,CAAC;QAEF,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,KAAK;Q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