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. 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.

MCP servers

Astro provides the following MCP servers:
  • Astro MCP server (astro) is an authenticated remote MCP server for reading your Astro resources, including Deployments, Workspaces, environment objects, and Organization settings, and the Dags, Dag runs, and Airflow REST API of your Deployments. It signs you in with your own Astro credentials and respects your existing permissions. This server replaces the deprecated Astro Cloud MCP server.
  • Astro Cloud MCP server (astro-cloud) is deprecated and replaced by the Astro MCP server. See the following warning.
Astro Cloud MCP server deprecationThe Astro Cloud MCP server (astro-cloud) is deprecated and shouldn’t be used. It’s replaced by the Astro MCP server. Migrate any existing astro-cloud configuration to the new server. Unlike astro-cloud, which required an Organization ID and an API token, the Astro MCP server signs you in with your Astro credentials.

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 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.
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.

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.

Airflow MCP plugin

The Airflow MCP plugin (astro-airflow-mcp) is an open-source package that installs directly into an Airflow Deployment and exposes an MCP endpoint on the webserver. This gives AI tools direct access to Airflow’s REST API — Dags, task logs, connections, variables, and more — without running a separate server. Unlike the Astro MCP server, which provides read access across all Deployments you can access and signs you in with your Astro credentials, the Airflow MCP plugin runs inside a single Deployment and authenticates with a Deployment API token. It provides Airflow-level access for that Deployment: listing Dags, viewing task logs, inspecting connections, diagnosing failures, and more. The plugin auto-detects the installed Airflow version and registers the appropriate integration:
  • Airflow 3.x: Mounts as a FastAPI app on the API server.
  • Airflow 2.x (2.4 or later): Registers as a Flask blueprint on the webserver.

Prerequisites

  • An Airflow Deployment on Astro. The plugin supports Airflow 3.x (Runtime 3.1 or later) and Airflow 2.x (2.4 or later).
  • A Deployment API token with a role that allows POST requests (required by the MCP protocol). See Configure authentication for role options.

Install the plugin

Add astro-airflow-mcp to your Astro project’s requirements.txt:
Deploy the change. The package auto-registers as an Airflow plugin — no Dockerfile changes or additional configuration needed.

Set environment variables

After deploying, set the following environment variable on your Deployment to block write operations:
In plugin mode, the MCP server always runs in stateless HTTP mode, so Claude Code and other MCP clients work without additional configuration. The FASTMCP_STATELESS_HTTP environment variable applies only when running the MCP server as a standalone process.

Configure authentication

The MCP protocol uses POST requests for all operations, including read-only ones. Your Deployment API token does not need write permissions for read-only MCP access: authorization is still based on the underlying Airflow permissions, so a custom role with read permissions such as *.get is sufficient. The important exception is WORKSPACE_MEMBER, which Astro’s auth proxy blocks from making the POST requests the MCP protocol requires.

Option A: Use a built-in role

Create a Deployment API token with one of the following roles:
  • DEPLOYMENT_ADMIN — Full access (works but overprivileged)
  • WORKSPACE_OPERATOR or WORKSPACE_AUTHOR — Moderate privilege
WORKSPACE_MEMBER does not work with the MCP plugin. Astro’s auth proxy blocks POST requests for this role, which prevents the MCP protocol handshake from completing.
For least-privilege access, create a custom Deployment role that includes only read permissions. This ensures the token can use all MCP read tools but cannot modify any Airflow resources.
  1. In the Astro UI, go to Settings, then in the Access Management section, click Roles & Permissions, click Custom, then click + New Custom Role.
  2. Set the Scope to Deployment.
  3. Name the role MCP_VIEWER with a description like “Read-only access for Airflow MCP plugin.”
  4. Select all deployment.airflow.*.get permissions. See Custom role permissions reference for the full list. The role should include these 28 permissions:
  5. Click Create role.
Then create a Deployment API token with the new role:

Connect your MCP client

After the plugin is deployed and a token is created, the MCP endpoint is available at:
You can find your Deployment’s webserver URL in the Astro UI on the Deployment’s overview page.
Use -t http, not -t sse. The MCP endpoint returns SSE-formatted responses, but the correct Claude Code transport type is http. Using -t sse causes the connection to fail.

Troubleshooting