Skip to content

feat(ai): add list-workflows public MCP tool#86

Merged
bertenator merged 2 commits intosaifrom
achang/DEVPL-3935-list-workflows-public-mcp-tool
Mar 17, 2026
Merged

feat(ai): add list-workflows public MCP tool#86
bertenator merged 2 commits intosaifrom
achang/DEVPL-3935-list-workflows-public-mcp-tool

Conversation

@bertenator
Copy link
Member

@bertenator bertenator commented Mar 17, 2026

Summary

PR 3 of 3 for DEVPL-3935 — exposes AI Workflows to the public Webflow MCP server.

Prerequisite: webflow/webflow#101267 (merged) added GET /v2/sites/:site_id/workflows. This PR wires up the public-facing tool that calls it.

  • src/tools/workflows.ts — new registerWorkflowsTools function; registers data_workflows_tool with a list_workflows action that calls GET /v2/sites/:site_id/workflows via raw fetch (no SDK method exists yet for workflows)
  • src/tools/index.ts — exports registerWorkflowsTools
  • src/mcp.ts — adds getToken param to registerTools, calls registerWorkflowsTools
  • src/index.ts — adds getToken helper, passes it to registerTools

The getToken threading is needed because workflows uses raw fetch instead of the WebflowClient SDK (same pattern as aiChat.ts).

Test plan

  • Set WEBFLOW_TOKEN to a token for a site with AI_WORKFLOWS flag enabled
  • Run server locally: npm run build && node dist/index.js
  • Call data_workflows_tool with list_workflows: { site_id: "<id>" } → verify response shape [{ workflowId, name, isActive, templateSlug }]
  • Call with a site that doesn't have the flag → verify 403 is surfaced via formatErrorResponse

@bertenator bertenator requested a review from a team as a code owner March 17, 2026 21:55
@bertenator bertenator requested review from markconigliaro1 and viratatwebflow and removed request for a team and markconigliaro1 March 17, 2026 21:55
@viratatwebflow viratatwebflow changed the base branch from main to sai March 17, 2026 22:00
PR 3 of 3 for DEVPL-3935. Adds data_workflows_tool to the public
Webflow MCP server, calling GET /v2/sites/:site_id/workflows via
raw fetch (no SDK method exists yet).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bertenator bertenator force-pushed the achang/DEVPL-3935-list-workflows-public-mcp-tool branch from 15a7c59 to 7b557e6 Compare March 17, 2026 22:03
src/mcp.ts Outdated
registerCommentsTools(server, getClient);
registerEnterpriseTools(server, getClient);
registerWebhookTools(server, getClient);
registerWorkflowsTools(server, getToken);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove registerWorkflowsTools from here

src/index.ts Outdated
return webflowClient;
}

// Return the Webflow token for direct API calls
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove getToken. we added getAccessToken

src/index.ts Outdated
const { callTool } = await initDesignerAppBridge();
registerMiscTools(server);
registerTools(server, getClient);
registerTools(server, getClient, getToken);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove getToken usage. do not import registerWorkflowTools in oss version

Copy link
Collaborator

@viratatwebflow viratatwebflow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check comments

Per review: workflows tool is not part of the OSS stdio version.
- Remove getToken param from registerTools
- Remove registerWorkflowsTools call from registerTools
- Export new registerWorkflowTools(server, getAccessToken) for use
  by the cloud-hosted MCP entry point
- Remove getToken helper from index.ts (OSS version)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@viratatwebflow viratatwebflow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@bertenator bertenator merged commit c4a8bc2 into sai Mar 17, 2026
6 checks passed
@bertenator bertenator deleted the achang/DEVPL-3935-list-workflows-public-mcp-tool branch March 17, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants