@stacksfinder/mcp-server 1.3.4 → 1.3.5
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/http.d.ts +7 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +81 -0
- package/dist/http.js.map +1 -0
- package/package.json +1 -1
package/dist/http.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":";AAEA;;;GAGG"}
|
package/dist/http.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* HTTP entry point for Smithery hosted deployments.
|
|
4
|
+
* Uses StreamableHTTPServerTransport instead of stdio.
|
|
5
|
+
*/
|
|
6
|
+
import { createServer as createHttpServer } from 'node:http';
|
|
7
|
+
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
8
|
+
import { createServer } from './server.js';
|
|
9
|
+
import { loadConfig } from './utils/config.js';
|
|
10
|
+
import { setDebug, info, error } from './utils/logger.js';
|
|
11
|
+
const PORT = parseInt(process.env.PORT || '3000', 10);
|
|
12
|
+
async function main() {
|
|
13
|
+
// Load configuration
|
|
14
|
+
const config = loadConfig();
|
|
15
|
+
// Enable debug logging if configured
|
|
16
|
+
if (config.debug) {
|
|
17
|
+
setDebug(true);
|
|
18
|
+
info('Debug logging enabled');
|
|
19
|
+
}
|
|
20
|
+
// Create HTTP server
|
|
21
|
+
const httpServer = createHttpServer(async (req, res) => {
|
|
22
|
+
// Health check endpoint
|
|
23
|
+
if (req.method === 'GET' && req.url === '/health') {
|
|
24
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
25
|
+
res.end(JSON.stringify({ status: 'ok', version: '1.3.4' }));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// MCP endpoint
|
|
29
|
+
if (req.method === 'POST' && req.url === '/mcp') {
|
|
30
|
+
try {
|
|
31
|
+
// Parse JSON body
|
|
32
|
+
let body = '';
|
|
33
|
+
for await (const chunk of req) {
|
|
34
|
+
body += chunk;
|
|
35
|
+
}
|
|
36
|
+
const jsonBody = JSON.parse(body);
|
|
37
|
+
// Create fresh server and transport per request
|
|
38
|
+
const server = createServer();
|
|
39
|
+
const transport = new StreamableHTTPServerTransport({
|
|
40
|
+
sessionIdGenerator: undefined,
|
|
41
|
+
enableJsonResponse: true
|
|
42
|
+
});
|
|
43
|
+
// Clean up on response finish
|
|
44
|
+
res.on('finish', () => {
|
|
45
|
+
transport.close();
|
|
46
|
+
server.close();
|
|
47
|
+
});
|
|
48
|
+
// Connect and handle request
|
|
49
|
+
await server.connect(transport);
|
|
50
|
+
await transport.handleRequest(req, res, jsonBody);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
error('Error handling MCP request', err);
|
|
54
|
+
if (!res.headersSent) {
|
|
55
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
56
|
+
res.end(JSON.stringify({
|
|
57
|
+
jsonrpc: '2.0',
|
|
58
|
+
error: {
|
|
59
|
+
code: -32603,
|
|
60
|
+
message: 'Internal server error'
|
|
61
|
+
},
|
|
62
|
+
id: null
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
// 404 for other routes
|
|
69
|
+
res.writeHead(404, { 'Content-Type': 'application/json' });
|
|
70
|
+
res.end(JSON.stringify({ error: 'Not found' }));
|
|
71
|
+
});
|
|
72
|
+
httpServer.listen(PORT, '0.0.0.0', () => {
|
|
73
|
+
info(`StacksFinder MCP HTTP Server running on port ${PORT}`);
|
|
74
|
+
info('POST /mcp for MCP requests, GET /health for health checks');
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
main().catch((err) => {
|
|
78
|
+
console.error('Fatal error:', err);
|
|
79
|
+
process.exit(1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AAE,uBAAuB;yBAChC;wBACD,EAAE,EAAE,IAAI;qBACR,CAAC,CACF,CAAC;gBACH,CAAC;YACF,CAAC;YACD,OAAO;QACR,CAAC;QAED,uBAAuB;QACvB,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC;QAC3D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE;QACvC,IAAI,CAAC,gDAAgD,IAAI,EAAE,CAAC,CAAC;QAC7D,IAAI,CAAC,2DAA2D,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACpB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksfinder/mcp-server",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "23 tools for deterministic tech stack recommendations, technology comparison, blueprint generation, technical debt audits, project estimation, MCP compatibility checking, and project kit. No hallucinations, just data.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|