Prerequisites
- Windsurf installed
- A Pictory API key from app.pictory.ai/api-access (starts with
pictai_)
Setup
Store your Pictory API key
Add the key to your shell profile (do not commit it):Restart Windsurf after setting the variable.
Create workspace rules
Windsurf reads
.windsurf/rules.md from the project root. Create the directory:Recommended Windsurf Rules
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.- Open Windsurf settings → Cascade → Model Context Protocol.
- Add the Pictory MCP server configuration (details at Pictory MCP Server).
- Reload Cascade to pick up the new tools.
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
submitPictoryRenderfunction 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
MCP Tools Do Not Appear in Cascade
MCP Tools Do Not Appear in Cascade
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.
Cascade Polls Too Aggressively
Cascade Polls Too Aggressively
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
