
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
mcp-observability-server
Advanced tools
A Model Context Protocol (MCP) server for querying logs from multiple observability platforms (New Relic, Azure)
mcp-name: io.github.gagandeeppra/mcp-observability-server
A Model Context Protocol (MCP) server that enables Claude to query logs from multiple observability platforms simultaneously. Perfect for SRE workflows, incident investigation, and distributed tracing.
pip install mcp-observability-server
git clone https://github.com/yourusername/mcp-observability-server.git
cd mcp-observability-server
pip install -e .
Copy the example configuration:
cp config.yaml.example config.yaml
Edit config.yaml with your credentials:
providers:
newrelic:
enabled: true
api_key: ${NEW_RELIC_API_KEY}
account_id: "1234567"
region: "US"
azure:
enabled: true
workspace_id: ${AZURE_WORKSPACE_ID}
client_id: ${AZURE_CLIENT_ID}
client_secret: ${AZURE_CLIENT_SECRET}
tenant_id: ${AZURE_TENANT_ID}
Copy and configure environment variables:
cp .env.example .env
Edit .env with your actual credentials.
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"observability": {
"command": "python",
"args": ["-m", "mcp_observability.server", "/path/to/config.yaml"]
}
}
}
Once configured, you can ask Claude to query your logs:
Search for errors in the last hour:
Show me all errors from the last hour across all platforms
Search specific text:
Find logs containing "timeout" from the last 30 minutes
Filter by service:
Show me warning and error logs from the api-gateway service in the last 2 hours
Distributed tracing:
Find all logs related to trace ID abc123-def456
Recent errors:
What errors have occurred in the last 15 minutes?
The server exposes these tools to Claude:
query_logsSearch logs across all platforms with flexible filtering.
Parameters:
start_time (required) - ISO format or relative (e.g., "1h", "30m", "2d")end_time (optional) - Defaults to nowquery (optional) - Text to search forseverity (optional) - Array of severity levelsservice_name (optional) - Filter by servicelimit (optional) - Max results (default: 100)providers (optional) - Specific providers to queryget_recent_errorsQuick access to recent error and critical logs.
Parameters:
minutes (optional) - Look back period (default: 60)limit (optional) - Max results per provider (default: 100)service_name (optional) - Filter by servicesearch_by_trace_idFind all logs associated with a distributed trace.
Parameters:
trace_id (required) - The trace ID to search forstart_time (optional) - Defaults to 24 hours agoend_time (optional) - Defaults to nowhealth_checkVerify connectivity to all configured providers.
The server provides guided prompts for common SRE workflows. Prompts chain multiple tools together and provide structured analysis frameworks.
investigate-incidentSystematic incident investigation workflow.
Use for: Active production incidents requiring thorough investigation
Parameters:
service_name (optional) - Service to investigatetime_period (default: "1h") - Investigation time windowseverity_threshold (default: "error") - Minimum severityExample:
Use the investigate-incident prompt for api-gateway service
Workflow: Recent errors → Pattern analysis → Trace investigation → Health checks → Summary with recommendations
health-check-reportGenerate comprehensive health status report.
Use for: Daily health checks, system status overviews
Parameters:
time_period (default: "24h") - Error statistics periodinclude_metrics (default: true) - Include detailed metricsExample:
Generate a health check report
Workflow: Provider health → Error analysis → Service catalog → Active traces → Recommendations
post-deployment-checkValidate deployment health by comparing before/after metrics.
Use for: Post-deployment validation, CI/CD pipelines
Parameters:
service_name (required) - Deployed service namedeployment_time (optional) - When deployment occurredlookback_minutes (default: 30) - Baseline comparison periodExample:
Run a post-deployment check for user-service
Workflow: Current errors → Baseline comparison → New error detection → Trace analysis → Health recommendation (PROCEED/MONITOR/ROLLBACK)
trace-flow-analysisAnalyze distributed trace execution flow and timing.
Use for: Debugging distributed systems, understanding request flow
Parameters:
trace_id (required) - Trace ID to analyzeinclude_timing (default: true) - Include timing breakdownExample:
Analyze trace flow for abc123-def456
Workflow: Timeline construction → Service chain mapping → Timing analysis → Error detection → Bottleneck identification → Root cause
root-cause-analysisDeep root cause investigation for complex failures.
Use for: Finding originating causes, cascading failure analysis
Parameters:
trace_id (optional) - Specific trace to investigateerror_pattern (optional) - Known error patterntime_window (default: "1h") - Investigation windowExample:
Perform root cause analysis for error "database connection timeout"
Workflow: Evidence gathering → Timeline building → Trace flow → Pattern recognition → Root cause formulation → Prevention recommendations
See Prompts README for detailed documentation.
# Clone repository
git clone https://github.com/yourusername/mcp-observability-server.git
cd mcp-observability-server
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/
ruff check src/
Test the server interactively using the MCP Inspector:
npx @modelcontextprotocol/inspector \
uv \
--directory /home/gagan/mcp-observability-server \
run \
mcp-observability \
/home/gagan/mcp-observability-server/config.yaml
Or using the Python module directly:
npx @modelcontextprotocol/inspector \
uv \
--directory /home/gagan/mcp-observability-server \
run \
python \
-m \
mcp_observability.server \
/home/gagan/mcp-observability-server/config.yaml
mcp-observability-server/
├── src/
│ └── mcp_observability/
│ ├── __init__.py
│ ├── server.py # Main MCP server
│ ├── models.py # Data models
│ ├── utils.py # Utilities
│ ├── prompts/ # Guided workflow prompts
│ │ ├── __init__.py
│ │ ├── incident.py # Incident investigation prompts
│ │ ├── health.py # Health monitoring prompts
│ │ ├── deployment.py # Deployment validation prompts
│ │ ├── trace_analysis.py # Trace flow analysis prompts
│ │ └── README.md # Prompts documentation
│ └── providers/
│ ├── base.py # Abstract base
│ ├── newrelic.py
│ ├── azure.py
│
│
├── tests/
├── config.yaml.example
├── .env.example
└── pyproject.toml
# Run all tests
pytest
# Run with coverage
pytest --cov=mcp_observability
# Run specific test file
pytest tests/test_providers.py
The server includes comprehensive logging to help with debugging and monitoring:
Configure Log Level:
Set the MCP_LOG_LEVEL environment variable:
# In your .env file or environment
export MCP_LOG_LEVEL=DEBUG # Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
Log Levels:
DEBUG - Detailed diagnostic information (queries, parameters, API calls)INFO - General informational messages (default)WARNING - Warning messages for potential issuesERROR - Error messages for failuresCRITICAL - Critical issues that prevent operationWhat Gets Logged:
Example Log Output:
2026-02-13 10:30:15 - mcp_observability.server - INFO - Starting MCP Observability Server
2026-02-13 10:30:15 - mcp_observability.utils - INFO - Loading config from: config.yaml
2026-02-13 10:30:15 - mcp_observability.providers.newrelic - INFO - New Relic provider initialized for region: US
2026-02-13 10:30:20 - mcp_observability.server - INFO - Tool called: query_logs
2026-02-13 10:30:21 - mcp_observability.providers.newrelic - INFO - New Relic query returned 42 log(s)
"Provider unhealthy" in health check
"No logs found"
AWS credentials error
Timeout errors
Enable debug logging
MCP_LOG_LEVEL=DEBUG in your environment or .env fileContributions are welcome! Please:
MIT License - see LICENSE file for details
Built with the Model Context Protocol by Anthropic.
FAQs
A Model Context Protocol (MCP) server for querying logs from multiple observability platforms (New Relic, Azure)
We found that mcp-observability-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.