Skip to main content
Windsurf is an agentic IDE powered by Cascade. This page shows you how to configure it for productive work against the Pictory API: workspace rules that teach Cascade the API conventions, MCP integration for direct API calls, and example prompts.

Prerequisites

Setup

1

Open your project in Windsurf

Open the project where you want to integrate the Pictory API.
2

Store your Pictory API key

Add the key to your shell profile (do not commit it):
Restart Windsurf after setting the variable.
3

Create workspace rules

Windsurf reads .windsurf/rules.md from the project root. Create the directory:
4

Add the Pictory rules file

Use the template in the next section to populate .windsurf/rules.md.
Create .windsurf/rules.md:

Connecting via MCP

Windsurf’s Cascade supports MCP servers natively. To let Cascade call the Pictory API as structured tools, connect the Pictory MCP server.
  1. Open Windsurf settings → CascadeModel Context Protocol.
  2. Add the Pictory MCP server configuration (details at Pictory MCP Server).
  3. Reload Cascade to pick up the new tools.
Once connected, Cascade can invoke Pictory endpoints directly without generating code first.

Example Prompts

  • “Build a Node.js worker that consumes a queue of video render requests and submits each one to Pictory. Use the OpenAPI spec at https://docs.pictory.ai/openapi.json for the request shape.”
  • “Add a unit test for my submitPictoryRender function that mocks the API response.”
  • “Trace through this 401 error. Why is my Pictory API request being rejected?”
  • “Generate a webhook handler that receives Pictory’s completion callback and uploads the rendered video to S3.”

Troubleshooting

Cause: Default LLM bias toward Bearer flows.Resolution: Reinforce the rule in .windsurf/rules.md. If Cascade still suggests Bearer mid-session, correct it once and Cascade will adapt.
Cause: MCP server not running or misconfigured.Resolution: Verify the MCP server URL and credentials, restart Windsurf, and check the Cascade panel for tool registration errors.
Cause: Default LLM tendency to write tight polling loops.Resolution: The rules file specifies 10–30 second polling. If Cascade still generates a 1-second loop, paste the snippet back and say “follow the polling interval rule in .windsurf/rules.md.”

Next Steps

Use Pictory with an LLM

System prompts, MCP, and example flows

End-to-End Recipes

Ready-to-run JSON payloads

Claude Code Setup

Same setup, for Claude Code users

Cursor Setup

Same setup, for Cursor users