Skip to main content

Instana MCP wrapper with enhanced hostname filtering for accurate issue tracking

Project description

Instana Wrapper MCP Server

A Model Context Protocol (MCP) server that wraps the Instana MCP toolkit with simplified, WatsonX-compatible interfaces. This wrapper solves parameter stringification issues and provides user-friendly tool interfaces for infrastructure monitoring, application performance, and event management.

Version 1.1.0 - Phase 1 Expansion

Tool Coverage: 13 tools (28.3% of 46 total Instana tools)

What's New in v1.1.0

  • โœจ 8 new tools added (Phase 1 expansion)
  • ๐ŸŽฏ Flexible infrastructure monitoring for any entity type
  • ๐Ÿ” Event management with batch retrieval and detailed analysis
  • ๐Ÿ“Š Dashboard management with full CRUD operations
  • ๐ŸŒ Website monitoring with beacon and metrics support
  • โ˜ธ๏ธ Kubernetes events with automatic problem detection

Features

Infrastructure Monitoring

  • get_infrastructure_metrics: Query any entity type (hosts, databases, containers, K8s nodes)

    • Multi-metric queries (up to 10 metrics)
    • Flexible filtering by any tag
    • Optional grouping for discovery
    • Time range support (1h, 24h, 7d, etc.)
  • get_host_metrics: Simplified host monitoring (CPU, memory, disk)

  • get_application_metrics: Application performance (calls, latency, errors)

Event Management

  • get_incidents: Critical incidents and alerts
  • get_issues: Warnings and issues
  • get_changes: Deployment and configuration changes
  • get_event_details: Detailed event information by ID
  • get_events_by_ids: Batch event retrieval
  • get_kubernetes_events: K8s events with analysis
  • get_agent_monitoring_events: Agent health monitoring

Dashboard Management

  • manage_dashboards: Full CRUD operations
    • get_all: List all dashboards
    • get: Get specific dashboard
    • create: Create new dashboard
    • update: Update existing dashboard
    • delete: Remove dashboard

Website Monitoring

  • get_website_beacons: Retrieve website beacons
  • get_website_metrics: Grouped website metrics (page load, errors)

Installation

From PyPI

pip install instana-wrapper-mcp-server

From Source

git clone <repository-url>
cd instana-wrapper-mcp-server
pip install -e .

Configuration

Hardcoded Credentials (Demo Mode)

The wrapper includes hardcoded Instana credentials for quick demos:

  • API Token: ixAVRRLLQSS1P2W1cDSA7A
  • Base URL: https://cp4ba-dbainternal.instana.io

Environment Variables (Production)

For production use, set environment variables:

export INSTANA_API_TOKEN="your-token"
export INSTANA_BASE_URL="https://your-instana-instance.io"

Usage Examples

1. Infrastructure Monitoring - DB2 Database Health

Query 8 key DB2 metrics for PDWDBT database:

{
  "entity_type": "db2Database",
  "metrics": "[\"databases.connectionsCount\", \"databases.queries\", \"databases.commits\", \"databases.rollbacks\", \"vmonlockstats.deadlocks\", \"vmonlockstats.activeLockWaits\", \"databases.rowsRead\", \"databases.rowsReturned\"]",
  "filters": "[{\"name\": \"host.name\", \"value\": \"t3992-dev1-db-node01-par01-dev\"}, {\"name\": \"db2.name\", \"value\": \"PDWDBT\"}]",
  "aggregation": "mean",
  "time_range": "1h"
}

Result:

  • Connections: 3.5
  • Queries: 386.8/sec
  • Commits: 103.5/sec
  • Rollbacks: 0.0
  • Deadlocks: 0.0 โœ…
  • Lock Waits: 0.0 โœ…
  • Rows Read: 1,088,000/sec
  • Rows Returned: 1,088,000/sec

2. Database Discovery

List all databases on a host:

{
  "entity_type": "db2Database",
  "metrics": "[\"databases.connectionsCount\"]",
  "filters": "[{\"name\": \"host.name\", \"value\": \"t3992-dev1-db-node01-par01-dev\"}]",
  "group_by": "[\"db2.name\"]",
  "time_range": "24h"
}

Result: 16 databases discovered (PDWDBT, PDWDBT2, ..., PDWDBT16)

3. Host Resource Monitoring

Check CPU, memory, and disk:

{
  "hostname": "t3992-dev1-db-node01-par01-dev",
  "metrics": "[\"cpu.used\", \"memory.used\", \"memory.available\", \"disk.used\", \"disk.available\"]",
  "time_range": "1h"
}

Result:

  • CPU: 93.3% โš ๏ธ (High)
  • Memory: 88.7% โš ๏ธ (High)
  • Available Memory: 3.8 GB

4. Application Performance

Get top endpoints for an application:

{
  "application_name": "t2916-dev1-cpe-sso",
  "metrics": "[{\"metric\": \"calls\", \"aggregation\": \"SUM\"}, {\"metric\": \"latency\", \"aggregation\": \"MEAN\"}]",
  "time_range": "1h"
}

5. Event Management

Get incident details:

{
  "event_id": "abc123xyz"
}

Get multiple events:

{
  "event_ids": "event1,event2,event3"
}

Get Kubernetes events:

{
  "time_range": "last 24 hours",
  "max_events": 50
}

6. Dashboard Management

List all dashboards:

{
  "operation": "get_all"
}

Get specific dashboard:

{
  "operation": "get",
  "dashboard_id": "dashboard-123"
}

Create dashboard:

{
  "operation": "create",
  "dashboard_config": "{\"title\": \"My Dashboard\", \"widgets\": []}"
}

7. Website Monitoring

Get website beacons:

{
  "website_name": "robot-shop",
  "beacon_type": "PAGELOAD",
  "time_range": "1h"
}

Get website metrics:

{
  "website_name": "robot-shop",
  "metrics": "[\"beaconCount\", \"pageLoadTime\"]",
  "group_by": "beacon.page.name",
  "time_range": "1h"
}

Tool Reference

Infrastructure Monitoring Tools

get_infrastructure_metrics

Most flexible tool - Query any entity type with multiple metrics and filters.

Parameters:

  • entity_type (required): Entity type (e.g., "host", "db2Database", "dockerContainer")
  • metrics (required): JSON array of metric names
  • filters (required): JSON array of filter objects with name/value
  • aggregation (optional): "mean", "max", "min", "sum" (default: "mean")
  • time_range (optional): "1h", "24h", "7d" (default: "1h")
  • group_by (optional): JSON array of tag names for grouping

Use Cases:

  • DB2 health monitoring (8 metrics)
  • Database discovery (groupBy db2.name)
  • Container monitoring
  • Kubernetes node monitoring

get_host_metrics

Simplified host monitoring - Quick CPU, memory, disk checks.

Parameters:

  • hostname (required): Hostname or IP
  • metrics (required): JSON array of metrics
  • time_range (optional): Time range (default: "1h")

get_application_metrics

Application performance - Calls, latency, errors.

Parameters:

  • application_name (required): Application name
  • metrics (required): JSON array of metrics
  • time_range (optional): Time range (default: "1h")

Event Management Tools

get_incidents

Get critical incidents and alerts.

Parameters:

  • query (optional): Filter query
  • time_range (optional): Time range (default: "24h")
  • max_results (optional): Max results (default: 50)

get_issues

Get warnings and issues.

Parameters: Same as get_incidents

get_changes

Get deployment and configuration changes.

Parameters: Same as get_incidents

get_event_details

Get detailed information about a specific event.

Parameters:

  • event_id (required): Event ID

get_events_by_ids

Get multiple events in a single request.

Parameters:

  • event_ids (required): Comma-separated IDs or JSON array

get_kubernetes_events

Get Kubernetes info events with analysis.

Parameters:

  • time_range (optional): Natural language (default: "last 24 hours")
  • max_events (optional): Max events (default: 50)

get_agent_monitoring_events

Get agent monitoring events.

Parameters:

  • query (optional): Query string
  • time_range (optional): Natural language (default: "last 24 hours")
  • max_events (optional): Max events (default: 50)

Dashboard Management Tools

manage_dashboards

Full CRUD operations for custom dashboards.

Parameters:

  • operation (required): "get_all", "get", "create", "update", "delete"
  • dashboard_id (optional): Required for get, update, delete
  • dashboard_config (optional): Required for create, update

Website Monitoring Tools

get_website_beacons

Get website monitoring beacons.

Parameters:

  • website_name (required): Website name
  • beacon_type (optional): "PAGELOAD", "ERROR", "RESOURCE" (default: "PAGELOAD")
  • time_range (optional): Time range (default: "1h")

get_website_metrics

Get grouped website metrics.

Parameters:

  • website_name (required): Website name
  • metrics (required): JSON array of metrics
  • group_by (optional): Tag to group by (default: "beacon.page.name")
  • time_range (optional): Time range (default: "1h")

WatsonX Integration

Import to WatsonX Orchestrator

  1. Via GUI:

    • Navigate to Skills โ†’ Import
    • Select "MCP Toolkit"
    • Enter: uvx instana-wrapper-mcp-server==1.1.0 --transport stdio
    • Click Import
  2. Via CLI:

    wxo toolkit import \
      --name "Instana Monitoring" \
      --command "uvx instana-wrapper-mcp-server==1.1.0 --transport stdio"
    

Agent Training Tips

  1. Proactive Metric Selection: Train agent to automatically select useful metrics

    • DB2 Health: 8 metrics (connections, queries, commits, rollbacks, deadlocks, lock waits, rows)
    • Host Resources: 5 metrics (CPU, memory used/available, disk used/available)
  2. Tool Selection Rules:

    • Infrastructure keywords (host, server, CPU, memory, database) โ†’ get_infrastructure_metrics
    • Application keywords (application, service, endpoint, API) โ†’ get_application_metrics
  3. Multi-Metric Queries: Agent can query up to 10 metrics simultaneously

  4. Natural Language Time Ranges: Support "last 24 hours", "last 2 days", etc.

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   WatsonX Orchestrator / Bob            โ”‚
โ”‚   (Calls wrapper tools)                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
               โ”‚ MCP Protocol
               โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Instana Wrapper MCP Server (v1.1.0)   โ”‚
โ”‚   - 13 simplified tools                 โ”‚
โ”‚   - Parameter normalization             โ”‚
โ”‚   - JSON parsing                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
               โ”‚ MCP Protocol
               โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Original Instana MCP Server (v0.7.1)  โ”‚
โ”‚   - 46 native tools                     โ”‚
โ”‚   - Direct Instana API calls            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
               โ”‚ REST API
               โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Instana Backend                       โ”‚
โ”‚   - Metrics storage                     โ”‚
โ”‚   - Event management                    โ”‚
โ”‚   - Dashboard configuration             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Development

Building from Source

# Install dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Build package
python -m build

# Upload to PyPI
python -m twine upload dist/*

Testing Locally

# Test with Bob (MCP client)
# Add to Bob's MCP settings:
{
  "mcpServers": {
    "instana-wrapper": {
      "command": "uvx",
      "args": ["instana-wrapper-mcp-server==1.1.0", "--transport", "stdio"]
    }
  }
}

Roadmap

Phase 2 (Planned)

Add remaining 33 tools for complete 46-tool coverage:

  • Action Catalog (4 tools): Automation actions, action matches, execution
  • Application Resources (13 tools): Alert configs, perspectives, services, endpoints
  • Custom Dashboards (5 tools): Shareable users/tokens, advanced operations
  • Website Monitoring (11 tools): Configuration, source maps, IP masking, geo-location

Target: 100% tool coverage (46/46 tools)

Troubleshooting

Common Issues

  1. "Unknown tool" error

    • Ensure you're using v1.1.0 or later
    • Check tool name spelling
  2. "Invalid JSON" error

    • Ensure JSON strings are properly escaped
    • Use single quotes around JSON in shell commands
  3. Empty results

    • Check time range (may need longer range)
    • Verify filter values (hostname, database name)
    • Ensure entity exists in Instana
  4. Connection timeout

    • Verify Instana credentials
    • Check network connectivity
    • Ensure Instana instance is accessible

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Submit a pull request

License

MIT License - See LICENSE file for details

Support

  • Issues: GitHub Issues
  • Documentation: See CHANGELOG.md for version history
  • Examples: See INSTANA_DB2_AGENT_TESTING_GUIDE.md

Acknowledgments

Built on top of the excellent mcp-instana toolkit.


Version: 1.1.0
Last Updated: 2026-04-13
Status: Phase 1 Complete (13/46 tools)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

instana_wrapper_mcp_server-1.1.1.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

instana_wrapper_mcp_server-1.1.1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file instana_wrapper_mcp_server-1.1.1.tar.gz.

File metadata

File hashes

Hashes for instana_wrapper_mcp_server-1.1.1.tar.gz
Algorithm Hash digest
SHA256 825c41c754cb8f1a54cde352414b63a9d9af524da7b22ab58cb0415f2957ca9b
MD5 9f694a52b9797c0b099f289a6662cf18
BLAKE2b-256 2b620d65ee8b6d2554fb5c40ac28574fe2b558f9e55dfa073831c1906963b987

See more details on using hashes here.

File details

Details for the file instana_wrapper_mcp_server-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for instana_wrapper_mcp_server-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f3b9d9175d39f13d18a257186123976919ef01298d732926b188583ee244d13a
MD5 9c857790250f2a6dfc14676244687630
BLAKE2b-256 33def40fe366d9b0cc924a6b5cf1c63e6c20acf0bc451ce63e0d6563927c5ef9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page