Model Context Protocol (MCP) server for Pingera monitoring service integration
Project description
Pingera MCP Server
A Model Context Protocol (MCP) server for the Pingera monitoring service, providing seamless integration between AI models and monitoring data.
Features
- Modular Architecture: Separate Pingera API client library with clean abstractions
- Flexible Operation Modes: Run in read-only or read-write mode
- MCP Resources: Access monitoring data as structured resources (
pingera://pages,pingera://status) - MCP Tools: Execute monitoring operations through tools (list_pages, get_page_details, test_connection)
- Robust Error Handling: Comprehensive error handling with custom exception hierarchy
- Real-time Data: Direct integration with Pingera API v1 for live monitoring data
- Type Safety: Pydantic models for data validation and serialization
- Configurable: Environment-based configuration management
Quick Start
Prerequisites
- Python 3.10+
- UV package manager
- Pingera API key
Installation and Setup
# Install dependencies
uv sync
# Set up your API key (required)
# Add PINGERA_API_KEY to your environment or Replit secrets
# Run the server
python main.py
The server will start in read-only mode by default and connect to the Pingera API.
Claude Desktop Integration
To use this MCP server with Claude Desktop, you need to configure it in your Claude Desktop settings.
Installation
First, install the package globally using UV:
uv tool install pingera-mcp-server
Configuration
Open the Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json
Add the following configuration:
{
"mcpServers": {
"pingera": {
"command": "uv",
"args": [
"run",
"--with",
"pingera-mcp-server",
"--python",
"3.10",
"pingera-mcp"
],
"env": {
"PINGERA_API_KEY": "your_api_key_here",
"PINGERA_MODE": "read_only",
"PINGERA_BASE_URL": "https://api.pingera.ru/v1",
"PINGERA_TIMEOUT": "30",
"PINGERA_MAX_RETRIES": "3",
"PINGERA_DEBUG": "false",
"PINGERA_SERVER_NAME": "Pingera MCP Server"
}
}
}
}
Required Environment Variables
PINGERA_API_KEY- Your Pingera API key (required)
Optional Environment Variables
PINGERA_MODE- Operation mode:read_only(default) orread_writePINGERA_BASE_URL- API endpoint (default:https://api.pingera.ru/v1)PINGERA_TIMEOUT- Request timeout in seconds (default:30)PINGERA_MAX_RETRIES- Maximum retry attempts (default:3)PINGERA_DEBUG- Enable debug logging (default:false)PINGERA_SERVER_NAME- Server display name (default:Pingera MCP Server)
Restart Claude Desktop
After updating the configuration file, restart Claude Desktop to load the new MCP server. You should now be able to access your Pingera monitoring data directly through Claude's interface.
Verify Installation
Once configured, you can ask Claude to:
- "List my monitored status pages"
- "Show details for a specific page"
- "Test the Pingera API connection"
- "Get the current monitoring status"
Configuration
Configure the server using environment variables:
# Required
PINGERA_API_KEY=your_api_key_here
# Optional
PINGERA_MODE=read_only # read_only or read_write
PINGERA_BASE_URL=https://api.pingera.ru/v1
PINGERA_TIMEOUT=30
PINGERA_MAX_RETRIES=3
PINGERA_DEBUG=false
PINGERA_SERVER_NAME=Pingera MCP Server
MCP Tools
Available tools for AI agents:
Pages Management
list_pages- Get paginated list of monitored pages- Parameters:
page,per_page,status
- Parameters:
get_page_details- Get detailed information about a specific page- Parameters:
page_id
- Parameters:
Component Management
list_component_groups- List all component groups for monitoring organizationget_component_details- Get detailed information about a specific component- Parameters:
component_id
- Parameters:
Monitoring Checks
list_checks- List all monitoring checks (HTTP, TCP, ping, etc.)- Parameters:
page,page_size,status,check_type
- Parameters:
get_check_details- Get detailed information about a specific check- Parameters:
check_id
- Parameters:
Alert Rules
list_alert_rules- List all alert rules and their trigger conditions
Heartbeat Monitoring
list_heartbeats- List all heartbeat monitors for cron jobs and scheduled tasks- Parameters:
page,page_size,status
- Parameters:
Incident Management
list_incidents- List all incidents and their current status- Parameters:
page,page_size,status
- Parameters:
Connection Testing
test_pingera_connection- Test API connectivity
Write Operations
- Write operations - Available only in read-write mode (future implementation)
Operation Modes
Read-Only Mode (Default)
- Access monitoring data
- View status pages and their configurations
- Test API connectivity
- No modification capabilities
Read-Write Mode
- All read-only features
- Create, update, and delete monitoring pages (future implementation)
- Manage incidents and notifications (future implementation)
Set PINGERA_MODE=read_write to enable write operations.
Architecture
Pingera API Client Library
Located in pingera/, this modular library provides:
- PingeraClient: Main API client with authentication and error handling
- Models: Pydantic data models for type-safe API responses
- Exceptions: Custom exception hierarchy for error handling
MCP Server Implementation
- FastMCP Framework: Modern MCP server implementation
- Resource Management: Structured access to monitoring data
- Tool Registration: Executable operations for AI agents
- Configuration: Environment-based settings management
Testing
Running the Test Suite
Run all tests:
uv run pytest
Run tests with verbose output:
uv run pytest -v
Run specific test files:
uv run pytest tests/test_models.py
uv run pytest tests/test_config.py
uv run pytest tests/test_mcp_server.py
Run tests with coverage:
uv run pytest --cov=pingera --cov=config --cov=mcp_server
Test Structure
The test suite includes:
- Unit Tests: Testing individual components (models, config, client)
- Integration Tests: Testing MCP server functionality
- Mock Tests: Testing with simulated API responses
Manual Testing
Test the client library directly:
python -c "from pingera import PingeraClient; import os; client = PingeraClient(os.getenv('PINGERA_API_KEY')); print(f'Pages: {len(client.get_pages().pages)}')"
Test MCP server functionality:
python test_mcp_server.py
Error Handling
The system includes comprehensive error handling:
PingeraError: Base exception for all client errorsPingeraAPIError: API response errors with status codesPingeraAuthError: Authentication failuresPingeraConnectionError: Network connectivity issuesPingeraTimeoutError: Request timeout handling
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pingera_mcp_server-0.1.1.tar.gz.
File metadata
- Download URL: pingera_mcp_server-0.1.1.tar.gz
- Upload date:
- Size: 4.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b41af777c24b46f05339e0c556c86581faf41f705092fc20cc1e410090ba60d
|
|
| MD5 |
6b6b25c114a0d676b67bc2a1de59d5b9
|
|
| BLAKE2b-256 |
66759934ec1ba5f9c7e68cae92ad17e35ac5e1f7e57594f8acd240635cc8b469
|
File details
Details for the file pingera_mcp_server-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pingera_mcp_server-0.1.1-py3-none-any.whl
- Upload date:
- Size: 28.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ee4d718b154247eebf02f334cb9b306f46ef34689988e52d7d6fac180a2e7d9
|
|
| MD5 |
6e5732ae0b1946f0749e1db85bc9ae4a
|
|
| BLAKE2b-256 |
91e8eef3f5d9cf048f3b2d7f3504f23e9d0a4d72ed8ae99703d886881aac15c8
|