rootly-mcp-server 0.0.2__py3-none-any.whl → 0.0.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.
@@ -11,6 +11,7 @@ import re
11
11
  import logging
12
12
  from pathlib import Path
13
13
  import requests
14
+ import importlib.resources
14
15
  from typing import Any, Dict, List, Optional, Tuple, Union, Callable
15
16
 
16
17
  import mcp
@@ -95,7 +96,10 @@ class RootlyMCPServer(FastMCP):
95
96
 
96
97
  Args:
97
98
  swagger_path: Path to the Swagger JSON file. If None, will look for
98
- swagger.json in the current directory and parent directories.
99
+ swagger.json in the following locations (in order):
100
+ 1. package data directory
101
+ 2. current directory and parent directories
102
+ 3. download from the URL
99
103
 
100
104
  Returns:
101
105
  The Swagger specification as a dictionary.
@@ -108,7 +112,17 @@ class RootlyMCPServer(FastMCP):
108
112
  with open(swagger_path, "r") as f:
109
113
  return json.load(f)
110
114
  else:
111
- # Look for swagger.json in the current directory and parent directories
115
+ # First, check in the package data directory
116
+ try:
117
+ package_data_path = Path(__file__).parent / "data" / "swagger.json"
118
+ if package_data_path.is_file():
119
+ logger.info(f"Found Swagger file in package data: {package_data_path}")
120
+ with open(package_data_path, "r") as f:
121
+ return json.load(f)
122
+ except Exception as e:
123
+ logger.debug(f"Could not load Swagger file from package data: {e}")
124
+
125
+ # Then, look for swagger.json in the current directory and parent directories
112
126
  logger.info("Looking for swagger.json in current directory and parent directories")
113
127
  current_dir = Path.cwd()
114
128
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rootly-mcp-server
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: A Model Context Protocol server for Rootly APIs using OpenAPI spec
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
@@ -29,6 +29,7 @@ A Model Context Protocol (MCP) server for Rootly API. This server dynamically ge
29
29
  ## Features
30
30
 
31
31
  - Dynamically generated MCP tools based on Rootly's OpenAPI specification
32
+ - Swagger specification is bundled with the package
32
33
  - Automatic fetching of the latest Swagger spec if not found locally
33
34
  - Authentication via Rootly API token
34
35
  - Default pagination (10 items) for incidents endpoints to prevent context window overflow
@@ -79,9 +80,10 @@ rootly-mcp-server
79
80
  ```
80
81
 
81
82
  The server will automatically:
82
- 1. Look for a local `swagger.json` file in the current and parent directories
83
- 2. If not found, download the latest Swagger spec from Rootly's servers
84
- 3. Cache the downloaded spec to `swagger.json` in the current directory for future use
83
+ 1. Use the bundled Swagger specification that comes with the package
84
+ 2. If not found in the package, look for a local `swagger.json` file in the current and parent directories
85
+ 3. If still not found, download the latest Swagger spec from Rootly's servers
86
+ 4. Cache the downloaded spec to `swagger.json` in the current directory for future use
85
87
 
86
88
  You can also specify a custom Swagger file path:
87
89
  ```bash
@@ -0,0 +1,12 @@
1
+ rootly_mcp_server/__init__.py,sha256=n-YajkwxYg0eoVvtYfYTY6slaktHTYvQbasg15HwGKo,628
2
+ rootly_mcp_server/__main__.py,sha256=vRu8UuyhWnpHiC8vtgyv8G-WpFwumj393NtoT2lUSBk,4058
3
+ rootly_mcp_server/client.py,sha256=vvaY_UaYLobeHbJwgsmFNX-2ABpYoKxMTie8DRBo_xk,3865
4
+ rootly_mcp_server/server.py,sha256=rVWBTrNaBsyhehenTr8480eFS0kegTmfYmOmL5RRFH4,16060
5
+ rootly_mcp_server/test_client.py,sha256=xFQ4cfUpD6qs-aLidy56B3nnV38EFvUe_eBHOqZOC9o,2191
6
+ rootly_mcp_server/data/__init__.py,sha256=fO8a0bQnRVEoRMHKvhFzj10bhoaw7VsI51czc2MsUm4,143
7
+ rootly_mcp_server/data/swagger.json,sha256=8Ag4COTnS3WSC6vBaa2Q7hq3RxIQ8fGrmwsnNSnPheA,2046619
8
+ rootly_mcp_server-0.0.3.dist-info/METADATA,sha256=gE-_Uw5HKIX7e7u4CUsZMBI6U3JioU8jC7K1WU2FRq0,3775
9
+ rootly_mcp_server-0.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ rootly_mcp_server-0.0.3.dist-info/entry_points.txt,sha256=NE33b8VgigVPGBkboyo6pvN1Vz35HZtLybxMO4Q03PI,70
11
+ rootly_mcp_server-0.0.3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
12
+ rootly_mcp_server-0.0.3.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- rootly_mcp_server/__init__.py,sha256=n-YajkwxYg0eoVvtYfYTY6slaktHTYvQbasg15HwGKo,628
2
- rootly_mcp_server/__main__.py,sha256=vRu8UuyhWnpHiC8vtgyv8G-WpFwumj393NtoT2lUSBk,4058
3
- rootly_mcp_server/client.py,sha256=vvaY_UaYLobeHbJwgsmFNX-2ABpYoKxMTie8DRBo_xk,3865
4
- rootly_mcp_server/server.py,sha256=C9VkrZEfkYy_MZwKw5gMOf__WhV7JMFE7BUqpax2nos,15330
5
- rootly_mcp_server/test_client.py,sha256=xFQ4cfUpD6qs-aLidy56B3nnV38EFvUe_eBHOqZOC9o,2191
6
- rootly_mcp_server-0.0.2.dist-info/METADATA,sha256=AXFB-cXLGYsS3E-GFeI2KQakclint98yY3z-2km6eFY,3619
7
- rootly_mcp_server-0.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
- rootly_mcp_server-0.0.2.dist-info/entry_points.txt,sha256=NE33b8VgigVPGBkboyo6pvN1Vz35HZtLybxMO4Q03PI,70
9
- rootly_mcp_server-0.0.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
10
- rootly_mcp_server-0.0.2.dist-info/RECORD,,