Uh oh!
There was an error while loading. Please reload this page.
feat(mcp-server): add listWorkflows tool (PRD-736) - #1771
Merged
christophebrun-forest merged 2 commits intoJul 24, 2026
Conversation
Expose MCP-enabled workflows to LLM clients via a new listWorkflows tool, calling the Forest server MS3 endpoint (GET /api/workflow-orchestrator/workflows) over the HTTP contract with the caller's forestServerToken + renderingId. - forestadmin-client: WorkflowsService + ForestHttpApi.listMcpEnabledWorkflows - mcp-server: listWorkflows tool, http-client wiring, shared getAuthContext util Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7 new issues
|
Uh oh!
There was an error while loading. Please reload this page.
Reconcile with main and fix the listWorkflows integration break. - Migrate the listWorkflows tool to main's new ToolContext signature (declareXxxTool(mcpServer, ctx)) — resolves the server.ts conflict. - Wire WorkflowsService into forestadmin-client: expose forestAdminClient.workflowsService (build-application-services, ForestAdminClientWithCache, ForestAdminClient interface). - Fix agent.ts to pass workflowsService to ForestServerClientImpl before forestServerUrl — the new constructor param was inserted mid-signature, which broke the direct instantiation in the agent (TS2554) and would have bound the URL to workflowsService at runtime. - Update ForestAdminClient mocks/factories accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
christophebrun-forest
changed the base branch from
feature/prd-49-expose-workflow-tools-in-forest-mcp-server
to
mainJuly 24, 2026 10:19
christophebrun-forest
changed the base branch from
main
to
feature/prd-49-expose-workflow-tools-in-forest-mcp-serverJuly 24, 2026 12:00
christophebrun-forest
merged commit Jul 24, 2026
6922326
into
feature/prd-49-expose-workflow-tools-in-forest-mcp-server
36 of 37 checks passed
Uh oh!
There was an error while loading. Please reload this page.
christophebrun-forest
deleted the
feature/prd-736-mcp-ms4-listworkflows-tool
branch
July 24, 2026 12:51
christophebrun-forest added a commit
that referenced
this pull request
Aug 3, 2026
Expose MCP-enabled workflows to LLM clients via a new listWorkflows tool, calling the Forest server MS3 endpoint (GET /api/workflow-orchestrator/workflows) over the HTTP contract with the caller's forestServerToken + renderingId. - forestadmin-client: WorkflowsService + ForestHttpApi.listMcpEnabledWorkflows - mcp-server: listWorkflows tool, http-client wiring, shared getAuthContext util Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
christophebrun-forest added a commit
that referenced
this pull request
Aug 24, 2026
…#1792) Adds a report-only (v1) workflow toolset so an LLM can list, trigger and observe Forest workflows through the MCP server. Tools (all default-on): - listWorkflows — MCP-enabled workflows, optionally filtered by collection. Workflows whose collection was renamed or removed are filtered out, since triggerWorkflow would reject them anyway. - triggerWorkflow — starts a run on a record, returns { runId, runState }. Resolves the workflow by id (O(1)), rejects unknown / MCP-disabled ids without starting a run, and declares destructive MCP annotations. - getWorkflowRun — the full hydrated run: runState plus the complete workflowHistory (per-step definition and context). A run parked on a human-gated step is not resumable via MCP in v1 (follow-up PRD-441). Transport: the tools call @forestadmin/forestadmin-client (new WorkflowsService → ForestHttpApi) against /api/workflow-orchestrator/mcp-workflows/*, under the MCP session identity (forestServerToken, Forest-Application-Source: MCP stamped on the MCP-only routes). All four responses are projected onto an explicit whitelist before reaching a model — stepDefinition is the one deliberate pass-through. Audit: triggerWorkflow is fail-closed. The pending activity log ("requested the workflow X via MCP", no runId yet) is written before the run starts, like create/update/delete. The fail policy now lives in createPendingActivityLog and is arbitrated by action type and by cause: write actions fail closed, read actions fail open with a logged warning, and a 401/403 propagates either way. It covers both the rejected write and the 200-with-null-log-id case. Model-facing errors: transport failures are classified before a model sees them on all four calls — raw Node/superagent errors and the client-built 408 never reach the model, terminal 4xx are told not to retry (shared RETRY_WILL_NOT_HELP wording), and the non-idempotent trigger never advises a retry. Also: TriggerType.Mcp accepted by the workflow-executor run mapper (PRD-832); ForestAdminClient gains a required readonly workflowsService (compile-time breaking for external implementations of the interface — the ForestAdminClientWithCache constructor is a strict append); recordId bounded at 255 to match the server column. Deploy order (spans three repos): workflow executors to the PRD-832 release first (an older executor makes every MCP trigger fail loudly with a zod error), then forestadmin-server (PRD-49, provides the mcp-workflows routes and the by-id lookup this audit depends on), then this PR and the frontend. Includes PRD-736 (#1771), PRD-738 (#1777), PRD-740 (#1785), PRD-831 (#1805), PRD-832 (#1786). fixes PRD-49 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
forest-bot added a commit
that referenced
this pull request
Aug 24, 2026
# @forestadmin/forestadmin-client [1.43.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/forestadmin-client@1.42.1...@forestadmin/forestadmin-client@1.43.0) (2026-08-24) ### Features * **mcp-server:** expose workflow tools in Forest MCP server (PRD-49) ([#1792](#1792)) ([7e34af2](7e34af2)), closes [#1771](#1771) [#1777](#1777) [#1785](#1785) [#1805](#1805) [#1786](#1786)
forest-bot added a commit
that referenced
this pull request
Aug 24, 2026
# @forestadmin/mcp-server [1.23.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/mcp-server@1.22.1...@forestadmin/mcp-server@1.23.0) (2026-08-24) ### Features * **mcp-server:** expose workflow tools in Forest MCP server (PRD-49) ([#1792](#1792)) ([7e34af2](7e34af2)), closes [#1771](#1771) [#1777](#1777) [#1785](#1785) [#1805](#1805) [#1786](#1786) ### Dependencies * **@forestadmin/agent-client:** upgraded to 1.14.1 * **@forestadmin/forestadmin-client:** upgraded to 1.43.0
forest-bot added a commit
that referenced
this pull request
Aug 24, 2026
# @forestadmin/workflow-executor [1.25.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/workflow-executor@1.24.0...@forestadmin/workflow-executor@1.25.0) (2026-08-24) ### Features * **mcp-server:** expose workflow tools in Forest MCP server (PRD-49) ([#1792](#1792)) ([7e34af2](7e34af2)), closes [#1771](#1771) [#1777](#1777) [#1785](#1785) [#1805](#1805) [#1786](#1786) ### Dependencies * **@forestadmin/agent-client:** upgraded to 1.14.1 * **@forestadmin/forestadmin-client:** upgraded to 1.43.0
forest-bot added a commit
that referenced
this pull request
Aug 24, 2026
# @forestadmin/agent [1.97.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.96.0...@forestadmin/agent@1.97.0) (2026-08-24) ### Features * **mcp-server:** expose workflow tools in Forest MCP server (PRD-49) ([#1792](#1792)) ([7e34af2](7e34af2)), closes [#1771](#1771) [#1777](#1777) [#1785](#1785) [#1805](#1805) [#1786](#1786) ### Dependencies * **@forestadmin/forestadmin-client:** upgraded to 1.43.0 * **@forestadmin/mcp-server:** upgraded to 1.23.0 * **@forestadmin/workflow-executor:** upgraded to 1.25.0
forest-bot added a commit
that referenced
this pull request
Aug 24, 2026
# @forestadmin/agent-testing [1.2.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent-testing@1.1.79...@forestadmin/agent-testing@1.2.0) (2026-08-24) ### Features * **mcp-server:** expose workflow tools in Forest MCP server (PRD-49) ([#1792](#1792)) ([7e34af2](7e34af2)), closes [#1771](#1771) [#1777](#1777) [#1785](#1785) [#1805](#1805) [#1786](#1786) ### Dependencies * **@forestadmin/agent-client:** upgraded to 1.14.1 * **@forestadmin/forestadmin-client:** upgraded to 1.43.0 * **@forestadmin/agent:** upgraded to 1.97.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

MS4 of PRD-49 —
listWorkflowsMCP toolExposes MCP-enabled workflows to LLM clients through a new
listWorkflowstool in@forestadmin/mcp-server, so a client can discover workflows in its context before triggering one.fixes PRD-736
What it does
listWorkflowswith args{ collectionName?: string }, registered like the existinglist/update/executeActiontools (registerToolWithLogging, read-only).GET /api/workflow-orchestrator/workflowsover the HTTP contract — BearerforestServerToken+forest-rendering-idheader + optionalcollectionNamequery. No private-api import.extra.authInfo.extra(forestServerToken+renderingId).[{ workflowId, name, collectionName }]. Errors (403/404/…) map to MCP tool errors via the typed errors ofServerUtils+registerToolWithLogging.Implementation
forestadmin-client
WorkflowsService+ForestHttpApi.listMcpEnabledWorkflows(transport, viaServerUtils.queryWithBearerToken)McpWorkflow,ListMcpWorkflowsParams,WorkflowsServiceInterfacemcp-server
listWorkflowstool + http-client wiring (WorkflowsService)getAuthContextutil (reused by activity-logs-creator)ToolName,allTools,allToolNames,SAFE_ARGUMENTS_FOR_LOGGINGNotes
descriptionis intentionally not returned — deferred to a separate product ticket (excluded from MS3 on purpose).withActivityLogon this read-only discovery tool.Tests
list-workflowstool tests)🤖 Generated with Claude Code
Note
Add
listWorkflowsMCP tool and in-process agent dispatcher to MCP serverlistWorkflowsMCP tool inlist-workflows.tsthat callsforestServerClient.listMcpWorkflowswith optionalcollectionNamefiltering, returning MCP-enabled workflows as JSON.InProcessDispatcher) that routes MCP tool requests directly to the agent's Koa stack vialight-my-request, bypassing the network while still running JWT auth and permission checks.ToolContextobject (withforestServerClient,logger,collectionNames, and optionalagentDispatcher) and passagentDispatcherthrough tobuildClient/buildClientWithActions.WorkflowsServicetoForestAdminClientand wires it through the MCP server's HTTP client solistMcpWorkflowsis available server-side.getActionFormtool responses to include per-fielddescriptionandallowedValues(normalized to{value, label}) for multiple-choice widgets.agentUrl(or the in-process stack) instead of the publicapi_endpoint.Macroscope summarized 8a9449b.