A Model Context Protocol (MCP) server that provides access to Swarmia's Export API. This server allows you to fetch various metrics and reports from Swarmia including pull request metrics, DORA metrics, investment balance reports, software capitalization reports, and effort reporting. This MCP server provides access to the following Swarmia Export API endpoints: - Pull Request Metrics - Cycle time
Add this skill
npx mdskills install mattjegan/swarmia-mcpComprehensive MCP server for Swarmia metrics with clear tool docs and setup
A Model Context Protocol (MCP) server that provides access to Swarmia's Export API. This server allows you to fetch various metrics and reports from Swarmia including pull request metrics, DORA metrics, investment balance reports, software capitalization reports, and effort reporting.
This MCP server provides access to the following Swarmia Export API endpoints:
To use this MCP server with your favourite MCP client (E.g. Claude, Cursor etc.):
make install
{
"mcpServers": {
"swarmia": {
"command": "/path/to/swarmia-mcp/venv/bin/python3",
"args": ["/path/to/swarmia-mcp/swarmia_mcp_server.py"],
"env": {
"SWARMIA_API_TOKEN": "your_api_token_here"
}
}
}
}
Restart your client application
Ask for some metrics Example queries:
make install
export SWARMIA_API_TOKEN="your_api_token_here"
For a complete setup including dependency installation and environment checks:
make setup
To run the server:
make run
Or directly:
python3 swarmia_mcp_server.py
The server will start and listen for MCP client connections via stdio.
The server provides the following tools:
get_pull_request_metricsGet pull request metrics for the organization.
Parameters:
timeframe (optional): Predefined timeframe (last_7_days, last_14_days, last_30_days, etc.)start_date (optional): Start date in YYYY-MM-DD format (alternative to timeframe)end_date (optional): End date in YYYY-MM-DD format (alternative to timeframe)timezone (optional): Timezone for data aggregation (default: UTC)Returns: CSV data with columns including Start Date, End Date, Team, Cycle Time, Review Rate, Time to first review, PRs merged/week, Merge Time, PRs in progress, Contributors.
get_dora_metricsGet DORA metrics for the organization.
Parameters:
timeframe (optional): Predefined timeframestart_date (optional): Start date in YYYY-MM-DD formatend_date (optional): End date in YYYY-MM-DD formattimezone (optional): Timezone for data aggregationapp (optional): Deployment application name(s), comma-separatedenvironment (optional): Deployment environment(s), comma-separatedReturns: CSV data with DORA metrics including Deployment Frequency, Change Lead Time, Average Time to Deploy, Change Failure Rate, Mean Time to Recovery, Deployment Count.
get_investment_balanceGet investment balance statistics using the Effort model.
Parameters:
start_date (required): First day of the month in YYYY-MM-DD formatend_date (required): Last day of the month in YYYY-MM-DD formattimezone (optional): Timezone for data aggregationReturns: CSV data with investment categories, FTE months, relative percentages, and activity counts.
get_software_capitalization_reportGet software capitalization report with employee contributions.
Parameters:
start_date (required): First day of the start month in YYYY-MM-DD formatend_date (required): Last day of the end month in YYYY-MM-DD formattimezone (optional): Timezone for data aggregationReturns: CSV data with employee details, capitalizable work, developer months, and additional context.
get_software_capitalization_employeesGet list of employees with FTE effort breakdown by month.
Parameters:
year (required): Year for the report (e.g., 2024)timezone (optional): Timezone for data aggregationReturns: CSV data with employee details and monthly FTE breakdowns.
get_effort_reportingGet effort reporting for authors and their FTE for each issue.
Parameters:
month (required): Month in YYYY-MM-DD format (first day of the month)timezone (optional): Timezone for data aggregationcustom_field (optional): Jira field ID to include as Custom field columngroup_by (optional): How FTE rows should be grouped (highestLevelIssue, lowestLevelIssue, customField)Returns: CSV data with author details, FTE contributions, and issue information.
SWARMIA_API_TOKEN: Your Swarmia API token (required)The following predefined timeframes are available:
last_7_dayslast_14_dayslast_30_dayslast_60_dayslast_90_dayslast_180_dayslast_365_daysYou can specify any timezone using tz database identifiers (e.g., America/New_York, Europe/London, Asia/Tokyo). The default is UTC.
This MCP server is based on the Swarmia Export API documentation.
https://app.swarmia.com/api/v0
The server uses token-based authentication. Your API token is passed as a query parameter to all requests.
The server includes comprehensive error handling for:
The server logs all activities at the INFO level. You can adjust the logging level by modifying the logging.basicConfig() call in the server code.
The project includes a comprehensive Makefile with the following targets:
make help - Show available targets and help informationmake install - Install dependencies and setup the projectmake setup - Complete setup (install + environment checks)make test - Test the API connection and server functionalitymake run - Run the MCP servermake check-env - Check if required environment variables are setmake clean - Clean up temporary filesmake format - Format code with black (if available)make lint - Lint code with flake8 (if available)make type-check - Type check with mypy (if available)make quality - Run all quality checksmake info - Show project informationTo test the server:
make test
Here's an example of how you might use this server with an MCP client:
# Example: Get pull request metrics for the last 30 days
result = await client.call_tool(
"get_pull_request_metrics",
{
"timeframe": "last_30_days",
"timezone": "America/New_York"
}
)
# Example: Get DORA metrics for a specific date range
result = await client.call_tool(
"get_dora_metrics",
{
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"app": "my-app",
"environment": "production"
}
)
# Example: Get investment balance for January 2024
result = await client.call_tool(
"get_investment_balance",
{
"start_date": "2024-01-01",
"end_date": "2024-01-31"
}
)
"SWARMIA_API_TOKEN environment variable is required"
SWARMIA_API_TOKEN environment variable"API request failed with status 401"
"API request failed with status 403"
"Request failed: Connection timeout"
app.swarmia.com is accessible from your networkInstall via CLI
npx mdskills install mattjegan/swarmia-mcpSwarmia MCP Server is a free, open-source AI agent skill. A Model Context Protocol (MCP) server that provides access to Swarmia's Export API. This server allows you to fetch various metrics and reports from Swarmia including pull request metrics, DORA metrics, investment balance reports, software capitalization reports, and effort reporting. This MCP server provides access to the following Swarmia Export API endpoints: - Pull Request Metrics - Cycle time
Install Swarmia MCP Server with a single command:
npx mdskills install mattjegan/swarmia-mcpThis downloads the skill files into your project and your AI agent picks them up automatically.
Swarmia MCP Server works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.