Troubleshoot a deployment with the MCP server
Ask a coding agent connected to the Azion MCP servers to debug a deployment that returns error 503, and to propose Core Web Vitals improvements.
You can debug a deployment that fails with error 503 by asking a coding agent connected to the Azion MCP servers for a workflow, then checking each point it raises. The same agent proposes ways to improve the Core Web Vitals scores of a site. The docs server only reads documentation. The build server can apply a fix to your account, and each of its write tools previews the request without running it when the agent sets dry_run. For problems with the MCP servers themselves, refer to Troubleshoot the MCP server.
Prerequisites
- An application deployed on Azion that returns error 503, and its URL.
- A coding agent connected to the docs server,
https://docs-mcp.azion.com/mcp. To write the GraphQL query, also connect the observe server,https://observe-mcp.azion.com/mcp. To connect a server, refer to MCP server quickstart. - The Azion CLI, installed and logged in. To set it up, refer to Azion CLI quickstart.
curlon your machine.
Debug a 503 error with your agent
The agent searches the Azion documentation for the error and returns a debugging workflow of five checks. You run each check, in order, and give the agent what you find. To debug the deployment:
Send the agent a prompt that names the error, such as:
The prompt reaches the search_azion_docs_and_site tool, which returns Azion documentation on debugging.
Read the HTTP event logs of your applications with the Azion CLI:
The command prints the logs of the last 5 minutes and keeps running, one entry per request with its status. Look for the entries with status 503. --limit sets how many entries the command shows, and --pretty prints each field on its own line. For the console logs of a function, run azion logs cells. For every flag, refer to Azion CLI logs.
Azion reaches your origin through a connector. The agent searches for connector troubleshooting documentation and gives you a checklist of common connector issues. For the symptoms and their fixes, refer to Troubleshoot Connectors.
Request the headers of your origin directly, replacing the host with yours:
The command prints the status line and the headers the origin returns.
With the agent, check the rules of your application for redirect loops, and validate the cache configurations the rules apply. For the criteria and behaviors a rule takes, refer to Rules Engine for Applications.
Ask the agent for a GraphQL query that analyzes the errors of your application in Real-Time Metrics. For how the observe server writes and validates a query, refer to Generate GraphQL queries with the MCP server.
You end with the log entries of the failing requests, the results of the connector and origin checks, and the rules to correct. Apply each change in your application, or ask an agent connected to the build server to apply it, with a dry_run preview first.
Optimize Core Web Vitals with your agent
A request to improve the Core Web Vitals scores of a site returns proposals in four areas. To ask for them, send the agent a prompt such as:
The agent provides:
- Image optimization strategies.
- Cache configuration recommendations.
- Rules Engine rules for resource hints.
- GraphQL queries to monitor the improvements.
You apply the rules and cache changes in your application, or ask an agent connected to the build server to create them, and you run the queries with the GraphQL API. To create a rule through the build server, refer to Create Rules Engine rules with the MCP server.