Skip to content

Expose HTTP proxy endpoints on Designer app bridge#122

Open
sergiistanchev wants to merge 1 commit intowebflow:hackathon-2026--campaignsfrom
sergiistanchev:sergii/asset-upload-endpoint
Open

Expose HTTP proxy endpoints on Designer app bridge#122
sergiistanchev wants to merge 1 commit intowebflow:hackathon-2026--campaignsfrom
sergiistanchev:sergii/asset-upload-endpoint

Conversation

@sergiistanchev
Copy link
Copy Markdown

Summary

  • Adds POST /api/tool-call, GET /api/status, and POST /api/upload-asset HTTP endpoints on the Designer app bridge so external apps (e.g. the Webflow Designer extension) can call MCP functionality over HTTP instead of stdio.
  • POST /api/upload-asset takes { siteId, url, fileName?, altText? } and returns { assetId, fileName, hostedUrl?, assetUrl? }. Built on a new uploadAssetFromUrl() helper that the existing upload_asset_from_url MCP tool now also calls — single source of truth.
  • initDesignerAppBridge() now accepts BridgeOptions { getClient? } so the upload endpoint can use the Data API. /api/tool-call and /api/status work without getClient.

Why

The campaign-agent extension was calling http://localhost:1338/api/tool-call against a locally-patched bridge; the endpoints were never upstreamed. This PR ports them to the branch everyone on the hackathon is running.

Test plan

  • WEBFLOW_TOKEN=<token> node dist/index.js → server starts
  • curl http://localhost:1338/api/status{ "status": "ok", "port": 1338 }
  • Hit /api/tool-call with a Designer connected → forwards to extension RPC as before
  • Hit /api/upload-asset with an Unsplash URL + valid siteId → asset appears in site asset panel, assetId returned
  • upload_asset_from_url MCP tool still works identically to before (refactored to share the helper)

🤖 Generated with Claude Code

Adds three HTTP endpoints to the Designer app bridge so external apps
(e.g. the Webflow Designer extension) can call MCP functionality over
HTTP instead of stdio:

 - POST /api/tool-call  — forwards { toolName, args } to the Designer
   RPC bridge (same contract as the MCP tool call).
 - GET  /api/status     — bridge health check.
 - POST /api/upload-asset — uploads an image from a URL to the site
   via the Webflow Data API. Uses a new shared uploadAssetFromUrl()
   helper that the `upload_asset_from_url` MCP tool also calls.

initDesignerAppBridge now accepts an optional BridgeOptions { getClient }
so the upload endpoint can use the Data API without re-authenticating.
The tool-call and status endpoints work without getClient.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sergiistanchev sergiistanchev requested a review from a team as a code owner April 16, 2026 16:22
@sergiistanchev sergiistanchev requested review from yan-xie-webflow and removed request for a team April 16, 2026 16:22
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.

1 participant