@tiangong-lca/mcp-server 0.0.6 → 0.0.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/dist/src/_shared/init_server_http.js +17 -0
- package/dist/src/index_server.js +6 -1
- package/package.json +2 -2
- package/dist/src/_shared/olca.proto +0 -1870
- package/dist/src/_shared/services.proto +0 -342
- package/dist/src/tools/_shared/olca.proto +0 -1870
- package/dist/src/tools/_shared/services.proto +0 -342
- package/dist/src/tools/openlca.js +0 -46
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { regBomCalculationTool } from '../tools/bom_calculation.js';
|
|
3
|
+
import { regFlowSearchTool } from '../tools/flow_hybrid_search.js';
|
|
4
|
+
import { regProcessSearchTool } from '../tools/process_hybrid_search.js';
|
|
5
|
+
export function initializeServer(bearerKey) {
|
|
6
|
+
const server = new McpServer({
|
|
7
|
+
name: 'TianGong-LCA-MCP-Server',
|
|
8
|
+
version: '1.0.0',
|
|
9
|
+
});
|
|
10
|
+
regFlowSearchTool(server, bearerKey);
|
|
11
|
+
regProcessSearchTool(server, bearerKey);
|
|
12
|
+
regBomCalculationTool(server);
|
|
13
|
+
return server;
|
|
14
|
+
}
|
|
15
|
+
export function getServer(bearerKey) {
|
|
16
|
+
return initializeServer(bearerKey);
|
|
17
|
+
}
|
package/dist/src/index_server.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
3
3
|
import express from 'express';
|
|
4
4
|
import { authenticateRequest } from './_shared/auth_middleware.js';
|
|
5
|
-
import { getServer } from './_shared/
|
|
5
|
+
import { getServer } from './_shared/init_server_http.js';
|
|
6
6
|
const authenticateBearer = async (req, res, next) => {
|
|
7
7
|
const authHeader = req.headers.authorization;
|
|
8
8
|
if (!authHeader || !authHeader.startsWith('Bearer ')) {
|
|
@@ -84,6 +84,11 @@ app.delete('/mcp', async (req, res) => {
|
|
|
84
84
|
id: null,
|
|
85
85
|
}));
|
|
86
86
|
});
|
|
87
|
+
app.get('/health', async (req, res) => {
|
|
88
|
+
res.status(200).json({
|
|
89
|
+
status: 'ok',
|
|
90
|
+
});
|
|
91
|
+
});
|
|
87
92
|
const PORT = Number(process.env.PORT ?? 9278);
|
|
88
93
|
const HOST = process.env.HOST ?? '0.0.0.0';
|
|
89
94
|
app.listen(PORT, HOST, () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiangong-lca/mcp-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "TianGong LCA MCP Server",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Nan LI",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
28
28
|
"@supabase/supabase-js": "^2.50.0",
|
|
29
29
|
"@upstash/redis": "^1.35.0",
|
|
30
|
-
"zod": "^3.25.
|
|
30
|
+
"zod": "^3.25.57"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@modelcontextprotocol/inspector": "^0.14.0",
|