@milaboratories/pl-mcp-server 52.0.0 → 52.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.
Files changed (86) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/instructions.cjs +27 -0
  3. package/dist/instructions.cjs.map +1 -0
  4. package/dist/instructions.js +27 -0
  5. package/dist/instructions.js.map +1 -0
  6. package/dist/package.cjs +10 -0
  7. package/dist/package.cjs.map +1 -0
  8. package/dist/package.js +5 -0
  9. package/dist/package.js.map +1 -0
  10. package/dist/server.cjs +43 -41
  11. package/dist/server.cjs.map +1 -1
  12. package/dist/server.d.ts +15 -9
  13. package/dist/server.d.ts.map +1 -1
  14. package/dist/server.js +42 -40
  15. package/dist/server.js.map +1 -1
  16. package/dist/tools/await.cjs +7 -4
  17. package/dist/tools/await.cjs.map +1 -1
  18. package/dist/tools/await.js +8 -5
  19. package/dist/tools/await.js.map +1 -1
  20. package/dist/tools/block-action-context.cjs +7 -4
  21. package/dist/tools/block-action-context.cjs.map +1 -1
  22. package/dist/tools/block-action-context.js +8 -5
  23. package/dist/tools/block-action-context.js.map +1 -1
  24. package/dist/tools/block-state.cjs +17 -10
  25. package/dist/tools/block-state.cjs.map +1 -1
  26. package/dist/tools/block-state.js +18 -11
  27. package/dist/tools/block-state.js.map +1 -1
  28. package/dist/tools/blocks.cjs +55 -33
  29. package/dist/tools/blocks.cjs.map +1 -1
  30. package/dist/tools/blocks.js +56 -34
  31. package/dist/tools/blocks.js.map +1 -1
  32. package/dist/tools/connection.cjs +23 -6
  33. package/dist/tools/connection.cjs.map +1 -1
  34. package/dist/tools/connection.js +24 -7
  35. package/dist/tools/connection.js.map +1 -1
  36. package/dist/tools/data-query.cjs +14 -7
  37. package/dist/tools/data-query.cjs.map +1 -1
  38. package/dist/tools/data-query.js +15 -8
  39. package/dist/tools/data-query.js.map +1 -1
  40. package/dist/tools/ids.cjs +14 -0
  41. package/dist/tools/ids.cjs.map +1 -0
  42. package/dist/tools/ids.js +13 -0
  43. package/dist/tools/ids.js.map +1 -0
  44. package/dist/tools/logs.cjs +11 -6
  45. package/dist/tools/logs.cjs.map +1 -1
  46. package/dist/tools/logs.js +12 -7
  47. package/dist/tools/logs.js.map +1 -1
  48. package/dist/tools/ping.cjs +5 -1
  49. package/dist/tools/ping.cjs.map +1 -1
  50. package/dist/tools/ping.js +6 -2
  51. package/dist/tools/ping.js.map +1 -1
  52. package/dist/tools/projects.cjs +20 -7
  53. package/dist/tools/projects.cjs.map +1 -1
  54. package/dist/tools/projects.js +21 -8
  55. package/dist/tools/projects.js.map +1 -1
  56. package/dist/tools/screenshot.cjs +3 -1
  57. package/dist/tools/screenshot.cjs.map +1 -1
  58. package/dist/tools/screenshot.js +4 -2
  59. package/dist/tools/screenshot.js.map +1 -1
  60. package/dist/tools/types.cjs +51 -0
  61. package/dist/tools/types.cjs.map +1 -1
  62. package/dist/tools/types.js +50 -1
  63. package/dist/tools/types.js.map +1 -1
  64. package/dist/tools/ui-interaction.cjs +27 -13
  65. package/dist/tools/ui-interaction.cjs.map +1 -1
  66. package/dist/tools/ui-interaction.js +28 -14
  67. package/dist/tools/ui-interaction.js.map +1 -1
  68. package/package.json +11 -9
  69. package/src/index.ts +1 -0
  70. package/src/instructions.ts +23 -0
  71. package/src/server.test.ts +631 -0
  72. package/src/server.ts +63 -58
  73. package/src/tools/await.ts +9 -6
  74. package/src/tools/block-action-context.ts +9 -6
  75. package/src/tools/block-state.ts +21 -14
  76. package/src/tools/blocks.ts +58 -36
  77. package/src/tools/connection.ts +38 -17
  78. package/src/tools/data-query.ts +17 -10
  79. package/src/tools/ids.ts +11 -0
  80. package/src/tools/logs.ts +13 -8
  81. package/src/tools/ping.ts +14 -5
  82. package/src/tools/projects.ts +26 -11
  83. package/src/tools/screenshot.ts +7 -5
  84. package/src/tools/types.test.ts +19 -0
  85. package/src/tools/types.ts +71 -3
  86. package/src/tools/ui-interaction.ts +29 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/pl-mcp-server",
3
- "version": "52.0.0",
3
+ "version": "52.1.0",
4
4
  "description": "MCP server for Platforma Desktop",
5
5
  "keywords": [],
6
6
  "license": "UNLICENSED",
@@ -19,18 +19,20 @@
19
19
  }
20
20
  },
21
21
  "dependencies": {
22
- "@modelcontextprotocol/sdk": "^1.32.2",
22
+ "@modelcontextprotocol/node": "^2.1.2",
23
+ "@modelcontextprotocol/server": "^2.4.0",
23
24
  "quickjs-emscripten": "npm:@milaboratories-poc/quickjs-emscripten@0.32.1-bytecode.1",
24
- "zod": "~3.25.76"
25
+ "zod": "^4.6.7"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@milaboratories/build-configs": "2.0.3",
28
- "@milaboratories/pl-errors": "1.4.72",
29
- "@milaboratories/pl-middle-layer": "2.8.9",
30
- "@milaboratories/pl-model-common": "1.59.0",
29
+ "@milaboratories/pl-errors": "1.4.73",
30
+ "@milaboratories/pl-middle-layer": "2.8.10",
31
+ "@milaboratories/pl-model-common": "1.60.0",
31
32
  "@milaboratories/ts-builder": "1.8.0",
32
33
  "@milaboratories/ts-configs": "1.4.1",
33
- "@platforma-sdk/model": "1.95.0",
34
+ "@modelcontextprotocol/client": "^2.4.0",
35
+ "@platforma-sdk/model": "1.96.1",
34
36
  "@types/node": "~24.19.2",
35
37
  "@vitest/coverage-istanbul": "^4.1.12",
36
38
  "shx": "^0.4.0",
@@ -38,8 +40,8 @@
38
40
  "vitest": "^4.1.12"
39
41
  },
40
42
  "peerDependencies": {
41
- "@milaboratories/pl-middle-layer": ">=2.8.9",
42
- "@platforma-sdk/model": ">=1.95.0"
43
+ "@milaboratories/pl-middle-layer": ">=2.8.10",
44
+ "@platforma-sdk/model": ">=1.96.1"
43
45
  },
44
46
  "engines": {
45
47
  "node": ">=24"
package/src/index.ts CHANGED
@@ -5,3 +5,4 @@ export type {
5
5
  ServerConnection,
6
6
  McpSecret,
7
7
  } from "./server";
8
+ export type { BlockId } from "@milaboratories/pl-model-common";
@@ -0,0 +1,23 @@
1
+ /**
2
+ * What a client is told about the server before it has seen any tool: what the server is for and
3
+ * the order the tools are used in. Clients that load tools on demand show the model this text and
4
+ * the tool names only, so the order of work has to be readable from here.
5
+ *
6
+ * Kept under 4096 characters, the length some clients cut instructions at, with the order of work
7
+ * first. It repeats nothing a tool description says about that tool's own arguments.
8
+ */
9
+ export const SERVER_INSTRUCTIONS = `Platforma Desktop: build and run data analysis projects. A project is an ordered list of blocks; each block is one analysis step with its own configuration, and reads the results of blocks above it.
10
+
11
+ Order of work:
12
+ 1. Connection: get_connection_status. If not connected: list_connections, then connect_to_server.
13
+ 2. Project: list_projects or create_project, then open_project. Every block tool needs an opened project.
14
+ 3. Add blocks: list_available_blocks finds a block; add_block adds it. Add blocks in the order the data flows.
15
+ 4. Configure a block: get_block_state returns the block's data and outputs. Change the data and write the whole object back with set_block_data. The choices a block offers for its inputs (datasets, columns of blocks above) are in its outputs: get_block_outputs.
16
+ 5. Check and run: get_project_overview shows for each block whether its inputs are valid and whether it can run. run_block starts a block together with the stale blocks above it; await_block_done waits for it.
17
+ 6. Results: get_block_outputs, then list_columns and query_table for tables, get_block_logs for logs.
18
+
19
+ Rules:
20
+ - Project ids, block ids, references to blocks and columns, and table handles come from tool results. Copy them; do not compose them.
21
+ - set_block_data replaces the block's data: send the whole object, not the changed part.
22
+ - Changing a block's data can make its results, and the results of blocks that read them, stale until they run again.
23
+ - capture_screenshot, click, type_text, press_key, scroll, execute_js and select_block drive the application window. They are for testing the application; configuring and running blocks does not need them.`;