Skip to main content
Astro provides Model Context Protocol (MCP) servers that allow AI models and agents to securely access your Astro and Airflow resources. Connect to MCP servers from compatible AI clients. This page covers the MCP servers that Astro provides for your AI tools to connect to. To let Otto query your own MCP servers during investigations and Routines, see Connect Otto to your MCP servers. To give an agent access to the Astronomer documentation instead of your Astro resources, see Use these docs with AI. For enhanced agent capabilities such as Dag authoring, testing, and debugging, see the Astronomer AI Agent tooling repository. The Astro MCP server (astro) is an authenticated remote MCP server for reading your Astro resources, including Deployments, Workspaces, environment objects, and Organization settings, and for reading and changing the Dags, Dag runs, and other Airflow resources of your Deployments through the Airflow REST API. It signs you in with your own Astro credentials and respects your existing permissions.

Set up the Astro MCP server

LabsThis feature is in Labs and is available to all Astro Organizations.
The Astro MCP server provides read access to your Astro resources and to the Airflow environment of each Deployment you can access. It can also change Airflow resources through the Airflow REST API, start Otto investigations of failed Dag runs, and send feedback to Astronomer. It provides the following tools: The Astro MCP server signs you in with your Astro credentials, so each tool returns only the resources that your existing permissions allow you to view. The investigation tools are available only to Organizations that have Otto investigations enabled. They require permission to view task logs for the whole Deployment. A Dag-level role isn’t enough. write_airflow_api and delete_airflow_api send each request with your credentials, so Airflow accepts only the changes that your permissions in the Deployment allow. These tools can’t change Airflow connections, variables, configuration, authentication, users, or roles. The Astro MCP server never retries a write. If a write times out, check whether Airflow applied the change before you send it again. Each connection to the Astro MCP server acts on one Organization. The server takes the Organization from the organizationId query parameter in the server URL:
If you belong to only one Organization, you can leave out the parameter. If you belong to more than one Organization, you must add it, or every tool call fails. To find your Organization ID, open the Astro UI and go to Settings. To use more than one Organization, add a separate connection for each Organization. In the following client instructions, replace the server URL with this URL if your account belongs to more than one Organization.
Claude Code connects to remote MCP servers natively without the mcp-remote module.
To authenticate, run /mcp in Claude Code and select the astro server. Claude Code opens a browser window so you can sign in with your Astro credentials.
You can also connect through an internal AI gateway if your organization uses one. Contact your Astronomer account team for details.

Authenticate with an API token

Instead of signing in through a browser, you can authenticate with an Organization API token, a Workspace API token, or a Deployment API token. Use this option for automated agents and other clients that can’t complete a browser sign-in. Send the token in the Authorization header. For example, in Claude Code:
The MCP server tools return only the resources that the token’s role allows. To limit an agent to read access, assign the token a role without write permissions, or connect in read-only mode.

Restrict write tools

LabsThis feature is in Labs and is available to all Astro Organizations.
The following Astro MCP server tools change data in your Organization:
  • write_airflow_api
  • delete_airflow_api
  • start_investigation
Write tools are on by default. You can turn them off for a whole Organization, or for one connection.

Turn off write tools for an Organization

An Organization Owner can turn off write tools for every user in the Organization. When write tools are off, the Astro MCP server doesn’t list them and refuses a call to one of them. Agents can still use the read tools and submit_feedback.
  1. In the Astro UI, go to Settings.
  2. In the AI section, turn off Astro MCP Write Tools.
To turn write tools back on, turn on Astro MCP Write Tools. An MCP client can keep the list of tools it received when it connected, so reconnect the client to see the write tools again.

Connect in read-only mode

To hold one connection to read access, add readOnly=true to the server URL:
If you also set an Organization ID, join the two parameters with &:
In read-only mode, the Astro MCP server doesn’t list write tools and refuses a call to one of them. submit_feedback still works.
Read-only mode is a setting of the client, not a security control. Anyone with the credentials for the connection can remove the parameter. To enforce read access, turn off write tools for the Organization or use an API token whose role has no write permissions.

Approve redirect URIs for MCP clients

LabsThis feature is in Labs and is available to all Astro Organizations.
When you sign in to an MCP client with OAuth, Astro sends the authorization code to the client’s redirect URI, the HTTPS URL that the client sends you back to. The resulting token reaches every Organization you belong to, so Astro sends the code only after all of those Organizations approve the redirect URI, and only after you confirm the sign-in. Astro approves some clients by default, including Claude.ai and local clients, so most people can connect without any setup. Approve a redirect URI when your users connect through a client that Astro doesn’t already approve, such as an MCP client that your company builds or hosts.

Prerequisites

  • Organization Owner permissions to approve or remove a redirect URI. Any Organization member can view the approved list.

Approve a redirect URI

  1. In the Astro UI, go to Settings, then in the Security section, click MCP Redirect URIs.
  2. Click + New Redirect URI.
  3. Enter the exact HTTPS URL that the MCP client sends users back to, then click Approve Redirect URI.
Approve only redirect URIs that your company controls. After you approve a URI, any user in your Organization can complete an OAuth sign-in that delivers an authorization code to that URL, and the token it produces carries that user’s Astro permissions.
A redirect URI must be an exact HTTPS URL, such as https://mcp-client.example.com/oauth/callback. Astro rejects a URL that contains a wildcard, a fragment, or user information. Each Organization can approve up to 100 redirect URIs. To stop accepting a client, remove its redirect URI from the same page. Removing a URI immediately blocks new sign-ins through that URL, but a client that’s already signed in keeps its access until its token expires.

If a redirect URI isn’t approved

If any Organization you belong to hasn’t approved the client’s redirect URI, Astro doesn’t send the authorization code and shows you which Organizations still need to approve it. Ask an Organization Owner in each one to approve the URI, then sign in again.