@stigmer/mcp-server 3.2.3 → 3.4.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 (179) hide show
  1. package/README.md +60 -13
  2. package/cli/mcp-server-stigmer.js +13 -9
  3. package/config.d.ts +12 -0
  4. package/config.d.ts.map +1 -1
  5. package/config.js +5 -0
  6. package/config.js.map +1 -1
  7. package/domains/agentexecutions/approve.d.ts +9 -0
  8. package/domains/agentexecutions/approve.d.ts.map +1 -0
  9. package/domains/agentexecutions/approve.js +46 -0
  10. package/domains/agentexecutions/approve.js.map +1 -0
  11. package/domains/agentexecutions/fetch.d.ts +28 -0
  12. package/domains/agentexecutions/fetch.d.ts.map +1 -0
  13. package/domains/agentexecutions/fetch.js +82 -0
  14. package/domains/agentexecutions/fetch.js.map +1 -0
  15. package/domains/agentexecutions/run.d.ts +27 -0
  16. package/domains/agentexecutions/run.d.ts.map +1 -0
  17. package/domains/agentexecutions/run.js +87 -0
  18. package/domains/agentexecutions/run.js.map +1 -0
  19. package/domains/agentexecutions/tools.d.ts +5 -0
  20. package/domains/agentexecutions/tools.d.ts.map +1 -0
  21. package/domains/agentexecutions/tools.js +97 -0
  22. package/domains/agentexecutions/tools.js.map +1 -0
  23. package/domains/datastores/apply.d.ts +4 -0
  24. package/domains/datastores/apply.d.ts.map +1 -0
  25. package/domains/datastores/apply.js +28 -0
  26. package/domains/datastores/apply.js.map +1 -0
  27. package/domains/datastores/delete.d.ts +3 -0
  28. package/domains/datastores/delete.d.ts.map +1 -0
  29. package/domains/datastores/delete.js +38 -0
  30. package/domains/datastores/delete.js.map +1 -0
  31. package/domains/datastores/fetch.d.ts +3 -0
  32. package/domains/datastores/fetch.d.ts.map +1 -0
  33. package/domains/datastores/fetch.js +23 -0
  34. package/domains/datastores/fetch.js.map +1 -0
  35. package/domains/datastores/resources.d.ts +5 -0
  36. package/domains/datastores/resources.d.ts.map +1 -0
  37. package/domains/datastores/resources.js +16 -0
  38. package/domains/datastores/resources.js.map +1 -0
  39. package/domains/datastores/tools.d.ts +5 -0
  40. package/domains/datastores/tools.d.ts.map +1 -0
  41. package/domains/datastores/tools.js +46 -0
  42. package/domains/datastores/tools.js.map +1 -0
  43. package/domains/environments/apply.d.ts +4 -0
  44. package/domains/environments/apply.d.ts.map +1 -0
  45. package/domains/environments/apply.js +30 -0
  46. package/domains/environments/apply.js.map +1 -0
  47. package/domains/environments/delete.d.ts +3 -0
  48. package/domains/environments/delete.d.ts.map +1 -0
  49. package/domains/environments/delete.js +36 -0
  50. package/domains/environments/delete.js.map +1 -0
  51. package/domains/environments/fetch.d.ts +6 -0
  52. package/domains/environments/fetch.d.ts.map +1 -0
  53. package/domains/environments/fetch.js +30 -0
  54. package/domains/environments/fetch.js.map +1 -0
  55. package/domains/environments/resources.d.ts +5 -0
  56. package/domains/environments/resources.d.ts.map +1 -0
  57. package/domains/environments/resources.js +16 -0
  58. package/domains/environments/resources.js.map +1 -0
  59. package/domains/environments/tools.d.ts +5 -0
  60. package/domains/environments/tools.d.ts.map +1 -0
  61. package/domains/environments/tools.js +51 -0
  62. package/domains/environments/tools.js.map +1 -0
  63. package/domains/executions/cancel.d.ts +9 -0
  64. package/domains/executions/cancel.d.ts.map +1 -0
  65. package/domains/executions/cancel.js +114 -0
  66. package/domains/executions/cancel.js.map +1 -0
  67. package/domains/executions/tools.d.ts +5 -0
  68. package/domains/executions/tools.d.ts.map +1 -0
  69. package/domains/executions/tools.js +28 -0
  70. package/domains/executions/tools.js.map +1 -0
  71. package/domains/records/calls.d.ts +48 -0
  72. package/domains/records/calls.d.ts.map +1 -0
  73. package/domains/records/calls.js +118 -0
  74. package/domains/records/calls.js.map +1 -0
  75. package/domains/records/errors.d.ts +24 -0
  76. package/domains/records/errors.d.ts.map +1 -0
  77. package/domains/records/errors.js +79 -0
  78. package/domains/records/errors.js.map +1 -0
  79. package/domains/records/tools.d.ts +7 -0
  80. package/domains/records/tools.d.ts.map +1 -0
  81. package/domains/records/tools.js +139 -0
  82. package/domains/records/tools.js.map +1 -0
  83. package/domains/resourceuri.d.ts.map +1 -1
  84. package/domains/resourceuri.js +2 -0
  85. package/domains/resourceuri.js.map +1 -1
  86. package/domains/search/tools.d.ts.map +1 -1
  87. package/domains/search/tools.js +10 -7
  88. package/domains/search/tools.js.map +1 -1
  89. package/domains/skills/tools.d.ts.map +1 -1
  90. package/domains/skills/tools.js +25 -1
  91. package/domains/skills/tools.js.map +1 -1
  92. package/domains/skills/versions.d.ts +9 -0
  93. package/domains/skills/versions.d.ts.map +1 -0
  94. package/domains/skills/versions.js +31 -0
  95. package/domains/skills/versions.js.map +1 -0
  96. package/domains/workflowexecutions/approvals.d.ts +17 -0
  97. package/domains/workflowexecutions/approvals.d.ts.map +1 -0
  98. package/domains/workflowexecutions/approvals.js +61 -0
  99. package/domains/workflowexecutions/approvals.js.map +1 -0
  100. package/domains/workflowexecutions/run.d.ts +12 -0
  101. package/domains/workflowexecutions/run.d.ts.map +1 -0
  102. package/domains/workflowexecutions/run.js +69 -0
  103. package/domains/workflowexecutions/run.js.map +1 -0
  104. package/domains/workflowexecutions/tools.d.ts.map +1 -1
  105. package/domains/workflowexecutions/tools.js +89 -6
  106. package/domains/workflowexecutions/tools.js.map +1 -1
  107. package/domains/workflows/tools.d.ts.map +1 -1
  108. package/domains/workflows/tools.js +69 -5
  109. package/domains/workflows/tools.js.map +1 -1
  110. package/domains/workflows/versions.d.ts +29 -0
  111. package/domains/workflows/versions.d.ts.map +1 -0
  112. package/domains/workflows/versions.js +99 -0
  113. package/domains/workflows/versions.js.map +1 -0
  114. package/gen/agent.d.ts +56 -0
  115. package/gen/agent.d.ts.map +1 -1
  116. package/gen/agent.js +24 -1
  117. package/gen/agent.js.map +1 -1
  118. package/gen/datastore.d.ts +861 -0
  119. package/gen/datastore.d.ts.map +1 -0
  120. package/gen/datastore.js +267 -0
  121. package/gen/datastore.js.map +1 -0
  122. package/gen/environment.d.ts +77 -0
  123. package/gen/environment.d.ts.map +1 -0
  124. package/gen/environment.js +62 -0
  125. package/gen/environment.js.map +1 -0
  126. package/gen/workflow.d.ts +4 -4
  127. package/index.d.ts +2 -2
  128. package/index.d.ts.map +1 -1
  129. package/index.js +4 -4
  130. package/index.js.map +1 -1
  131. package/package.json +3 -3
  132. package/server.d.ts +31 -1
  133. package/server.d.ts.map +1 -1
  134. package/server.js +53 -3
  135. package/server.js.map +1 -1
  136. package/src/config.ts +19 -0
  137. package/src/domains/agentexecutions/approve.ts +67 -0
  138. package/src/domains/agentexecutions/fetch.ts +112 -0
  139. package/src/domains/agentexecutions/run.ts +112 -0
  140. package/src/domains/agentexecutions/tools.ts +139 -0
  141. package/src/domains/apply.integration.test.ts +82 -6
  142. package/src/domains/datastores/apply.ts +33 -0
  143. package/src/domains/datastores/delete.ts +47 -0
  144. package/src/domains/datastores/fetch.ts +32 -0
  145. package/src/domains/datastores/resources.ts +21 -0
  146. package/src/domains/datastores/tools.ts +76 -0
  147. package/src/domains/deletes.integration.test.ts +49 -2
  148. package/src/domains/environments/apply.ts +40 -0
  149. package/src/domains/environments/delete.ts +45 -0
  150. package/src/domains/environments/fetch.ts +39 -0
  151. package/src/domains/environments/resources.ts +21 -0
  152. package/src/domains/environments/tools.ts +81 -0
  153. package/src/domains/executions/cancel.ts +148 -0
  154. package/src/domains/executions/tools.ts +45 -0
  155. package/src/domains/executions.integration.test.ts +376 -0
  156. package/src/domains/reads.integration.test.ts +51 -5
  157. package/src/domains/records/calls.ts +209 -0
  158. package/src/domains/records/errors.ts +98 -0
  159. package/src/domains/records/records.integration.test.ts +313 -0
  160. package/src/domains/records/tools.ts +210 -0
  161. package/src/domains/resources.integration.test.ts +38 -2
  162. package/src/domains/resourceuri.test.ts +11 -2
  163. package/src/domains/resourceuri.ts +2 -0
  164. package/src/domains/search/search.integration.test.ts +18 -2
  165. package/src/domains/search/tools.ts +12 -7
  166. package/src/domains/skills/tools.ts +34 -1
  167. package/src/domains/skills/versions.ts +47 -0
  168. package/src/domains/versions.integration.test.ts +212 -0
  169. package/src/domains/workflowexecutions/approvals.ts +102 -0
  170. package/src/domains/workflowexecutions/run.ts +87 -0
  171. package/src/domains/workflowexecutions/tools.ts +120 -6
  172. package/src/domains/workflows/tools.ts +90 -7
  173. package/src/domains/workflows/versions.ts +147 -0
  174. package/src/gen/agent.ts +28 -1
  175. package/src/gen/datastore.ts +264 -0
  176. package/src/gen/environment.ts +66 -0
  177. package/src/http.integration.test.ts +1 -0
  178. package/src/index.ts +12 -5
  179. package/src/server.ts +71 -5
package/README.md CHANGED
@@ -1,16 +1,17 @@
1
1
  # `@stigmer/mcp-server`
2
2
 
3
3
  A [Model Context Protocol](https://modelcontextprotocol.io) server for the
4
- Stigmer platform. It exposes Stigmer **agents, skills, MCP servers, and
5
- workflows** as MCP tools and resources, so any MCP-capable client (Claude
6
- Desktop, Cursor, the Stigmer CLI, etc.) can read and manage Stigmer resources
7
- through a uniform protocol.
4
+ Stigmer platform. It exposes Stigmer **agents, skills, MCP servers, workflows,
5
+ environments, and datastores** as MCP tools and resources — covering both the
6
+ authoring loop (create, read, update, delete, version) and the execution loop
7
+ (run, observe, approve, cancel) — so any MCP-capable client (Claude Desktop,
8
+ Cursor, the Stigmer CLI, etc.) can build on Stigmer through a uniform protocol.
8
9
 
9
10
  The server is a **stateless protocol bridge**: it holds no per-user state and
10
11
  performs no business logic. Every request is translated into a gRPC call against
11
12
  `stigmer-server`, which remains the single source of truth and the sole authority
12
13
  for authentication and authorization. This package is the TypeScript successor to
13
- the Go `mcp-server/` and is contract-compatible with it.
14
+ the retired Go `mcp-server/`.
14
15
 
15
16
  ## Architecture
16
17
 
@@ -37,14 +38,20 @@ MCP client ──JSON-RPC──▶ stdio | HTTP session ──▶ tool handler
37
38
  - **`apply_*` ergonomics are generated.** The flattened, LLM-friendly input
38
39
  schemas for the `apply_*` tools (metadata hoisting, enum→string, reference
39
40
  flattening, oneof / `task_config` expansion) are produced at build time by the
40
- codegen in `tools/codegen/generator/mcp_ts.go`, mirroring the Go generator so
41
- the two servers expose identical tool surfaces. Never hand-edit `src/gen/`.
41
+ codegen in `tools/codegen/generator/mcp_ts.go`. Never hand-edit `src/gen/`.
42
42
 
43
- ## Tools (17)
43
+ ## Tools (38)
44
+
45
+ ### Discovery
46
+
47
+ | Tool | Description |
48
+ | --- | --- |
49
+ | `search` | Search across agents, skills, MCP servers, workflows, environments, and datastores; results are enriched with `stigmer://` resource URIs. |
50
+
51
+ ### Authoring
44
52
 
45
53
  | Tool | Description |
46
54
  | --- | --- |
47
- | `search` | Search across agents, skills, MCP servers, and workflows; results are enriched with `stigmer://` resource URIs. |
48
55
  | `get_agent` | Read an agent by org + slug. |
49
56
  | `apply_agent` | Create or update an agent (idempotent). |
50
57
  | `delete_agent` | Delete an agent. |
@@ -53,16 +60,54 @@ MCP client ──JSON-RPC──▶ stdio | HTTP session ──▶ tool handler
53
60
  | `delete_mcp_server` | Delete an MCP server. |
54
61
  | `get_skill` | Read a skill (optionally a specific version). |
55
62
  | `delete_skill` | Delete a skill (all versions). |
56
- | `get_workflow` | Read a workflow by org + slug. |
63
+ | `list_skill_versions` | List a skill's version history. |
64
+ | `get_workflow` | Read a workflow by org + slug, or a historical version by hash. |
57
65
  | `apply_workflow` | Create or update a workflow, with typed per-kind task config and recursive nested tasks. |
58
66
  | `delete_workflow` | Delete a workflow. |
67
+ | `list_workflow_versions` | List a workflow's version history (timeline only, YAML omitted). |
68
+ | `tag_workflow_version` | Assign or move a tag (e.g. `stable`) onto a workflow version. |
59
69
  | `validate_workflow_yaml` | Validate a Serverless Workflow YAML document against the task-kind registry. |
60
70
  | `get_task_kind_registry` | List every supported workflow task kind. |
61
71
  | `get_task_kind` | Read one task kind's config/output schema and examples. |
72
+ | `get_environment` | Read an environment (secret values arrive server-redacted). |
73
+ | `apply_environment` | Create or update an environment; echoing `***REDACTED***` preserves existing secrets. |
74
+ | `delete_environment` | Delete an environment. |
75
+ | `get_datastore` | Read a datastore definition (collections, constraints, grants). |
76
+ | `apply_datastore` | Create or update a datastore definition (structure only, never records). |
77
+ | `delete_datastore` | Delete a datastore and all records in it. |
78
+
79
+ ### Execution
80
+
81
+ Runs are asynchronous: the `run_*` tools return immediately with the execution
82
+ ID and the assistant polls the observation tools.
83
+
84
+ | Tool | Description |
85
+ | --- | --- |
86
+ | `run_agent` | Start an agent execution (new session or `session_id` follow-up). |
87
+ | `run_workflow` | Start a workflow execution. |
88
+ | `get_agent_execution` | Poll an agent execution: phase, message tail (compact view) or full record, pending approvals. |
62
89
  | `get_workflow_execution` | Read a workflow execution by id. |
63
90
  | `get_workflow_execution_events` | Read the event stream for a workflow execution. |
91
+ | `list_pending_approvals` | Org-wide inbox of workflow `human_input` tasks awaiting a decision. |
92
+ | `submit_agent_execution_approval` | Approve / skip / reject a tool call an agent execution is waiting on. |
93
+ | `submit_workflow_task_approval` | Submit a reviewer decision (outcome + optional form data) for a workflow task. |
94
+ | `cancel_execution` | Gracefully cancel an agent (`aex_*`) or workflow (`wex_*`) execution by ID prefix. |
95
+
96
+ ### Datastore records
97
+
98
+ Registered on the full roster with an `org` argument; a records-only roster
99
+ (`STIGMER_MCP_ROSTER=records`, HTTP `/records` route) serves the same five tools
100
+ with the agent-facing surface and nothing else.
101
+
102
+ | Tool | Description |
103
+ | --- | --- |
104
+ | `describe_datastore` | Collections, fields, constraints, and the caller's allowed verbs. |
105
+ | `find_records` | Typed filter query with ordering and paging. |
106
+ | `insert_record` | Insert one record. |
107
+ | `update_record` | Partial-merge update by id. |
108
+ | `delete_record` | Delete one record by id. |
64
109
 
65
- ## Resources (5)
110
+ ## Resources (7)
66
111
 
67
112
  Resource templates let clients discover and read resources by `stigmer://` URI:
68
113
 
@@ -73,6 +118,8 @@ Resource templates let clients discover and read resources by `stigmer://` URI:
73
118
  | `stigmer_skill` | `stigmer://skills/{org}/{slug}` (latest) |
74
119
  | `stigmer_skill_version` | `stigmer://skills/{org}/{slug}/{version}` |
75
120
  | `stigmer_workflow` | `stigmer://workflows/{org}/{slug}` |
121
+ | `stigmer_environment` | `stigmer://environments/{org}/{slug}` |
122
+ | `stigmer_datastore` | `stigmer://datastores/{org}/{slug}` |
76
123
 
77
124
  ## Configuration
78
125
 
@@ -147,8 +194,8 @@ make codegen-apply
147
194
  ```
148
195
 
149
196
  This runs the Go emitter (`tools/codegen/generator`, target `mcp-ts`) over the
150
- proto contracts. The same model also drives the Go MCP server, guaranteeing the
151
- two servers stay in lockstep.
197
+ proto contracts. Adding an `apply_*` tool for a new resource is an append to
198
+ `mcpTSApplyResources` in `tools/codegen/generator/mcp_ts.go` plus regeneration.
152
199
 
153
200
  ## Conventions
154
201