Skip to main content

Proxy wrapper for official mcp-instana server that fixes WatsonX JSON stringification bug

Project description

Instana Proxy Wrapper for WatsonX

A transparent proxy that sits between WatsonX Orchestrator and the official mcp-instana server, fixing WatsonX's JSON stringification bug while providing access to all 46 Instana tools.

🎯 Problem Solved

WatsonX Bug: WatsonX's MCP client auto-parses JSON string parameters, breaking the official mcp-instana server which expects JSON strings.

Solution: This proxy:

  1. Accepts objects from WatsonX (after auto-parsing)
  2. Converts them back to JSON strings
  3. Forwards to official mcp-instana server
  4. Returns results to WatsonX

✨ Features

  • All 46 Tools: Full access to official mcp-instana tools
  • Zero Configuration: Automatically starts and manages mcp-instana server
  • Transparent Proxy: No changes needed to tool calls
  • WatsonX Compatible: Fixes JSON stringification bug
  • Easy Installation: Single package install

📦 Installation

Prerequisites

  1. Install mcp-instana (the official server):
pip install mcp-instana
  1. Set environment variables:
export INSTANA_BASE_URL="https://your-tenant.instana.io"
export INSTANA_API_TOKEN="your_api_token"

Install Proxy

pip install instana-proxy-wrapper

🚀 Usage

Import to WatsonX Cloud

1. Go to Skills → Import
2. Select "MCP Server"
3. Package name: instana-proxy-wrapper
4. Version: 1.0.0
5. Click Import

Environment Variables

The proxy requires the same environment variables as mcp-instana:

INSTANA_BASE_URL=https://your-tenant.instana.io
INSTANA_API_TOKEN=your_api_token

Set these in your WatsonX Cloud environment.

Local Testing

# Set credentials
export INSTANA_BASE_URL="https://your-tenant.instana.io"
export INSTANA_API_TOKEN="your_api_token"

# Run the proxy
python -m instana_proxy_wrapper.server

🔧 How It Works

Architecture

WatsonX → Proxy Wrapper → Official mcp-instana → Instana API
          (Fixes JSON)     (46 tools)

JSON Fix Example

WatsonX sends (after auto-parsing):

{
    "payload": {
        "metrics": ["cpu.utilization"],
        "timeFrame": {"windowSize": 3600000}
    }
}

Proxy converts to:

{
    "payload": '{"metrics": ["cpu.utilization"], "timeFrame": {"windowSize": 3600000}}'
}

Official server receives: JSON string (as expected)

📋 Available Tools

All 46 tools from mcp-instana are available:

Infrastructure Tools

  • analyze_infrastructure_elicitation - Two-pass infrastructure analysis
  • get_action_matches - Get automation action matches
  • get_actions - List automation actions
  • get_action_details - Get action details
  • And 42 more...

Application Tools

  • manage_instana_resources - Unified resource manager
  • Application metrics, alerts, configurations

Event Tools

  • get_event - Get specific event
  • get_issues - Get issue events
  • get_incidents - Get incident events
  • get_changes - Get change events
  • get_kubernetes_info_events - Get K8s events

Dashboard Tools

  • manage_custom_dashboards - CRUD operations
  • get_custom_dashboards - List dashboards
  • get_custom_dashboard - Get specific dashboard

Website Monitoring Tools

  • get_websites - List websites
  • get_website - Get specific website
  • get_website_beacons - Get website beacons
  • And more...

🧪 Testing

Test Infrastructure Query

# Query DB2 databases
{
    "entity_type": "db2Database",
    "metrics": ["db2.name"],
    "aggregation": "sum",
    "filters": [
        {
            "name": "host.name",
            "value": "your-hostname"
        }
    ],
    "group_by": ["db2.name"],
    "time_range": "7d"
}

Test Two-Pass Analysis

Pass 1 - Get schema:

{
    "intent": "maximum heap size of JVM on host galactica1",
    "entity": "jvm"
}

Pass 2 - Get results:

{
    "selections": {
        "entity_type": "jvmRuntimePlatform",
        "metrics": ["jvm.heap.maxSize"],
        "aggregation": "max",
        "filters": [{"name": "host.name", "value": "galactica1"}]
    }
}

🐛 Troubleshooting

Issue: Proxy won't start

Error: "Missing required environment variables"

Solution:

export INSTANA_BASE_URL="https://your-tenant.instana.io"
export INSTANA_API_TOKEN="your_api_token"

Issue: Tools not working

Error: Tool calls fail

Solution: Ensure mcp-instana is installed:

pip install mcp-instana

Issue: Import fails in WatsonX

Error: "Package not found"

Solution: Wait 5-10 minutes for PyPI CDN propagation

📊 Comparison

Feature instana-proxy-wrapper instana-watsonx-wrapper
Tools 46 (all from mcp-instana) 11 (custom subset)
Metric Discovery ✅ Yes ❌ No
Two-Pass Analysis ✅ Yes ❌ No
Complexity Low (transparent proxy) Medium (custom implementation)
Maintenance Low (follows mcp-instana) High (manual updates)
Use Case Full Instana access Simple queries only

🎯 When to Use

Use Proxy Wrapper When:

  • ✅ Need all 46 Instana tools
  • ✅ Need metric discovery
  • ✅ Need two-pass infrastructure analysis
  • ✅ Want automatic updates with mcp-instana
  • ✅ Need complex queries

Use Direct Wrapper When:

  • ✅ Only need 11 basic tools
  • ✅ Know exact metrics to query
  • ✅ Want simpler implementation
  • ✅ Don't need advanced features

📚 Documentation

🤝 Contributing

This is a simple proxy wrapper. For tool improvements, contribute to the official mcp-instana project.

📝 License

MIT License - See LICENSE file for details

🙏 Acknowledgments

  • Official mcp-instana server by Instana team
  • Model Context Protocol by Anthropic
  • WatsonX Orchestrator by IBM

Made with Bob - Your AI Software Engineer

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_proxy_wrapper-1.0.1.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

instana_proxy_wrapper-1.0.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file instana_proxy_wrapper-1.0.1.tar.gz.

File metadata

  • Download URL: instana_proxy_wrapper-1.0.1.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0b1

File hashes

Hashes for instana_proxy_wrapper-1.0.1.tar.gz
Algorithm Hash digest
SHA256 17c53dc4fce81aa5d15253b76008ab4b94624f17b548fd25b0b7f3724a387e9c
MD5 1a4a3a9cc0ee1e04635c7372f06e4f19
BLAKE2b-256 f73903081cab5714601c9b05d37cee6398f0a0c6bee30e3ed855d9826b129472

See more details on using hashes here.

File details

Details for the file instana_proxy_wrapper-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for instana_proxy_wrapper-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1e58951d844ec7693fef838be46c5aff51ee0953fc0a6bcb26eea22e468de73
MD5 42f5f24c30589d9a76cf93d1b66df8af
BLAKE2b-256 980ee7b434cca28c462564674043af6a19f2504a8a65db6c20b92586e1a85329

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