fastly_api | Make requests to the Fastly API. Allows accessing all endpoints of the Fastly API with custom paths, methods and parameters. IMPORTANT USAGE NOTES FOR LLMs: When making multiple API calls, summarize the results between calls. The user doesn't see raw API responses. Base URL is automatically added - just provide the path (e.g. '/service'). Authentication is handled automatically - no need to include API keys or know API keys. Common paths: List services: GET /service Get service details: GET /service/{service_id} Get domains: GET /service/{service_id}/version/{version}/domain Get backends: GET /service/{service_id}/version/{version}/backend Purge cache: POST /service/{service_id}/purge_all Get stats: GET /stats (with params: service_id, from, to)
Always check status codes in responses. Status 200-299 indicates success. Include simple explanations of what you're doing and what the results mean before and after each API call.
Creating Fastly Compute@Edge SitesTo create a Compute@Edge site, you can use a combination of API calls and terminal commands. The API handles service creation and configuration, while terminal commands handle the local build and deployment process. Follow these general steps: Create a new service using the API: POST /service with {"name": "My Site", "type": "wasm"} Initialize a local Compute project using the Fastly CLI Build the project using the appropriate build tools Deploy using the Fastly CLI with the service ID from step 1
COMMON PITFALLS TO AVOID:DO NOT use --name flag with fastly compute init (use interactive mode or -d -y flags instead) PowerShell requires semicolons (;) not ampersands (&&) for command chaining Fastly compute build creates the package archive AFTER you've built the Wasm binary Build is a TWO-STEP process: first compile to Wasm, then create the package archive Deploy command needs -d flag to avoid hanging on interactive prompts NEVER attempt to extract or use the user's API key directly - auth is handled by MCP To create a service from scratch, you must use API calls for configuration and CLI for local build Check current directory paths carefully before running commands Full URL paths aren't needed in API calls - just use the path portion (e.g. '/service')
See the full guide for detailed instructions on handling common errors and PowerShell-specific commands. |
fastly_cli | Execute Fastly CLI commands securely without exposing API keys. This tool allows you to run Fastly CLI commands while the MCP server handles authentication automatically. The LLM never sees or needs to handle the API key directly. USAGE EXAMPLES: Initialize a Compute project: fastly_cli('compute init --language javascript -d -y') Build a package: fastly_cli('compute build') Deploy a service: fastly_cli('compute deploy --service-id SERVICE_ID -d -y')
COMMON COMMANDS: compute init: Initialize a new Compute project compute build: Build a Compute package compute deploy: Deploy a Compute package compute publish: Build and deploy in one step whoami: Check authentication status
SECURITY NOTE: Authentication is handled automatically. Never attempt to pass API keys in commands. |