mcp-instana 0.3.1__tar.gz → 0.6.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. mcp_instana-0.6.2/CHANGELOG.md +43 -0
  2. mcp_instana-0.6.2/DOCKER.md +187 -0
  3. mcp_instana-0.6.2/Dockerfile +60 -0
  4. mcp_instana-0.6.2/OBSERVABILITY.md +344 -0
  5. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/PKG-INFO +9 -193
  6. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/README.md +5 -190
  7. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/build_multiplatform.sh +26 -5
  8. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/pyproject-runtime.toml +6 -6
  9. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/pyproject.toml +5 -4
  10. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/application/application_alert_config.py +10 -4
  11. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/application/application_analyze.py +13 -10
  12. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/application/application_global_alert_config.py +22 -21
  13. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/application/application_metrics.py +21 -21
  14. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/application/application_resources.py +44 -4
  15. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/application/application_settings.py +190 -66
  16. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/core/server.py +3 -0
  17. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/event/events_tools.py +57 -9
  18. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/infrastructure/infrastructure_catalog.py +30 -4
  19. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/infrastructure/infrastructure_metrics.py +1 -0
  20. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/infrastructure/infrastructure_resources.py +1 -4
  21. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/infrastructure/infrastructure_topology.py +27 -15
  22. mcp_instana-0.6.2/src/observability.py +29 -0
  23. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/application/test_application_analyze.py +25 -1
  24. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/application/test_application_global_alert_config.py +22 -19
  25. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/application/test_application_metrics.py +6 -6
  26. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/application/test_application_resources.py +73 -4
  27. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/application/test_application_analyze.py +18 -5
  28. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/application/test_application_metrics.py +11 -11
  29. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/application/test_application_resources.py +105 -3
  30. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/application/test_application_settings.py +67 -72
  31. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/infrastructure/test_infrastructure_topology.py +66 -56
  32. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/infrastructure/test_infrastructure_topology.py +7 -3
  33. mcp_instana-0.6.2/uv.lock +3803 -0
  34. mcp_instana-0.3.1/.github/workflows/build-multiplatform.yml +0 -37
  35. mcp_instana-0.3.1/.github/workflows/build-windows-container.yml +0 -52
  36. mcp_instana-0.3.1/Dockerfile +0 -119
  37. mcp_instana-0.3.1/uv.lock +0 -1332
  38. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/.github/dco.yml +0 -0
  39. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/.github/workflows/ci.yml +0 -0
  40. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/.gitignore +0 -0
  41. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/CONTRIBUTING.md +0 -0
  42. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/LICENSE.md +0 -0
  43. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/conftest.py +0 -0
  44. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/docs/PRIVACY.md +0 -0
  45. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/docs/assets/.gitattributes +0 -0
  46. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/docs/assets/instana.png +0 -0
  47. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/images/architecture.png +0 -0
  48. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/images/call_tools.png +0 -0
  49. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/images/claudeResponse.png +0 -0
  50. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/images/claudeTools.png +0 -0
  51. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/images/copilot.png +0 -0
  52. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/images/copilotResponse.png +0 -0
  53. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/images/kubernetesEvents.png +0 -0
  54. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/images/mcpInstanaFlow.png +0 -0
  55. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/images/query_events.png +0 -0
  56. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/mcpb/.mcpbignore +0 -0
  57. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/mcpb/manifest.json +0 -0
  58. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/mcpb/pack.sh +0 -0
  59. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/pyrightconfig.json +0 -0
  60. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/run_ruff_check.sh +0 -0
  61. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/__init__.py +0 -0
  62. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/application/__init__.py +0 -0
  63. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/application/application_catalog.py +0 -0
  64. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/application/application_topology.py +0 -0
  65. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/automation/action_catalog.py +0 -0
  66. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/automation/action_history.py +0 -0
  67. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/core/__init__.py +0 -0
  68. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/core/utils.py +0 -0
  69. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/event/__init__.py +0 -0
  70. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/infrastructure/__init__.py +0 -0
  71. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/infrastructure/infrastructure_analyze.py +0 -0
  72. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/log/__init__.py +0 -0
  73. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/log/log_alert_configuration.py +0 -0
  74. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/__init__.py +0 -0
  75. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/application/__init__.py +0 -0
  76. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/application/application_alerts.py +0 -0
  77. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/application/application_catalog.py +0 -0
  78. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/application/application_metrics.py +0 -0
  79. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/application/application_resources.py +0 -0
  80. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/application/application_settings.py +0 -0
  81. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/application/application_topology.py +0 -0
  82. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/events/__init__.py +0 -0
  83. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/events/events_tools.py +0 -0
  84. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/infrastructure/infrastructure_analyze.py +0 -0
  85. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/infrastructure/infrastructure_catalog.py +0 -0
  86. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/infrastructure/infrastructure_metrics.py +0 -0
  87. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/infrastructure/infrastructure_resources.py +0 -0
  88. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/infrastructure/infrastructure_topology.py +0 -0
  89. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/settings/__init__.py +0 -0
  90. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/settings/custom_dashboard.py +0 -0
  91. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/website/__init__.py +0 -0
  92. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/website/website_analyze.py +0 -0
  93. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/website/website_catalog.py +0 -0
  94. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/website/website_configuration.py +0 -0
  95. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/prompts/website/website_metrics.py +0 -0
  96. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/settings/__init__.py +0 -0
  97. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/settings/custom_dashboard_tools.py +0 -0
  98. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/website/__init__.py +0 -0
  99. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/website/website_analyze.py +0 -0
  100. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/website/website_catalog.py +0 -0
  101. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/website/website_configuration.py +0 -0
  102. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/src/website/website_metrics.py +0 -0
  103. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/README.md +0 -0
  104. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/__init__.py +0 -0
  105. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/application/__init__.py +0 -0
  106. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/application/test_application_alert_config.py +0 -0
  107. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/application/test_application_catalog.py +0 -0
  108. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/application/test_application_settings.py +0 -0
  109. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/application/test_application_topology.py +0 -0
  110. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/automation/__init__.py +0 -0
  111. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/automation/test_action_catalog.py +0 -0
  112. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/core/__init__.py +0 -0
  113. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/core/test_server.py +0 -0
  114. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/core/test_utils.py +0 -0
  115. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/README.md +0 -0
  116. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/__init__.py +0 -0
  117. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/application/test_application_alert_config.py +0 -0
  118. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/application/test_application_catalog.py +0 -0
  119. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/application/test_application_topology.py +0 -0
  120. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/conftest.py +0 -0
  121. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/event/test_events_tools.py +0 -0
  122. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/infrastructure/test_infrastructure_analyze.py +0 -0
  123. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/infrastructure/test_infrastructure_catalog.py +0 -0
  124. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/infrastructure/test_infrastructure_metrics.py +0 -0
  125. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/infrastructure/test_infrastructure_resources.py +0 -0
  126. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/pytest.ini +0 -0
  127. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/run_e2e_tests.py +0 -0
  128. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/server/test_server_integration.py +0 -0
  129. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/e2e/utils/test_base_instana_client.py +0 -0
  130. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/event/__init__.py +0 -0
  131. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/event/test_events_tools.py +0 -0
  132. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/infrastructure/__init__.py +0 -0
  133. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/infrastructure/test_infrastructure_analyze.py +0 -0
  134. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/infrastructure/test_infrastructure_catalog.py +0 -0
  135. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/infrastructure/test_infrastructure_metrics.py +0 -0
  136. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/infrastructure/test_infrastructure_resources.py +0 -0
  137. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/log/__init__.py +0 -0
  138. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/log/test_log_alert_configuration.py +0 -0
  139. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/__init__.py +0 -0
  140. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/application/__init__.py +0 -0
  141. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/application/test_application_alerts.py +0 -0
  142. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/application/test_application_catalog.py +0 -0
  143. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/application/test_application_metrics.py +0 -0
  144. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/application/test_application_resources.py +0 -0
  145. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/application/test_application_settings.py +0 -0
  146. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/application/test_application_topology.py +0 -0
  147. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/events/test_events_tools.py +0 -0
  148. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/infrastructure/__init__.py +0 -0
  149. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/infrastructure/test_infrastructure_analyze.py +0 -0
  150. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/infrastructure/test_infrastructure_catalog.py +0 -0
  151. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/infrastructure/test_infrastructure_metrics.py +0 -0
  152. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/infrastructure/test_infrastructure_resources.py +0 -0
  153. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/prompts/infrastructure/test_infrastructure_topology.py +0 -0
  154. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/run_all_tests.py +0 -0
  155. {mcp_instana-0.3.1 → mcp_instana-0.6.2}/tests/run_all_tests_with_coverage.py +0 -0
@@ -0,0 +1,43 @@
1
+ # Changelog
2
+
3
+ ### 0.6.0
4
+
5
+ - **Fix:** Improved accuracy across Application, Infrastructure, and
6
+ Event tools by fixing broken functionality.
7
+ - **Enhancement:** Added multi-architecture Docker image support.
8
+
9
+ ### 0.5.0
10
+
11
+ - **New Feature:** Added support for using MCP Instana as an extension
12
+ within AI MCP clients.
13
+
14
+ ### 0.4.0
15
+
16
+ - **New Feature:** Added Website Monitoring tools.
17
+ - **Enhancement:** Enhanced Event capabilities with new issue,
18
+ incident, and change retrieval tools.
19
+
20
+ ### 0.3.1
21
+
22
+ - **Enhancement:** Optimized Docker image to reduce storage footprint.
23
+
24
+ ### 0.3.0
25
+
26
+ - **Enhancement:** Added prompt enable/disable functionality.
27
+ - **New Feature:** Introduced Application Alert Global tools.
28
+ - **New Feature:** Added automation tools.
29
+ - **Fix:** Resolved application analyze tools for better handling of
30
+ payloads.
31
+ - **Enhancement:** Added Docker support.
32
+
33
+ ### 0.2.0
34
+
35
+ - **New Feature:** Added comprehensive Application Settings tools.
36
+ - **New Feature:** Introduced the MCP Instana CLI.
37
+
38
+ ### 0.1.0
39
+
40
+ - Initial public release of the MCP Server for IBM
41
+ Instana.
42
+ - **New Feature:** Introduced core Monitoring Capabilities
43
+ (Application, Infrastructure, and Event Monitoring).
@@ -0,0 +1,187 @@
1
+ # Docker Guide for MCP Instana
2
+
3
+ This guide documents everything Docker-related for MCP Instana. Use it when you need more than the quick blurb in `README.md`.
4
+
5
+ ## Overview
6
+
7
+ - Two-stage image defined in `Dockerfile`: a builder installs only runtime dependencies (via `pyproject-runtime.toml` + `uv`), and the runtime stage copies the installed packages plus `src/`.
8
+ - Runtime image is `python:3.11-slim`, runs as non-root `mcpuser`, exposes `8080`, and ships with a health check that curls `http://127.0.0.1:8080/health`.
9
+ - Entry point runs `python -m src.core.server --transport streamable-http`, so clients provide Instana credentials over HTTP headers rather than baking them into the container.
10
+ - `build_multiplatform.sh` automates multi-architecture builds (amd64 + arm64) with Docker Buildx, QEMU, and optional pushes.
11
+
12
+ ## Quickstart
13
+
14
+ ```bash
15
+ # Build a local image (single architecture)
16
+ docker build -t mcp-instana .
17
+
18
+ # Run it (streamable HTTP transport on port 8080)
19
+ docker run --rm -p 8080:8080 mcp-instana
20
+
21
+ # Override the HTTP port exposed by the container
22
+ docker run --rm -e PORT=9090 -p 9090:9090 mcp-instana
23
+ ```
24
+
25
+ ### Docker Compose snippet
26
+
27
+ ```yaml
28
+ version: '3.8'
29
+ services:
30
+ mcp-instana:
31
+ build: .
32
+ ports:
33
+ - "8080:8080"
34
+ restart: unless-stopped
35
+ healthcheck:
36
+ test: ["CMD", "python", "-c", "import requests; requests.get('http://127.0.0.1:8080/health', timeout=5)"]
37
+ interval: 30s
38
+ timeout: 10s
39
+ retries: 3
40
+ start_period: 40s
41
+ ```
42
+
43
+ ## Image anatomy (`Dockerfile`)
44
+
45
+ | Component | Details |
46
+ | --- | --- |
47
+ | Builder stage | Based on `python:3.11-slim`, installs `uv`, copies `pyproject-runtime.toml`, `pyproject.toml`, `src/`, `README.md`, then runs `pip install .` (runtime deps only). |
48
+ | Runtime stage | Reuses `python:3.11-slim`, copies site-packages and binaries from builder, then copies `src/` only. |
49
+ | User | Non-root `mcpuser` owns `/app`. |
50
+ | Entry point | `python -m src.core.server --transport streamable-http`. Override with `docker run ... -- entrypoint` or `CMD`. |
51
+ | Health check | `python -c "import requests; requests.get('http://127.0.0.1:8080/health', timeout=5)"` every 30s with retries. |
52
+ | Exposed port | `8080` (override with `PORT`). |
53
+
54
+ ### Configuration reference
55
+
56
+ | Variable / flag | Default | Notes |
57
+ | --- | --- | --- |
58
+ | `PORT` | `8080` | Align host port mapping when overriding. |
59
+ | `PYTHONUNBUFFERED` | `1` | Keeps logs unbuffered. Usually leave as-is. |
60
+ | `PYTHONPATH` | `/app` | Ensures `src/` is importable. |
61
+ | `--transport` (CMD arg) | `streamable-http` | Change via `docker run ... -- --transport <mode>`. |
62
+
63
+ ## Building images
64
+
65
+ ### Single-architecture build (default Docker)
66
+
67
+ ```bash
68
+ docker build -t mcp-instana .
69
+ ```
70
+
71
+ ### Manual multi-architecture build with Buildx
72
+
73
+ ```bash
74
+ # One-time builder setup
75
+ docker buildx create --name multiarch --driver docker-container --use
76
+ docker buildx inspect --bootstrap
77
+
78
+ # Build & push (amd64 + arm64)
79
+ docker buildx build \
80
+ --platform linux/amd64,linux/arm64 \
81
+ -t username/mcp-instana:latest \
82
+ --push .
83
+ ```
84
+
85
+ ### Using `build_multiplatform.sh`
86
+
87
+ ```bash
88
+ chmod +x build_multiplatform.sh
89
+ # Build local arch (loads result when host is linux/*)
90
+ ./build_multiplatform.sh
91
+
92
+ # Build and push multi-arch manifest
93
+ ./build_multiplatform.sh --registry username/ --tag v1.0 --push
94
+ ```
95
+
96
+ The script:
97
+
98
+ 1. Installs QEMU emulation via `tonistiigi/binfmt` (required on macOS/Windows for cross-builds).
99
+ 2. Creates/bootstraps a Buildx builder named `multiplatform`.
100
+ 3. Disables SBOM/attestation for faster builds (can be re-enabled if needed).
101
+ 4. Builds the requested platforms; if `--push` is omitted on non-Linux hosts, it falls back to building only the current platform and warns accordingly.
102
+ 5. When `--push` is set, it verifies the manifest and performs `docker pull` for both amd64/arm64.
103
+
104
+ #### Script options
105
+
106
+ | Flag | Description | Default |
107
+ | --- | --- | --- |
108
+ | `-n, --name` | Image name | `mcp-instana` |
109
+ | `-t, --tag` | Image tag | `latest` |
110
+ | `-r, --registry` | Registry prefix (e.g., `username/` or `registry.example.com/`) | empty |
111
+ | `-p, --platforms` | Comma-separated platforms | `linux/amd64,linux/arm64` |
112
+ | `--push` | Push manifest to the registry | disabled |
113
+ | `-h, --help` | Show usage and exit | — |
114
+
115
+ ## Security posture
116
+
117
+ - Non-root runtime user (`mcpuser`) limits container privileges.
118
+ - Health check ensures orchestration platforms can restart unhealthy pods.
119
+ - No credentials or secrets inside the image; MCP clients supply Instana headers at request time.
120
+ - Runtime dependency set trimmed to ~20 packages, yielding ~266 MB images vs >1 GB for dev installs.
121
+ - Multi-stage build keeps compilers and build artifacts out of the final layer.
122
+
123
+ ## Testing & troubleshooting
124
+
125
+ ```bash
126
+ # Inspect container status (health column)
127
+ docker ps
128
+
129
+ # Hit MCP endpoint directly
130
+ curl http://localhost:8080/mcp/
131
+
132
+ # Test using MCP Inspector
133
+ npx @modelcontextprotocol/inspector http://localhost:8080/mcp/
134
+
135
+ # Logs
136
+ docker logs -f <container_id>
137
+
138
+ # Debug shell (container already has /bin/bash from python:slim)
139
+ docker exec -it <container_id> /bin/bash
140
+ ```
141
+
142
+ ## Production deployment
143
+
144
+ 1. Keep Instana credentials outside the container; pass them through MCP-compatible clients (Claude Desktop, GitHub Copilot, etc.).
145
+ 2. Rely on the built-in HTTP health endpoint (`/health`) for orchestration probes.
146
+ 3. Configure persistent logging/metrics at the orchestrator level (CloudWatch, ELK, etc.).
147
+ 4. Run at least two replicas and enable rolling updates to avoid downtime.
148
+ 5. Regularly rebuild to pick up upstream `python:3.11-slim` security patches.
149
+
150
+ ### Kubernetes example
151
+
152
+ ```yaml
153
+ apiVersion: apps/v1
154
+ kind: Deployment
155
+ metadata:
156
+ name: mcp-instana
157
+ spec:
158
+ replicas: 2
159
+ selector:
160
+ matchLabels:
161
+ app: mcp-instana
162
+ template:
163
+ metadata:
164
+ labels:
165
+ app: mcp-instana
166
+ spec:
167
+ containers:
168
+ - name: mcp-instana
169
+ image: mcp-instana:latest
170
+ ports:
171
+ - containerPort: 8080
172
+ env:
173
+ - name: PORT
174
+ value: "8080"
175
+ livenessProbe:
176
+ httpGet:
177
+ path: /health
178
+ port: 8080
179
+ initialDelaySeconds: 30
180
+ periodSeconds: 10
181
+ readinessProbe:
182
+ httpGet:
183
+ path: /health
184
+ port: 8080
185
+ initialDelaySeconds: 5
186
+ periodSeconds: 5
187
+ ```
@@ -0,0 +1,60 @@
1
+ # Stage 1: Build stage with minimal runtime dependencies
2
+ FROM docker.io/library/python:3.11-slim AS builder
3
+
4
+ # Install system dependencies needed for building
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ gcc \
7
+ g++ \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Set working directory
11
+ WORKDIR /app
12
+
13
+ # Copy only the runtime dependency file and source code needed for the build
14
+ COPY pyproject-runtime.toml pyproject.toml
15
+ COPY src ./src
16
+ COPY README.md ./
17
+
18
+ # Install uv for dependency management
19
+ RUN pip install --no-cache-dir uv
20
+
21
+ # Install only runtime dependencies using the minimal pyproject-runtime.toml
22
+ RUN pip install --no-cache-dir .
23
+
24
+ # Stage 2: Runtime stage
25
+ FROM python:3.11-slim AS runtime
26
+
27
+ # Set working directory
28
+ WORKDIR /app
29
+
30
+ # Create a non-root user for security
31
+ RUN groupadd -r mcpuser && useradd -r -g mcpuser mcpuser
32
+
33
+ # Copy only the Python packages from builder (no source code needed)
34
+ COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
35
+ COPY --from=builder /usr/local/bin /usr/local/bin
36
+
37
+ # Copy only the source code needed for runtime
38
+ COPY src ./src
39
+
40
+ # Set ownership to non-root user
41
+ RUN chown -R mcpuser:mcpuser /app
42
+
43
+ # Switch to non-root user
44
+ USER mcpuser
45
+
46
+ # Expose the default port (configurable via PORT env var)
47
+ EXPOSE 8080
48
+
49
+ # Set environment variables (no hardcoded secrets)
50
+ ENV PYTHONPATH=/app
51
+ ENV PYTHONUNBUFFERED=1
52
+ ENV PORT=8080
53
+
54
+ # Health check using container's internal network
55
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
56
+ CMD python -c "import requests; requests.get('http://127.0.0.1:8080/health', timeout=5)" || exit 1
57
+
58
+ # Run the server
59
+ ENTRYPOINT ["python", "-m", "src.core.server"]
60
+ CMD ["--transport", "streamable-http"]
@@ -0,0 +1,344 @@
1
+ # MCP Observability Configuration Guide
2
+
3
+ This document provides comprehensive instructions for enabling and configuring observability in the MCP Instana Server using Traceloop SDK for distributed tracing.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Overview](#overview)
8
+ - [Prerequisites](#prerequisites)
9
+ - [Installation](#installation)
10
+ - [Configuration](#configuration)
11
+ - [Environment Variables](#environment-variables)
12
+ - [Client-Specific Configurations](#client-specific-configurations)
13
+ - [GitHub Copilot](#github-copilot)
14
+ - [Claude Desktop](#claude-desktop)
15
+ - [Custom MCP Client](#custom-mcp-client)
16
+ - [Starting the Server](#starting-the-server)
17
+ - [Viewing Traces in Instana](#viewing-traces-in-instana)
18
+ - [Troubleshooting](#troubleshooting)
19
+
20
+ ## Overview
21
+
22
+ MCP-Instana Observability integrates with the Traceloop SDK to provide distributed tracing for your MCP server and client interactions.
23
+
24
+ ## Prerequisites
25
+
26
+ Before enabling observability, ensure you have:
27
+
28
+ - Traceloop SDK installed (see [Installation](#installation))
29
+ - Access to an Instana instance for viewing spans
30
+
31
+ ## Installation
32
+
33
+ ### Install Traceloop SDK
34
+
35
+ If you don't already have it:
36
+
37
+ ```bash
38
+ # Using pip
39
+ pip install traceloop-sdk==0.47.5
40
+
41
+ # Using uv
42
+ uv add traceloop-sdk==0.47.5
43
+ ```
44
+
45
+ Without this, you'll see warnings like:
46
+ ```
47
+ Traceloop requested but not installed. Install with: pip install traceloop-sdk
48
+ ```
49
+
50
+ ## Configuration
51
+
52
+ ### Environment Variables
53
+
54
+ Observability in MCP-Instana is feature-flag controlled. It will only be enabled if the environment variable `ENABLE_MCP_OBSERVABILITY` is set.
55
+
56
+ #### Main Feature Flag
57
+
58
+ | Variable | Default |
59
+ |----------|---------|
60
+ | `ENABLE_MCP_OBSERVABILITY` | `false` |
61
+
62
+ **Accepted values:**
63
+ - `true`, `1`, `yes`, `on` → enables observability
64
+ - `false`, `0`, `no`, `off` → disables observability (default)
65
+
66
+ **Important:** If this flag is not set (or set to false), MCP observability will remain completely disabled, even if Traceloop and Instana configs are present.
67
+
68
+ #### Traceloop Configuration Variables
69
+
70
+ | Variable | Description | Example |
71
+ |----------|-------------|---------|
72
+ | `TRACELOOP_BASE_URL` | Your Instana OTLP endpoint URL | `https://otlp-pink-saas.instana.rocks:4317` |
73
+ | `TRACELOOP_HEADERS` | Authentication header for Instana | `x-instana-key=your_instana_key` |
74
+ | `OTEL_EXPORTER_OTLP_INSECURE` | Whether to use insecure connection | `false` (recommended) |
75
+
76
+ #### Export Modes
77
+
78
+ You can export traces to Instana in two different modes:
79
+
80
+ **Agent Mode :**
81
+
82
+ Export traces to a local Instana agent running on your machine:
83
+
84
+ ```bash
85
+ export TRACELOOP_BASE_URL=<instana-agent-host>:4317
86
+ export TRACELOOP_HEADERS="api-key=<api-key>""
87
+ export OTEL_EXPORTER_OTLP_INSECURE=true
88
+ ```
89
+
90
+ **Agentless Mode (Direct to Backend):**
91
+
92
+ Export traces directly to the Instana backend:
93
+
94
+ ```bash
95
+ export TRACELOOP_BASE_URL=<instana-otlp-endpoint>:4317
96
+ export TRACELOOP_HEADERS="x-instana-key=<agent-key>"
97
+ export OTEL_EXPORTER_OTLP_INSECURE=false
98
+ ```
99
+
100
+ **Note:** Replace the values with your actual Instana configuration:
101
+ - For agentless mode, use your Instana backend OTLP endpoint and API key
102
+ - For agent mode, ensure your local Instana agent is running and accessible
103
+
104
+ ### Client-Specific Configurations
105
+
106
+ Depending on your client (GitHub Copilot, Claude Desktop, or a custom MCP client), configuration differs for HTTP mode and STDIO mode. In all cases, ensure the flag `ENABLE_MCP_OBSERVABILITY=true` is set.
107
+
108
+ #### GitHub Copilot
109
+
110
+ ##### HTTP Mode (mcp.json)
111
+
112
+ For Streamable HTTP mode, configure `.vscode/mcp.json`:
113
+
114
+ ```json
115
+ {
116
+ "servers": {
117
+ "Instana MCP Server": {
118
+ "command": "npx",
119
+ "args": [
120
+ "mcp-remote", "http://0.0.0.0:8080/mcp/",
121
+ "--allow-http",
122
+ "--header", "instana-base-url: <your-instana-url>",
123
+ "--header", "instana-api-token: <your-instana-token>"
124
+ ],
125
+ "env": {
126
+ "ENABLE_MCP_OBSERVABILITY": "true",
127
+ "TRACELOOP_BASE_URL": "<your-instana-otlp-url>",
128
+ "TRACELOOP_HEADERS": "x-instana-key=<your-instana-key>",
129
+ "OTEL_EXPORTER_OTLP_INSECURE": "false"
130
+ }
131
+ }
132
+ }
133
+ }
134
+ ```
135
+
136
+ **Note:** Replace the following values:
137
+ - `<your-instana-url>`: Your Instana instance URL (e.g., `https://your-instance.instana.io`)
138
+ - `<your-instana-token>`: Your Instana API token
139
+ - `<your-instana-otlp-url>`: Your Instana OTLP endpoint (for ex - `https://otlp-pink-saas.instana.rocks:4317`)
140
+ - `<your-instana-key>`: Your Instana authentication key
141
+
142
+ ##### STDIO Mode (mcp.json)
143
+
144
+ For STDIO mode, configure `.vscode/mcp.json`:
145
+
146
+ ```json
147
+ {
148
+ "servers": {
149
+ "Instana MCP Server": {
150
+ "command": "uv",
151
+ "args": [
152
+ "run",
153
+ "src/core/server.py",
154
+ "--tools", "infra"
155
+ ],
156
+ "cwd": "<path-to-mcp-instana>",
157
+ "env": {
158
+ "INSTANA_BASE_URL": "<your-instana-url>",
159
+ "INSTANA_API_TOKEN": "<your-instana-token>",
160
+ "ENABLE_MCP_OBSERVABILITY": "true",
161
+ "TRACELOOP_BASE_URL": "<your-instana-otlp-url>",
162
+ "TRACELOOP_HEADERS": "x-instana-key=<your-instana-key>",
163
+ "OTEL_EXPORTER_OTLP_INSECURE": "false"
164
+ }
165
+ }
166
+ }
167
+ }
168
+ ```
169
+
170
+ **Note:** Replace `<path-to-mcp-instana>` with the absolute path to your mcp-instana project directory.
171
+
172
+ #### Claude Desktop
173
+
174
+ ##### HTTP Mode (claude_desktop_config.json)
175
+
176
+ For Streamable HTTP mode, configure Claude Desktop:
177
+
178
+ **File Locations:**
179
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
180
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
181
+
182
+ ```json
183
+ {
184
+ "mcpServers": {
185
+ "Instana MCP Server": {
186
+ "command": "npx",
187
+ "args": [
188
+ "mcp-remote", "http://0.0.0.0:8080/mcp/",
189
+ "--allow-http",
190
+ "--header", "instana-base-url: <your-instana-url>",
191
+ "--header", "instana-api-token: <your-instana-token>"
192
+ ],
193
+ "env": {
194
+ "ENABLE_MCP_OBSERVABILITY": "true",
195
+ "TRACELOOP_BASE_URL": "<your-instana-otlp-url>",
196
+ "TRACELOOP_HEADERS": "x-instana-key=<your-instana-key>",
197
+ "OTEL_EXPORTER_OTLP_INSECURE": "false"
198
+ }
199
+ }
200
+ }
201
+ }
202
+ ```
203
+
204
+ ##### STDIO Mode (claude_desktop_config.json)
205
+
206
+ For STDIO mode:
207
+
208
+ ```json
209
+ {
210
+ "mcpServers": {
211
+ "Instana MCP Server": {
212
+ "command": "uv",
213
+ "args": [
214
+ "--directory",
215
+ "<path-to-mcp-instana>",
216
+ "run",
217
+ "src/core/server.py"
218
+ ],
219
+ "cwd": "<path-to-mcp-instana>",
220
+ "env": {
221
+ "INSTANA_BASE_URL": "<your-instana-url>",
222
+ "INSTANA_API_TOKEN": "<your-instana-token>",
223
+ "ENABLE_MCP_OBSERVABILITY": "true",
224
+ "TRACELOOP_BASE_URL": "<your-instana-otlp-url>",
225
+ "TRACELOOP_HEADERS": "x-instana-key=<your-instana-key>",
226
+ "OTEL_EXPORTER_OTLP_INSECURE": "false"
227
+ }
228
+ }
229
+ }
230
+ }
231
+ ```
232
+
233
+ #### Custom MCP Client
234
+
235
+ For custom MCP clients:
236
+
237
+ - **HTTP Mode** → Use the same setup as GitHub Copilot HTTP (JSON config with headers + observability env vars)
238
+ - **STDIO Mode** → Use the same setup as Claude STDIO (JSON config with server command, env vars, and observability flag)
239
+
240
+ ## Starting the Server
241
+
242
+ After updating configurations, you'll need to restart components. The steps differ by mode:
243
+
244
+ ### Streamable HTTP Mode
245
+
246
+ **Step 1: Export Environment Variables (if needed)**
247
+
248
+ In case the environment variables are not taking effect, export them in the mcp-instana server terminal:
249
+
250
+ ```bash
251
+ export ENABLE_MCP_OBSERVABILITY=true
252
+ export TRACELOOP_BASE_URL=<your-instana-otlp-url>
253
+ export TRACELOOP_HEADERS="x-instana-key=<your-instana-key>"
254
+ export OTEL_EXPORTER_OTLP_INSECURE=false
255
+ ```
256
+
257
+ **Note:** `TRACELOOP_BASE_URL` should be your Instana OTLP URL (e.g., `https://otlp-pink-saas.instana.rocks:4317`)
258
+
259
+ **Step 2: Start the Server**
260
+
261
+ Start the server explicitly with streamable HTTP transport:
262
+
263
+ ```bash
264
+ # Using development installation
265
+ uv run src/core/server.py --transport streamable-http
266
+
267
+ # Using PyPI installation
268
+ mcp-instana --transport streamable-http
269
+ ```
270
+
271
+ **Step 3: Restart the Client**
272
+
273
+ Restart the client (e.g., GitHub Copilot, Claude Desktop, or custom MCP client) using its configuration file.
274
+
275
+ ### STDIO Mode
276
+
277
+ In STDIO mode, you don't need to start the MCP server manually. The client (GitHub Copilot, Claude Desktop, or custom MCP client) will directly launch the MCP server process based on its configuration file.
278
+
279
+ Simply start the client, and it will take care of invoking the server under the hood.
280
+
281
+ **Important Note:** In some clients, the root span may not appear automatically unless the session is fully closed:
282
+
283
+ - **Claude Desktop** → Quit the Claude Desktop app after finishing your session
284
+ - **GitHub Copilot** → Stop the MCP server process after your workflow
285
+
286
+ If the session remains open, the root span will be missing from traces.
287
+
288
+ ## Viewing Traces in Instana
289
+
290
+ Once observability is enabled and the server is running, you can view traces in Instana:
291
+
292
+ 1. **Log in to Instana**
293
+ 2. **Navigate to Analytics** → Enable "Show internal calls" (bottom left)
294
+ 3. **Add Filter**: Service Name → `Instana-MCP-Server` (the app name you used with `traceloop.init()`)
295
+ 4. **Explore traces**:
296
+ - Filter by time range
297
+ - Drill into individual spans
298
+ - Analyze request flows end-to-end
299
+
300
+ This visualization makes it easy to trace requests and identify performance bottlenecks.
301
+
302
+ ### Key Benefits
303
+
304
+ Enabling observability brings immediate advantages:
305
+
306
+ - **End-to-End Visibility** – See client-to-server flows
307
+ - **Performance Optimization** – Identify bottlenecks with real data
308
+ - **Error Tracking** – Pinpoint failure points quickly
309
+ - **System Understanding** – Learn how components interact
310
+
311
+ ## Troubleshooting
312
+
313
+ ### No Spans Visible?
314
+
315
+ If you don't see any spans in Instana:
316
+
317
+ 1. **Verify the feature flag is set:**
318
+ ```bash
319
+ echo $ENABLE_MCP_OBSERVABILITY
320
+ # Should output: true
321
+ ```
322
+
323
+ 2. **Check Traceloop SDK installation:**
324
+ ```bash
325
+ pip show traceloop-sdk
326
+ ```
327
+
328
+ 3. **Confirm Instana configuration:**
329
+ - Verify `TRACELOOP_BASE_URL` is correct
330
+ - Verify `TRACELOOP_HEADERS` contains valid authentication key
331
+ - Check `OTEL_EXPORTER_OTLP_INSECURE` is set appropriately
332
+
333
+ 4. **Check server logs for errors:**
334
+ - Look for Traceloop initialization messages
335
+ - Check for connection errors to Instana
336
+
337
+ ### Environment Variables Not Taking Effect?
338
+
339
+ If environment variables don't seem to work:
340
+
341
+ 1. **For HTTP mode:** Export variables in the server terminal before starting
342
+ 2. **For STDIO mode:** Ensure variables are in the client configuration file
343
+ 3. **Restart both server and client** after configuration changes
344
+ 4. **Check for typos** in variable names (they are case-sensitive)