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.2.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.2-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for instana_wrapper_mcp_server-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3cb35fb90c0c245be656dc32d432103296a7594bb2a2691bf81fbd36238d900c
MD5 a63ad2eadd33d4834e761cd2c4dd0458
BLAKE2b-256 2b8d0dd093d63f489461f81fae9cf9289a700b66af78247257a26a61f8d85a4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for instana_wrapper_mcp_server-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a409f95994359c93cc65b424bc420718ec82af8d5ac340352bc07d267ec89e56
MD5 cb3901736a08e3b3fb4b76a7aa45d57e
BLAKE2b-256 903749965e3ecc7ddd5cb8f6b999f8e68af2a2104e997ba3a26243fb3b9861f8

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