Skip to main content

Check out Port for yourselfย 

Query DORA metrics using Port MCP

This guide demonstrates how to use Port's Model Context Protocol (MCP) server to query DORA metrics using natural language commands directly from your IDE or AI-powered tools. By leveraging the MCP server, you can access deployment frequency, lead time, change failure rate, and mean time to recovery data without leaving your development environment.

Common use casesโ€‹

  • Team performance analysis: Compare DORA metrics across different teams to identify top performers and areas for improvement.
  • Sprint retrospectives: Get quick insights into deployment frequency and lead times during team retrospectives.
  • Engineering leadership reporting: Generate on-demand reports for stakeholders about team velocity and reliability.
  • Incident response: Quickly assess team MTTR during post-incident reviews and identify patterns.
  • Continuous improvement: Monitor trends in change failure rates and deployment frequencies over time.

Prerequisitesโ€‹

This guide assumes you have:

  • A Port account with deployment and incident data available.
  • Cursor IDE installed (we'll focus on Cursor, but you can also use VSCode, Claude, or other MCP-compatible tools).
  • Basic understanding of DORA metrics concepts.
Two approaches to DORA metrics with MCP

Port's MCP server enables DORA insights in two complementary ways:

  1. With DORA Metrics Experience: If you have DORA metrics set up, the MCP provides deterministic results over time, customized dashboards, and team-specific views. This gives you consistent, aggregated metrics that align with your organization's definitions.

  2. Dynamic DORA Calculations: Even without the formal DORA metrics setup, the MCP server can analyze your deployment and incident data on-the-fly to calculate DORA metrics. This approach provides quick insights for data you might not have aggregated yet in a proper way, letting you explore different definitions and time periods flexibly.

Both approaches work together - you can start with dynamic calculations to explore your data, then implement the DORA experience for consistent tracking and dashboards.

Set up Port MCP serverโ€‹

The Port MCP server enables you to interact with your Port data using natural language queries directly from your IDE or AI tools.

Installing Port MCPโ€‹

Installing Port's MCP is simple. Follow the instructions for your preferred tool, or learn about the archived local MCP server.

To connect Cursor to Port's remote MCP, follow these steps:

  1. Open Cursor settings

    Go to Cursor settings, click on Tools & Integrations, and add a new MCP server.

  2. Configure the MCP server

    Add the appropriate configuration for your Port region:

{
"mcpServers": {
"port-eu": {
"url": "https://mcp.port.io/v1"
}
}
}
  1. Authenticate with Port

    Click on "Needs login" and complete the authentication flow in the window that opens.

  2. Verify connection

    After successful authentication, you'll see the list of available tools from the MCP server.

Authentication window behavior

In some cases, after clicking "Accept" in the authentication popup, the window won't get closed but the connection is established successfully. You can safely close the window.

If you still don't see the tool, try it a couple of times. We are aware of this behavior and working to improve it.

Let's test the queriesโ€‹

Once you have the MCP server configured, you can start using natural language to query your DORA metrics.

Start a new chat session

  1. Open a new chat session in Cursor (Cmd/Ctrl + L).
  2. You should see the Port tools available in the tools panel.
  3. Start your conversation with DORA metrics queries.

Example DORA metrics queries

Here are practical examples of questions you can ask to get insights from your DORA metrics:

Team performance analysis

Query: "What is the Stardust team's MTTR?"

This query helps you understand how quickly the Stardust team recovers from incidents, which is crucial for assessing team reliability and incident response capabilities.

Query: "Compare DORA metrics between The magicians and Opus teams"

Compare deployment frequency, lead time, and incident metrics between two teams to identify performance differences and opportunities to share best practices.

Deployment analysis

Query: "How many deployments did we have last week, broken down by team?"

Get a comprehensive view of deployment activity across all teams to understand deployment frequency patterns.

Query: "Show me the deployment frequency for the Data Infra team over the last month"

Analyze deployment patterns for a specific team to understand their release cadence and velocity trends.

Change failure rate analysis

Query: "What's our change failure rate for production deployments this quarter?"

Monitor the percentage of deployments that result in failures, helping assess deployment quality and process effectiveness.

Query: "Compare change failure rates between the Frontend and Backend teams"

Identify teams that might need additional support or process improvements in their deployment practices.

Lead time insights

Query: "What's the average lead time for changes in the last 30 days?"

Get visibility into how long it takes to deliver code changes to production across your organization.

Query: "Show me lead time trends for the Jokers team over the last 3 months"

Track improvement or degradation in a team's delivery speed over time to identify process changes or bottlenecks.

Advanced querying techniques

Time ranges and filtering:

  • "Show me DORA metrics for services tagged as 'critical' in the last 30 days."
  • "What's the deployment frequency for deployments owned by the Stardust team since last month?"
  • "Show me all incidents with priority 'high' or 'critical' resolved in the last 30 days."

Understanding the responsesโ€‹

The MCP server responses rely on Port's data model, using the available MCP tools to access and analyze your data. You can:

Get detailed insights and take action

  • Ask your LLM to explain the results and provide context.
  • Request actionable recommendations like "how can we improve the lead time?"
  • Take follow-up actions directly through the MCP server.

Dive deeper into results

  • Drill down into specific metrics with follow-up questions.
  • Cross-reference DORA metrics with other Port data like service health or scorecards.
  • Explore different time periods or team comparisons.

Request custom visualizations

  • Ask to show results in a graph or chart format.
  • Request to create a custom web application to visualize the data (Claude Artifacts is excellent for this).
  • Generate executive-ready dashboards and reports.
Getting better results

To get the most accurate and useful responses:

  • Be specific about time ranges (e.g., "last 30 days" instead of "recently").
  • Specify teams, services, or environments when relevant.
  • Ask follow-up questions to drill down into interesting data points.
  • Use the MCP server's ability to cross-reference with other Port data like scorecards and service health.

Next stepsโ€‹

Now that you can query DORA metrics using Port MCP, consider these recommendations:

  • Enrich and deepen your DORA data model: Enhance your Port data model with additional deployment and incident sources for faster results and comprehensive dashboards implementation.
  • Find areas for improvement: Use the insights gained to identify specific teams, services, or processes that need attention.
  • Automate reporting: Use the MCP server in an automated way to produce executive reports or weekly team performance summaries.
  • Set up alerts: Configure Port automations to notify teams when DORA metrics cross certain thresholds.
  • Expand analysis: Combine DORA metrics with other Port data like service health, scorecards, and dependencies.

Learn more about DORA metricsโ€‹