Skip to main content

Instana MCP wrapper with hardcoded credentials for WatsonX demo

Project description

Instana Wrapper MCP Server

Wrapper MCP server that fixes WatsonX Orchestrator parameter stringification issues for Instana tools.

Problem

WatsonX Developer Edition stringifies dictionary parameters when calling MCP tools, but the official Instana MCP server expects native Python dictionaries. This wrapper parses the stringified parameters and calls the actual Instana MCP server with the correct format.

Solution

This wrapper provides 5 critical Instana tools with parameter parsing:

  1. get_host_metrics - Get CPU, memory, disk metrics for a host
  2. get_application_metrics - Get application performance metrics
  3. get_incidents - Get critical incidents/alerts
  4. get_issues - Get warnings and issues
  5. get_changes - Get deployment and configuration changes

Installation

# Install from PyPI (after publishing)
pip install instana-wrapper-mcp-server

# Or install from local directory
cd instana-wrapper-mcp-server
pip install -e .

Usage with WatsonX Orchestrator

1. Import Toolkit

orchestrate toolkits import \
  --kind mcp \
  --name instana-wrapper \
  --description "Instana monitoring wrapper with parameter parsing" \
  --package "instana-wrapper-mcp-server" \
  --command "uvx instana-wrapper-mcp-server --transport stdio" \
  --tools "*" \
  --app-id instana

2. Add to Agent

In WatsonX UI:

  1. Open your agent
  2. Go to Tools section
  3. Add instana-wrapper toolkit
  4. Select the tools you need

3. Test

Ask your agent:

"Get CPU and memory metrics for host t3992-dev1-db-node01-par01-dev"
"Show me incidents for host t3992-dev1-db-node01-par01-dev"
"Get application metrics for PDWDBT"

Environment Variables

# Required - Instana API credentials
INSTANA_API_TOKEN=your-api-token
INSTANA_BASE_URL=https://your-instana-instance.instana.io

Architecture

WatsonX Agent
    ↓ (stringified params)
Instana Wrapper MCP Server
    ↓ (parse JSON strings)
    ↓ (convert to dicts)
Official Instana MCP Server
    ↓ (call Instana API)
Instana Backend

Tools

get_host_metrics

Get infrastructure metrics for a specific host.

Parameters:

  • hostname (string): Hostname or IP address
  • metrics (string): JSON array of metrics, e.g., ["cpu.used", "memory.used"]
  • time_range (string, optional): Time range like "1h", "24h", default "1h"

Example:

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

get_application_metrics

Get application performance metrics.

Parameters:

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

Example:

{
  "application_name": "PDWDBT",
  "metrics": "[\"calls\", \"latency\", \"errors\"]",
  "time_range": "24h"
}

get_incidents

Get critical incidents for a host or application.

Parameters:

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

Example:

{
  "query": "entity.host.name:t3992-dev1-db-node01-par01-dev",
  "time_range": "24h",
  "max_results": 10
}

get_issues

Get warnings and issues.

Parameters:

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

get_changes

Get deployment and configuration changes.

Parameters:

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

Development

# Clone repo
git clone <repo-url>
cd instana-wrapper-mcp-server

# Install dependencies
pip install -e .

# Test locally
INSTANA_API_TOKEN=xxx INSTANA_BASE_URL=xxx python -m instana_wrapper_mcp_server

Publishing to PyPI

# Build
python -m build

# Upload
python -m twine upload dist/*

Related Projects

License

MIT

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.0.3.tar.gz (7.2 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.0.3-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for instana_wrapper_mcp_server-1.0.3.tar.gz
Algorithm Hash digest
SHA256 93067f05d2f8a951faa29b6243e8fd85a60a408d7c49db99d64c4341229307de
MD5 901e05231796ddbcb9c3596cf48c7e5e
BLAKE2b-256 c88654a1cf7bfa7bcfe0141efef5c0e3acf2c22898ed83bcfaf6836bdf05e4dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for instana_wrapper_mcp_server-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9ea71ef44c9be8642dc158de60883a8f4f961747893abe2187bb1a168a9a6d0a
MD5 4e60b7eb22f92eaac9c9d4076cf94f2f
BLAKE2b-256 0ddc54bb5abb0c00d3421891acc8d57ed626de74ee103af81b348e3b7ec495a6

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