Amazon Managed Prometheus MCP Server
Provides access to Amazon Managed Prometheus workspaces, enabling listing of workspaces, querying metrics with PromQL, retrieving workspace details and status, and executing Prometheus queries for monitoring and observability data.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Amazon Managed Prometheus MCP Server list all my Prometheus workspaces"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Amazon Managed Prometheus MCP Server
An MCP (Model Context Protocol) server that provides access to Amazon Managed Prometheus workspaces using the FastMCP SDK and uv for fast Python package management.
Features
List Amazon Managed Prometheus workspaces
Get workspace details and configuration
Query metrics from Prometheus workspaces
Execute PromQL queries
Get workspace status and metadata
Fast dependency management with
uv
Related MCP server: Prometheus MCP Server
Prerequisites
Install uv (if not already installed):
# On macOS and Linux curl -LsSf https://astral.sh/uv/install.sh | sh # On Windows powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # Or with pip pip install uvAWS Credentials: Configure AWS credentials (one of the following):
AWS CLI:
aws configureEnvironment variables:
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_REGIONIAM roles (if running on EC2)
Installation
Quick Start with uv
# Clone or navigate to the project directory
cd prometheus-mcp-server
# Create virtual environment and install dependencies
uv sync
# Activate the virtual environment
source .venv/bin/activate # On Unix/macOS
# or
.venv\Scripts\activate # On Windows
# Run the server
uv run prometheus-mcp-serverDevelopment Installation
# Install with development dependencies
uv sync --extra dev
# Install with test dependencies
uv sync --extra test
# Install all optional dependencies
uv sync --all-extrasAlternative Installation Methods
# Install in editable mode
uv pip install -e .
# Install from PyPI (when published)
uv pip install prometheus-mcp-server
# Install specific version
uv pip install prometheus-mcp-server==0.1.0Usage
Running the MCP Server
# Using uv run (recommended)
uv run prometheus-mcp-server
# Or after activating virtual environment
prometheus-mcp-server
# Run with specific region
AWS_REGION=us-west-2 uv run prometheus-mcp-serverTesting the Server
# Run all tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=prometheus_mcp_server
# Run integration tests
uv run python test_demo.py
# Run simple server test
uv run python src/prometheus_mcp_server/simple_server.pyDevelopment Commands
# Format code
uv run black src/ tests/
uv run isort src/ tests/
# Lint code
uv run ruff check src/ tests/
# Type checking
uv run mypy src/
# Run all quality checks
uv run black --check src/ tests/
uv run isort --check-only src/ tests/
uv run ruff check src/ tests/
uv run mypy src/
uv run pytestRequired AWS Permissions
The server requires the following AWS permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"aps:ListWorkspaces",
"aps:DescribeWorkspace",
"aps:QueryMetrics"
],
"Resource": "*"
}
]
}Available Tools
list_workspaces: List all Amazon Managed Prometheus workspacesget_workspace: Get detailed information about a specific workspacequery_metrics: Execute PromQL queries against a workspaceget_workspace_status: Get the current status of a workspace
Configuration
Environment Variables
# AWS Configuration
export AWS_REGION=us-east-1
export AWS_ACCESS_KEY_ID=your_access_key
export AWS_SECRET_ACCESS_KEY=your_secret_key
# Optional: Enable debug logging
export LOG_LEVEL=DEBUGMCP Client Configuration
Example configuration for MCP clients:
{
"mcpServers": {
"prometheus": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/prometheus-mcp-server",
"prometheus-mcp-server"
],
"env": {
"AWS_REGION": "us-east-1"
}
}
}
}Development with uv
Adding Dependencies
# Add runtime dependency
uv add boto3
# Add development dependency
uv add --dev pytest
# Add optional dependency
uv add --optional test pytest-mockManaging Python Versions
# Use specific Python version
uv python install 3.11
uv sync --python 3.11
# List available Python versions
uv python listVirtual Environment Management
# Create virtual environment
uv venv
# Activate virtual environment
source .venv/bin/activate
# Deactivate
deactivate
# Remove virtual environment
rm -rf .venvProject Structure
prometheus-mcp-server/
├── src/prometheus_mcp_server/
│ ├── __init__.py # Package initialization
│ ├── main.py # Main MCP server with FastMCP tools
│ ├── auth.py # AWS SigV4 authentication utilities
│ ├── client.py # Enhanced client with authentication
│ └── simple_server.py # Simple test server
├── tests/
│ ├── test_prometheus_server.py # Original unit tests
│ └── test_simple_server.py # Simple server tests
├── examples/
│ ├── example_usage.py # Usage examples
│ └── mcp_config.json # MCP client configuration
├── pyproject.toml # Project configuration with uv support
├── .python-version # Python version specification
├── README.md # This file
├── test_demo.py # Comprehensive test demonstration
└── TEST_RESULTS.md # Test results documentationPerformance Benefits with uv
Fast Installation: Up to 10-100x faster than pip
Reliable Resolution: Better dependency resolution
Disk Efficient: Shared package cache
Reproducible Builds: Lock file ensures consistency
Cross-Platform: Works on Windows, macOS, and Linux
Troubleshooting
Common Issues
FastMCP not found:
# Install FastMCP from GitHub uv add git+https://github.com/jlowin/fastmcp.gitAWS Credentials Error:
# Configure AWS credentials aws configure # or set environment variables export AWS_ACCESS_KEY_ID=your_key export AWS_SECRET_ACCESS_KEY=your_secretPermission Denied:
Ensure IAM user/role has required AMP permissions
Check AWS region configuration
Debug Mode
# Enable verbose logging
LOG_LEVEL=DEBUG uv run prometheus-mcp-server
# Run with AWS debug
AWS_DEBUG=1 uv run prometheus-mcp-serverContributing
Fork the repository
Create a feature branch:
git checkout -b feature-nameInstall development dependencies:
uv sync --extra devMake your changes
Run tests:
uv run pytestRun quality checks:
uv run black src/ && uv run ruff check src/Commit your changes:
git commit -am 'Add feature'Push to the branch:
git push origin feature-nameCreate a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
v0.1.0
Initial release
Basic workspace listing and querying
AWS authentication support
Multi-region support
uv package management integration
Available Tools
4 toolsget_workspaceC
Get detailed information about a specific Amazon Managed Prometheus workspace.
Args: workspace_id: The ID of the workspace to retrieve region: AWS region where the workspace is located (default: us-east-1)
Returns: JSON string containing workspace details
Inputs: workspace_id (required), region. Returns: result
get_workspace_statusB
Get the current status of an Amazon Managed Prometheus workspace.
Args: workspace_id: The ID of the workspace region: AWS region where the workspace is located (default: us-east-1)
Returns: JSON string containing workspace status information
Inputs: workspace_id (required), region. Returns: result
list_workspacesA
List all Amazon Managed Prometheus workspaces in the specified region.
Args: region: AWS region to query (default: us-east-1)
Returns: JSON string containing list of workspaces with their details
Inputs: region. Returns: result
query_metricsA
Execute a PromQL query against an Amazon Managed Prometheus workspace.
Args: workspace_id: The ID of the workspace to query query: PromQL query string region: AWS region where the workspace is located (default: us-east-1) start_time: Start time for range queries (RFC3339 format) end_time: End time for range queries (RFC3339 format) step: Query resolution step for range queries (e.g., "15s", "1m")
Returns: JSON string containing query results or preparation details
Inputs: query (required), workspace_id (required), end_time, region, +2 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: list_workspaces enumerates all workspaces, get_workspace retrieves detailed information, get_workspace_status checks status, and query_metrics executes PromQL queries. There is no overlap or ambiguity between these functions.
All tool names follow a consistent verb_noun pattern with snake_case: list_workspaces, get_workspace, get_workspace_status, and query_metrics. The naming is predictable and readable throughout.
Four tools is reasonable for a focused Prometheus monitoring server, covering core operations like listing, retrieving, checking status, and querying. It might be slightly thin for full CRUD operations, but it aligns well with the server's purpose.
The tools cover read and query operations effectively, but there are notable gaps in write operations (e.g., create, update, or delete workspaces). This limits agents to monitoring and querying without management capabilities, which could be a constraint for full lifecycle workflows.
Related MCP Connectors
List datasets, schemas, run APL queries, and use prompts for exploration, anomalies, and monitoring.
AWS Cost Explorer cost, forecast, and anomaly reporting through user-connected IAM credentials.
Amazon Ads, Seller Central, Vendor Central and AMC data for AI agents. Read-only by default.
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides access to Prometheus metrics and queries through standardized Model Context Protocol interfaces, allowing AI assistants to execute PromQL queries and analyze metrics data.6526MIT
- AlicenseNot gradedqualityDmaintenanceA tool that enables access to Prometheus metrics data through a Model Context Protocol server, allowing interaction with monitoring data using natural language.MIT
- AlicenseNot gradedqualityDmaintenanceA tool that lets users access Prometheus metrics data through a Model Context Protocol server, supporting authentication options for secure data retrieval.1MIT
- AlicenseBqualityFmaintenanceProvides seamless integration between AI assistants and Prometheus, enabling natural language interactions with your monitoring infrastructure. This server allows for effortless querying, discovery, and analysis of metrics.10655 npm27MIT