@tiangong-lca/mcp-server 0.0.14 → 0.0.15

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.
@@ -6,7 +6,7 @@ import { regFlowSearchTool } from '../tools/flow_hybrid_search.js';
6
6
  import { regLcaCalculationGuidanceTool } from '../tools/lca_calculation_guidance.js';
7
7
  import { regOpenLcaLciaTool } from '../tools/openlca_ipc_lcia.js';
8
8
  import { regOpenLcaListLCIAMethodsTool } from '../tools/openlca_ipc_lcia_methods_list.js';
9
- import { regOpenLcaListSystemProcessTool } from '../tools/openlca_ipc_process_list.js';
9
+ import { regOpenLcaListProductSystemsTool } from '../tools/openlca_ipc_process_list.js';
10
10
  import { regProcessSearchTool } from '../tools/process_hybrid_search.js';
11
11
  export function initializeServer(bearerKey) {
12
12
  const server = new McpServer({
@@ -17,7 +17,7 @@ export function initializeServer(bearerKey) {
17
17
  regProcessSearchTool(server, bearerKey);
18
18
  regBomCalculationTool(server);
19
19
  regOpenLcaLciaTool(server);
20
- regOpenLcaListSystemProcessTool(server);
20
+ regOpenLcaListProductSystemsTool(server);
21
21
  regOpenLcaListLCIAMethodsTool(server);
22
22
  regOpenLcaPrompts(server);
23
23
  regOpenLcaResources(server);
@@ -3,7 +3,7 @@ import { regOpenLcaPrompts } from '../prompts/lca_calculation.js';
3
3
  import { regOpenLcaResources } from '../resources/lca_calculation.js';
4
4
  import { regOpenLcaLciaTool } from '../tools/openlca_ipc_lcia.js';
5
5
  import { regOpenLcaListLCIAMethodsTool } from '../tools/openlca_ipc_lcia_methods_list.js';
6
- import { regOpenLcaListSystemProcessTool } from '../tools/openlca_ipc_process_list.js';
6
+ import { regOpenLcaListProductSystemsTool } from '../tools/openlca_ipc_process_list.js';
7
7
  export function initializeServer() {
8
8
  const server = new McpServer({
9
9
  name: 'TianGong-LCA-MCP-Server',
@@ -11,7 +11,7 @@ export function initializeServer() {
11
11
  });
12
12
  regOpenLcaLciaTool(server);
13
13
  regOpenLcaListLCIAMethodsTool(server);
14
- regOpenLcaListSystemProcessTool(server);
14
+ regOpenLcaListProductSystemsTool(server);
15
15
  regOpenLcaPrompts(server);
16
16
  regOpenLcaResources(server);
17
17
  return server;
@@ -9,7 +9,7 @@ export function regOpenLcaPrompts(server) {
9
9
  text: `I am an expert in Life Cycle Assessment (LCA) and use the MCP tool to perform LCA calculations.
10
10
  The workflow is as follows:
11
11
  1. Use the OpenLCA_Impact_Assessment_Tool to list all LCIA (Life Cycle Impact Assessment) method UUIDs and their corresponding names.
12
- 2. Use the OpenLCA_List_System_Processes_Tool to list all system process UUIDs and their corresponding names.
12
+ 2. Use the OpenLCA_List_Product_Systems_Tool to list all product system UUIDs and their corresponding names.
13
13
  3. Use the OpenLCA_Impact_Assessment_Tool to perform LCA calculations.`,
14
14
  },
15
15
  },
@@ -7,7 +7,7 @@ export function regOpenLcaResources(server) {
7
7
  mimeType: 'text/plain',
8
8
  text: `The workflow to perform LCA calculations using the MCP tool is as follows:
9
9
  1. Use the OpenLCA_Impact_Assessment_Tool to list all LCIA (Life Cycle Impact Assessment) method UUIDs and their corresponding names.
10
- 2. Use the OpenLCA_List_System_Processes_Tool to list all system process UUIDs and their corresponding names.
10
+ 2. Use the OpenLCA_List_Product_Systems_Tool to list all product system UUIDs and their corresponding names.
11
11
  3. Use the OpenLCA_Impact_Assessment_Tool to perform LCA calculations.`,
12
12
  },
13
13
  ],
@@ -1,7 +1,7 @@
1
1
  async function getLcaCalculationGuidance() {
2
2
  const prompt = `The workflow to perform LCA calculations using the MCP tool is as follows:
3
3
  1. Use the OpenLCA_Impact_Assessment_Tool to list all LCIA (Life Cycle Impact Assessment) method UUIDs and their corresponding names.
4
- 2. Use the OpenLCA_List_System_Processes_Tool to list all system process UUIDs and their corresponding names.
4
+ 2. Use the OpenLCA_List_Product_Systems_Tool to list all product system UUIDs and their corresponding names.
5
5
  3. Use the OpenLCA_Impact_Assessment_Tool to perform LCA calculations.`;
6
6
  return prompt;
7
7
  }
@@ -1,27 +1,27 @@
1
1
  import * as o from 'olca-ipc';
2
2
  import { z } from 'zod';
3
3
  const input_schema = {
4
- systemProcess: z.string().min(1).describe('OpenLCA product system ID'),
4
+ productSystem: z.string().min(1).describe('OpenLCA product system ID'),
5
5
  impactMethod: z.string().min(1).describe('OpenLCA impact method ID'),
6
6
  serverUrl: z.string().default('http://localhost:8080').describe('OpenLCA IPC server URL'),
7
7
  };
8
- async function calculateLcaImpacts({ systemProcess, impactMethod, serverUrl = 'http://localhost:8080', }) {
9
- if (!systemProcess) {
10
- throw new Error('No systemProcess provided');
8
+ async function calculateLcaImpacts({ productSystem, impactMethod, serverUrl = 'http://localhost:8080', }) {
9
+ if (!productSystem) {
10
+ throw new Error('No productSystem provided');
11
11
  }
12
12
  if (!impactMethod) {
13
13
  throw new Error('No impactMethod provided');
14
14
  }
15
15
  const client = o.IpcClient.on(serverUrl);
16
- const selectedSystemProcess = await client.get(o.RefType.ProductSystem, systemProcess);
17
- if (!selectedSystemProcess)
16
+ const selectedProductSystem = await client.get(o.RefType.ProductSystem, productSystem);
17
+ if (!selectedProductSystem)
18
18
  throw new Error('Product system not found');
19
19
  const selectedMethod = await client.get(o.RefType.ImpactMethod, impactMethod);
20
20
  if (!selectedMethod)
21
21
  throw new Error('Impact method not found');
22
22
  console.log('Calculating LCA impacts...');
23
23
  const setup = o.CalculationSetup.of({
24
- target: selectedSystemProcess,
24
+ target: selectedProductSystem,
25
25
  impactMethod: selectedMethod,
26
26
  });
27
27
  const result = await client.calculate(setup);
@@ -39,9 +39,9 @@ async function calculateLcaImpacts({ systemProcess, impactMethod, serverUrl = 'h
39
39
  return JSON.stringify(resultsObj);
40
40
  }
41
41
  export function regOpenLcaLciaTool(server) {
42
- server.tool('OpenLCA_Impact_Assessment_Tool', 'Calculate life cycle impact assessment using OpenLCA.', input_schema, async ({ systemProcess, impactMethod, serverUrl }) => {
42
+ server.tool('OpenLCA_Impact_Assessment_Tool', 'Calculate life cycle impact assessment using OpenLCA.', input_schema, async ({ productSystem, impactMethod, serverUrl }) => {
43
43
  const result = await calculateLcaImpacts({
44
- systemProcess: systemProcess,
44
+ productSystem: productSystem,
45
45
  impactMethod: impactMethod,
46
46
  serverUrl: serverUrl,
47
47
  });
@@ -3,13 +3,13 @@ import { z } from 'zod';
3
3
  const input_schema = {
4
4
  serverUrl: z.string().default('http://localhost:8080').describe('OpenLCA IPC server URL'),
5
5
  };
6
- async function listSystemProcesses({ serverUrl = 'http://localhost:8080', }) {
6
+ async function listProductSystems({ serverUrl = 'http://localhost:8080', }) {
7
7
  const client = o.IpcClient.on(serverUrl);
8
- const systemProcesses = await client.getDescriptors(o.RefType.ProductSystem);
9
- if (systemProcesses.length === 0) {
8
+ const productSystems = await client.getDescriptors(o.RefType.ProductSystem);
9
+ if (productSystems.length === 0) {
10
10
  throw new Error('No product systems found');
11
11
  }
12
- const resultsObj = systemProcesses.map((sys) => {
12
+ const resultsObj = productSystems.map((sys) => {
13
13
  const result = {
14
14
  id: sys.id,
15
15
  category: sys.category,
@@ -30,9 +30,9 @@ async function listSystemProcesses({ serverUrl = 'http://localhost:8080', }) {
30
30
  });
31
31
  return JSON.stringify(resultsObj);
32
32
  }
33
- export function regOpenLcaListSystemProcessTool(server) {
34
- server.tool('OpenLCA_List_System_Processes_Tool', 'List all system processes using OpenLCA.', input_schema, async ({ serverUrl }) => {
35
- const result = await listSystemProcesses({
33
+ export function regOpenLcaListProductSystemsTool(server) {
34
+ server.tool('OpenLCA_List_Product_Systems_Tool', 'List all product systems using OpenLCA.', input_schema, async ({ serverUrl }) => {
35
+ const result = await listProductSystems({
36
36
  serverUrl: serverUrl,
37
37
  });
38
38
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiangong-lca/mcp-server",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "TianGong LCA MCP Server",
5
5
  "license": "MIT",
6
6
  "author": "Nan LI",
@@ -22,11 +22,13 @@
22
22
  "start": "npm run build && npx dotenv -e .env -- npx @modelcontextprotocol/inspector node dist/src/index.js",
23
23
  "start:server": "npm run build && concurrently \"npx dotenv -e .env -- node dist/src/index_server.js\" \"DANGEROUSLY_OMIT_AUTH=true npx @modelcontextprotocol/inspector\"",
24
24
  "start:server-local": "npm run build && concurrently \"npx dotenv -e .env -- node dist/src/index_server_local.js\" \"DANGEROUSLY_OMIT_AUTH=true npx @modelcontextprotocol/inspector\"",
25
- "lint": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\""
25
+ "lint": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"",
26
+ "ncu": "npx npm-check-updates",
27
+ "ncu:update": "npx npm-check-updates -u"
26
28
  },
27
29
  "dependencies": {
28
- "@modelcontextprotocol/sdk": "^1.17.1",
29
- "@supabase/supabase-js": "^2.53.0",
30
+ "@modelcontextprotocol/sdk": "^1.17.4",
31
+ "@supabase/supabase-js": "^2.56.0",
30
32
  "@types/express": "^5.0.3",
31
33
  "@upstash/redis": "^1.35.3",
32
34
  "aws-jwt-verify": "^5.1.0",
@@ -34,12 +36,13 @@
34
36
  "zod": "^3.25.76"
35
37
  },
36
38
  "devDependencies": {
37
- "@modelcontextprotocol/inspector": "^0.16.2",
38
- "dotenv-cli": "^8.0.0",
39
+ "@modelcontextprotocol/inspector": "^0.16.5",
40
+ "dotenv-cli": "^10.0.0",
41
+ "npm-check-updates": "^18.0.2",
39
42
  "prettier": "^3.6.2",
40
- "prettier-plugin-organize-imports": "^4.1.0",
43
+ "prettier-plugin-organize-imports": "^4.2.0",
41
44
  "shx": "^0.4.0",
42
- "tsx": "^4.20.3",
43
- "typescript": "^5.8.3"
45
+ "tsx": "^4.20.5",
46
+ "typescript": "^5.9.2"
44
47
  }
45
48
  }