rootly-mcp-server 2.2.2__py3-none-any.whl → 2.2.3__py3-none-any.whl

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.
@@ -14,10 +14,15 @@ Features:
14
14
  - Input validation and sensitive data masking
15
15
  """
16
16
 
17
+ from importlib.metadata import PackageNotFoundError, version
18
+
17
19
  from .client import RootlyClient
18
20
  from .server import RootlyMCPServer
19
21
 
20
- __version__ = "2.1.0"
22
+ try:
23
+ __version__ = version("rootly-mcp-server")
24
+ except PackageNotFoundError:
25
+ __version__ = "dev"
21
26
  __all__ = [
22
27
  "RootlyMCPServer",
23
28
  "RootlyClient",
@@ -386,6 +386,11 @@ class AuthenticatedHTTPXClient:
386
386
  if "params" in kwargs:
387
387
  kwargs["params"] = self._transform_params(kwargs["params"])
388
388
 
389
+ # Log incoming headers for debugging (before transformation)
390
+ incoming_headers = kwargs.get("headers", {})
391
+ if incoming_headers:
392
+ logger.debug(f"Incoming headers for {method} {url}: {list(incoming_headers.keys())}")
393
+
389
394
  # ALWAYS ensure Content-Type and Accept headers are set correctly for Rootly API
390
395
  # This is critical because:
391
396
  # 1. FastMCP's get_http_headers() returns LOWERCASE header keys (e.g., "content-type")
@@ -395,14 +400,27 @@ class AuthenticatedHTTPXClient:
395
400
  # Remove any existing content-type and accept headers (case-insensitive)
396
401
  headers_to_remove = [k for k in headers if k.lower() in ("content-type", "accept")]
397
402
  for key in headers_to_remove:
403
+ logger.debug(f"Removing header '{key}' with value '{headers[key]}'")
398
404
  del headers[key]
399
405
  # Set the correct JSON-API headers
400
406
  headers["Content-Type"] = "application/vnd.api+json"
401
407
  headers["Accept"] = "application/vnd.api+json"
402
408
  kwargs["headers"] = headers
403
409
 
404
- # Call the underlying client's request method and let it handle everything
405
- return await self.client.request(method, url, **kwargs)
410
+ # Log outgoing request
411
+ logger.debug(f"Request: {method} {url}")
412
+
413
+ response = await self.client.request(method, url, **kwargs)
414
+ logger.debug(f"Response: {method} {url} -> {response.status_code}")
415
+
416
+ # Log error responses (4xx/5xx)
417
+ if response.is_error:
418
+ logger.error(
419
+ f"HTTP {response.status_code} error for {method} {url}: "
420
+ f"{response.text[:500] if response.text else 'No response body'}"
421
+ )
422
+
423
+ return response
406
424
 
407
425
  async def get(self, url: str, **kwargs):
408
426
  """Proxy to request with GET method."""
@@ -548,6 +566,20 @@ def create_rootly_mcp_server(
548
566
 
549
567
  return endpoints
550
568
 
569
+ @mcp.tool()
570
+ def get_server_version() -> dict:
571
+ """Get the Rootly MCP server version.
572
+
573
+ Returns the current version of the deployed MCP server.
574
+ Useful for checking if the server has been updated.
575
+ """
576
+ from rootly_mcp_server import __version__
577
+
578
+ return {
579
+ "version": __version__,
580
+ "package": "rootly-mcp-server",
581
+ }
582
+
551
583
  async def make_authenticated_request(method: str, url: str, **kwargs):
552
584
  """Make an authenticated request, extracting token from MCP headers in hosted mode."""
553
585
  # In hosted mode, get token from MCP request headers
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rootly-mcp-server
3
- Version: 2.2.2
3
+ Version: 2.2.3
4
4
  Summary: Secure Model Context Protocol server for Rootly APIs with AI SRE capabilities, comprehensive error handling, and input validation
5
5
  Project-URL: Homepage, https://github.com/Rootly-AI-Labs/Rootly-MCP-server
6
6
  Project-URL: Issues, https://github.com/Rootly-AI-Labs/Rootly-MCP-server/issues
@@ -1,4 +1,4 @@
1
- rootly_mcp_server/__init__.py,sha256=LAXe2qmP6Yw5MMx-02NAIObwY6l4lKDf8SegYJ0jUhs,873
1
+ rootly_mcp_server/__init__.py,sha256=gVb0QKxeezBs9AeLpItWcUPem4gVQkSao89yOxSQ9j4,1018
2
2
  rootly_mcp_server/__main__.py,sha256=mt74vaOpfHnX5rTO0CFAeulatR_9K3NBNCaLAhBLxlc,6886
3
3
  rootly_mcp_server/client.py,sha256=Qca2R9cgBxXcyobQj4RHl8gdxLB4Jphq0RIr61DAVKw,6542
4
4
  rootly_mcp_server/exceptions.py,sha256=67J_wlfOICg87eUipbkARzn_6u_Io82L-5cVnk2UPr0,4504
@@ -6,14 +6,14 @@ rootly_mcp_server/monitoring.py,sha256=k1X7vK65FOTrCrOsLUXrFm6AJxKpXt_a0PzL6xdPu
6
6
  rootly_mcp_server/och_client.py,sha256=6UBP7MLkaDOGcJ78hQgSqTyrtr41XwDTqOOfUnoMJkc,2861
7
7
  rootly_mcp_server/pagination.py,sha256=2hZSO4DLUEJZbdF8oDfIt2_7X_XGBG1jIxN8VGmeJBE,2420
8
8
  rootly_mcp_server/security.py,sha256=YkMoVALZ3XaKnMu3yF5kVf3SW_jdKHllSMwVLk1OlX0,11556
9
- rootly_mcp_server/server.py,sha256=bfaShoTBRfRNHq_oNLVNB_l2lLPvwb6HJccwaibvCyE,164141
9
+ rootly_mcp_server/server.py,sha256=CurzboZoxqqiwda66gB6pUMLDzqnQLpTPqAVMP65DeI,165238
10
10
  rootly_mcp_server/smart_utils.py,sha256=c7S-8H151GfmDw6dZBDdLH_cCmR1qiXkKEYSKc0WwUY,23481
11
11
  rootly_mcp_server/texttest.json,sha256=KV9m13kWugmW1VEpU80Irp50uCcLgJtV1YT-JzMogQg,154182
12
12
  rootly_mcp_server/utils.py,sha256=TWG1MaaFKrU1phRhU6FgHuZAEv91JOe_1w0L2OrPJMY,4406
13
13
  rootly_mcp_server/validators.py,sha256=z1Lvel2SpOFLo1cPdQGSrX2ySt6zqR42w0R6QV9c2Cc,4092
14
14
  rootly_mcp_server/data/__init__.py,sha256=KdWD6hiRssHXt0Ywgj3wjNHY1sx-XSPEqVHqrTArf54,143
15
- rootly_mcp_server-2.2.2.dist-info/METADATA,sha256=aGgPxMn396G_CWz_FAs2t8D3nSvISulu74OO0y4kN2M,9907
16
- rootly_mcp_server-2.2.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
17
- rootly_mcp_server-2.2.2.dist-info/entry_points.txt,sha256=NE33b8VgigVPGBkboyo6pvN1Vz35HZtLybxMO4Q03PI,70
18
- rootly_mcp_server-2.2.2.dist-info/licenses/LICENSE,sha256=c9w9ZZGl14r54tsP40oaq5adTVX_HMNHozPIH2ymzmw,11341
19
- rootly_mcp_server-2.2.2.dist-info/RECORD,,
15
+ rootly_mcp_server-2.2.3.dist-info/METADATA,sha256=5Kgt7YDxy9AqRGOx-K7RZoKm3f4hl6k-fOz6Ai7-HxI,9907
16
+ rootly_mcp_server-2.2.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
17
+ rootly_mcp_server-2.2.3.dist-info/entry_points.txt,sha256=NE33b8VgigVPGBkboyo6pvN1Vz35HZtLybxMO4Q03PI,70
18
+ rootly_mcp_server-2.2.3.dist-info/licenses/LICENSE,sha256=c9w9ZZGl14r54tsP40oaq5adTVX_HMNHozPIH2ymzmw,11341
19
+ rootly_mcp_server-2.2.3.dist-info/RECORD,,