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:
- get_host_metrics - Get CPU, memory, disk metrics for a host
- get_application_metrics - Get application performance metrics
- get_incidents - Get critical incidents/alerts
- get_issues - Get warnings and issues
- 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:
- Open your agent
- Go to Tools section
- Add
instana-wrappertoolkit - 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 addressmetrics(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 namemetrics(string): JSON array of metricstime_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 querytime_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 querytime_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 querytime_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
- db2-execution-wrapper - DB2 wrapper with same approach
- mcp-instana - Official Instana MCP server
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file instana_wrapper_mcp_server-1.0.2.tar.gz.
File metadata
- Download URL: instana_wrapper_mcp_server-1.0.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0b1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cb35fb90c0c245be656dc32d432103296a7594bb2a2691bf81fbd36238d900c
|
|
| MD5 |
a63ad2eadd33d4834e761cd2c4dd0458
|
|
| BLAKE2b-256 |
2b8d0dd093d63f489461f81fae9cf9289a700b66af78247257a26a61f8d85a4d
|
File details
Details for the file instana_wrapper_mcp_server-1.0.2-py3-none-any.whl.
File metadata
- Download URL: instana_wrapper_mcp_server-1.0.2-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0b1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a409f95994359c93cc65b424bc420718ec82af8d5ac340352bc07d267ec89e56
|
|
| MD5 |
cb3901736a08e3b3fb4b76a7aa45d57e
|
|
| BLAKE2b-256 |
903749965e3ecc7ddd5cb8f6b999f8e68af2a2104e997ba3a26243fb3b9861f8
|