@tiangong-lca/mcp-server 0.0.21 → 0.0.23

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 { regLcaCalculationGuidanceTool } from '../tools/lca_calculation_guidance
6
6
  import { regLifecycleModelSearchTool } from '../tools/life_cycle_model_hybrid_search.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 { regOpenLcaListProductSystemsTool } from '../tools/openlca_ipc_process_list.js';
9
+ import { regOpenLcaListSystemProcessesTool } from '../tools/openlca_ipc_system_processes_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
  regLifecycleModelSearchTool(server, bearerKey);
19
19
  regOpenLcaLciaTool(server);
20
- regOpenLcaListProductSystemsTool(server);
20
+ regOpenLcaListSystemProcessesTool(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 { regOpenLcaListProductSystemsTool } from '../tools/openlca_ipc_process_list.js';
6
+ import { regOpenLcaListSystemProcessesTool } from '../tools/openlca_ipc_system_processes_list.js';
7
7
  import { regTidasValidationTool } from '../tools/tidas_data_validation.js';
8
8
  export function initializeServer() {
9
9
  const server = new McpServer({
@@ -12,7 +12,7 @@ export function initializeServer() {
12
12
  });
13
13
  regOpenLcaLciaTool(server);
14
14
  regOpenLcaListLCIAMethodsTool(server);
15
- regOpenLcaListProductSystemsTool(server);
15
+ regOpenLcaListSystemProcessesTool(server);
16
16
  regTidasValidationTool(server);
17
17
  regOpenLcaPrompts(server);
18
18
  regOpenLcaResources(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_Product_Systems_Tool to list all product system UUIDs and their corresponding names.
12
+ 2. Use the OpenLCA_List_System_Processes_Tool to list all system process 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_Product_Systems_Tool to list all product system UUIDs and their corresponding names.
10
+ 2. Use the OpenLCA_List_System_Processes_Tool to list all system process 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_Product_Systems_Tool to list all product system UUIDs and their corresponding names.
4
+ 2. Use the OpenLCA_List_System_Processes_Tool to list all system process UUIDs and their corresponding names.
5
5
  3. Use the OpenLCA_Impact_Assessment_Tool to perform LCA calculations.`;
6
6
  return prompt;
7
7
  }
@@ -3,13 +3,14 @@ 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 listProductSystems({ serverUrl = 'http://localhost:8080', }) {
6
+ async function listSystemProcesses({ serverUrl = 'http://localhost:8080', }) {
7
7
  const client = o.IpcClient.on(serverUrl);
8
- const productSystems = await client.getDescriptors(o.RefType.ProductSystem);
9
- if (productSystems.length === 0) {
10
- throw new Error('No product systems found');
8
+ const processes = await client.getDescriptors(o.RefType.Process);
9
+ const systemProcesses = processes.filter((proc) => proc.processType === o.ProcessType.LCI_RESULT);
10
+ if (systemProcesses.length === 0) {
11
+ throw new Error('No system processes found');
11
12
  }
12
- const resultsObj = productSystems.map((sys) => {
13
+ const resultsObj = systemProcesses.map((sys) => {
13
14
  const result = {
14
15
  id: sys.id,
15
16
  category: sys.category,
@@ -30,9 +31,9 @@ async function listProductSystems({ serverUrl = 'http://localhost:8080', }) {
30
31
  });
31
32
  return JSON.stringify(resultsObj);
32
33
  }
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({
34
+ export function regOpenLcaListSystemProcessesTool(server) {
35
+ server.tool('OpenLCA_List_System_Processes_Tool', 'List all system processes using OpenLCA.', input_schema, async ({ serverUrl }) => {
36
+ const result = await listSystemProcesses({
36
37
  serverUrl: serverUrl,
37
38
  });
38
39
  return {
@@ -135,7 +135,7 @@ function validateTidasData(entityType, data) {
135
135
  }
136
136
  export function regTidasValidationTool(server) {
137
137
  const entityTypeList = ENTITY_TYPES.map((type) => ` - ${type}: ${ENTITY_METADATA[type].name} - ${ENTITY_METADATA[type].description}`).join('\n');
138
- server.tool('tidas_validate_data', `Validate LCA data against Tidas SDK schemas.
138
+ server.tool('Tidas_Data_Validate_Tool', `Validate LCA data against Tidas SDK schemas.
139
139
 
140
140
  Supported entity types (8 types):
141
141
  ${entityTypeList}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiangong-lca/mcp-server",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "TianGong LCA MCP Server",
5
5
  "license": "MIT",
6
6
  "author": "Nan LI",
@@ -28,19 +28,19 @@
28
28
  "ncu:update": "npx npm-check-updates -u"
29
29
  },
30
30
  "dependencies": {
31
- "@modelcontextprotocol/sdk": "^1.20.0",
32
- "@supabase/supabase-js": "^2.75.0",
33
- "@tiangong-lca/tidas-sdk": "^0.1.16",
34
- "@types/express": "^5.0.3",
35
- "@upstash/redis": "^1.35.5",
31
+ "@modelcontextprotocol/sdk": "^1.20.2",
32
+ "@supabase/supabase-js": "^2.76.1",
33
+ "@tiangong-lca/tidas-sdk": "^0.1.17",
34
+ "@types/express": "^5.0.4",
35
+ "@upstash/redis": "^1.35.6",
36
36
  "aws-jwt-verify": "^5.1.1",
37
37
  "olca-ipc": "^2.2.1",
38
38
  "zod": "^3.25.76"
39
39
  },
40
40
  "devDependencies": {
41
- "@modelcontextprotocol/inspector": "0.16.8",
41
+ "@modelcontextprotocol/inspector": "^0.17.2",
42
42
  "dotenv-cli": "^10.0.0",
43
- "npm-check-updates": "^19.0.0",
43
+ "npm-check-updates": "^19.1.1",
44
44
  "prettier": "^3.6.2",
45
45
  "prettier-plugin-organize-imports": "^4.3.0",
46
46
  "shx": "^0.4.0",