MCP Examples
Learn how to leverage MCP-enabled code assistants for common Azion Platform tasks.
Deploy a static site
Use natural language to get step-by-step deployment guidance.
Example conversation
Request
You: "I have a static website with HTML, CSS, and JavaScript files.Help me deploy it to Azion."
Response
The assistant will:
- Use
deploy_azion_static_site
tool to retrieve deployment guide - Provide step-by-step instructions
- Guide you through:
- Project initialization with
azion init
- Configuration setup
- Build process with
azion build
- Deployment with
azion deploy
- Project initialization with
- Share the production URL after deployment
What happens behind the scenes
- MCP server searches deployment documentation
- Returns context-aware guidance based on your project type
- Provides commands specific to static site deployment
Create analytics queries
Generate GraphQL queries for Real-Time Metrics without memorizing the schema.
Example: Traffic analysis
Request
You: "Create a GraphQL query to show my application's trafficfrom the last 7 days, grouped by edge location."
Response
query TrafficByLocation {httpMetrics( filter: { tsRange: {begin: "2025-01-02T00:00:00", end: "2025-01-09T00:00:00"} } groupBy: [edgeLocation] orderBy: [requestsCount_DESC]) { edgeLocation requestsCount dataTransferredIn dataTransferredOut bandwidthMbps}}
Example: Cache performance
Request
You: "Generate a query to analyze cache hit rates for my images."
Response
query CachePerformance {httpMetrics( filter: { tsRange: {begin: "2025-01-08T00:00:00", end: "2025-01-09T00:00:00"} requestUri: {like: "%.jpg%|%.png%|%.webp%"} } groupBy: [cacheStatus]) { cacheStatus requestsCount dataTransferredOut averageRequestTime}}
Configure Rules Engine
Create complex Rules Engine configurations using natural language descriptions.
Example: Security headers
Request
You: "Create Rules Engine rules to add security headers includingHSTS, X-Frame-Options, and CSP for my application."
Response
{"rules": [ { "name": "Security Headers", "criteria": [ { "conditional": "if", "variable": "${uri}", "operator": "starts_with", "value": "/" } ], "behaviors": [ { "name": "add_response_header", "target": "Strict-Transport-Security", "value": "max-age=31536000; includeSubDomains" }, { "name": "add_response_header", "target": "X-Frame-Options", "value": "DENY" }, { "name": "add_response_header", "target": "Content-Security-Policy", "value": "default-src 'self'" } ] }]}
Example: Cache optimization
Request
You: "Configure Rules Engine to cache static assets for 1 yearand API responses for 5 minutes."
Response
{"rules": [ { "name": "Static Assets Cache", "criteria": [ { "conditional": "if", "variable": "${uri}", "operator": "matches", "value": "\\.(jpg|jpeg|png|gif|css|js|woff2?)$" } ], "behaviors": [ { "name": "set_cache_policy", "target": "31536000", "browser_cache": true, "cdn_cache": true } ] }, { "name": "API Cache", "criteria": [ { "conditional": "if", "variable": "${uri}", "operator": "starts_with", "value": "/api/" } ], "behaviors": [ { "name": "set_cache_policy", "target": "300", "browser_cache": false, "cdn_cache": true } ] }]}
Search documentation
Get instant answers about Azion Platform features and capabilities.
Common queries
Query | Tool Used | Result |
---|---|---|
”How do I configure DDoS protection?” | search_azion_docs_and_site | DDoS Protection setup guide |
”Show me Next.js deployment examples” | search_azion_code_samples | Next.js templates and samples |
”What CLI commands manage edge functions?” | search_azion_cli_commands | Functions-related CLI commands |
”How to create Terraform resources?” | search_azion_terraform | Terraform provider examples |
Troubleshooting deployments
Get help diagnosing and fixing deployment issues.
Example workflow
Request
You: "My deployment is failing with error 503. How can I debug this?"
Response
-
Check deployment logs:
Terminal window azion logs --type edge --tail -
Verify origin configuration:
- The assistant searches for origin troubleshooting docs
- Provides checklist of common origin issues
-
Test origin connectivity:
Terminal window curl -I https://your-origin.com -
Review Rules Engine:
- Checks for redirect loops
- Validates cache configurations
-
Monitor Real-Time Metrics:
- Generates GraphQL query for error analysis
Framework-specific deployments
Get tailored guidance for your specific framework.
Supported frameworks
The MCP server provides specialized guidance for:
- Next.js: SSR/SSG configuration, API routes, middleware
- React: SPA deployment, routing configuration
- Vue.js: Build optimization, history mode setup
- Angular: Production builds, service workers
- Astro: Static and SSR modes, integrations
- Remix: Edge deployment, data loading
- SvelteKit: Adapter configuration, endpoints
Example: Next.js with ISR
You: "Deploy my Next.js app with Incremental Static Regeneration"
The assistant will:
- Check for Next.js in your project
- Configure
azion.config.js
for ISR support - Set up proper cache policies
- Deploy with optimized settings
- Provide monitoring queries for ISR performance
Advanced workflows
Multi-environment deployment
You: "Set up staging and production environments for my app"
The assistant helps:
- Create separate edge applications
- Configure environment variables
- Set up deployment pipelines
- Implement proper domain routing
Performance optimization
You: "Optimize my site's Core Web Vitals scores"
The assistant provides:
- Image optimization strategies
- Cache configuration recommendations
- Rules Engine for resource hints
- GraphQL queries to monitor improvements
Tips for effective use
- Be specific: Provide context about your project type and requirements
- Iterative refinement: Start simple and add complexity gradually
- Combine tools: Use multiple MCP tools together for comprehensive solutions
- Learn patterns: Save successful configurations for reuse