rootly-mcp-server 0.0.4__tar.gz → 1.0.0__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.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [2025] [Rootly]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,128 @@
1
+ Metadata-Version: 2.4
2
+ Name: rootly-mcp-server
3
+ Version: 1.0.0
4
+ Summary: A Model Context Protocol server for Rootly APIs using OpenAPI spec
5
+ Project-URL: Homepage, https://github.com/Rootly-AI-Labs/Rootly-MCP-server
6
+ Project-URL: Issues, https://github.com/Rootly-AI-Labs/Rootly-MCP-server/issues
7
+ Author-email: Rootly AI Labs <support@rootly.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: automation,incidents,llm,mcp,rootly
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Software Development :: Build Tools
16
+ Requires-Python: >=3.12
17
+ Requires-Dist: mcp>=1.1.2
18
+ Requires-Dist: pydantic>=2.0.0
19
+ Requires-Dist: requests>=2.28.0
20
+ Provides-Extra: dev
21
+ Requires-Dist: black>=23.0.0; extra == 'dev'
22
+ Requires-Dist: isort>=5.0.0; extra == 'dev'
23
+ Description-Content-Type: text/markdown
24
+
25
+ # Rootly MCP Server
26
+
27
+ An MCP server for [Rootly API](https://docs.rootly.com/api-reference/overview) that you can plug into your favorite MCP-compatible editors like Cursor, Windsurf, and Claude. Resolve production incidents in under a minute without leaving your IDE.
28
+ <br>
29
+ <br>
30
+
31
+ ![Demo GIF](rootly-mcp-server-demo.gif)
32
+
33
+
34
+ ## Prerequisites
35
+
36
+ - Python 3.12 or higher
37
+ - `uv` package manager
38
+ ```bash
39
+ curl -LsSf https://astral.sh/uv/install.sh | sh
40
+ ```
41
+ - [Rootly API token](https://docs.rootly.com/api-reference/overview#how-to-generate-an-api-key%3F)
42
+
43
+ ## Run it in your IDE
44
+ Install with our [PyPi package](https://pypi.org/project/rootly-mcp-server/) or by cloning this repo.
45
+
46
+ To set it up in your favorite MCP-compatible editor (we tested it with Cursor and Windsurf), here is the config :
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "rootly": {
51
+ "command": "uvx",
52
+ "args": [
53
+ "--from",
54
+ "rootly-mcp-server",
55
+ "rootly-mcp-server"
56
+ ],
57
+ "env": {
58
+ "ROOTLY_API_TOKEN": "<YOUR_ROOTLY_API_TOKEN>"
59
+ }
60
+ }
61
+ }
62
+ }
63
+ ```
64
+ If you want to customize `allowed_paths` to access more Rootly API paths, clone the package and use this config.
65
+ ```json
66
+ {
67
+ "mcpServers": {
68
+ "rootly": {
69
+ "command": "uv",
70
+ "args": [
71
+ "run",
72
+ "--directory",
73
+ "/path/to/rootly-mcp-server",
74
+ "rootly-mcp-server"
75
+ ],
76
+ "env": {
77
+ "ROOTLY_API_TOKEN": "<YOUR_ROOTLY_API_TOKEN>"
78
+ }
79
+ }
80
+ }
81
+ }
82
+ ```
83
+
84
+ ## Features
85
+ This server dynamically generates MCP resources based on Rootly's OpenAPI (Swagger) specification:
86
+ - Dynamically generated MCP tools based on Rootly's OpenAPI specification
87
+ - Default pagination (10 items) for incident endpoints to prevent context window overflow
88
+ - Limits the number of API paths exposed to the AI agent
89
+
90
+ We limited the number of API paths exposed for 2 reasons
91
+ * Context size: because [Rootly's API](https://docs.rootly.com/api-reference/overview) is very rich in paths, AI agents can get overwhelmed and not perform simple actions properly. As of now we only expose the [/incidents](https://docs.rootly.com/api-reference/incidents/list-incidents) and [/incidents/{incident_id}/alerts](https://docs.rootly.com/api-reference/incidentevents/list-incident-events).
92
+ * Security: if you want to limit the type of information or actions that users can access through the MCP server
93
+
94
+ If you want to make more path available, edit the variable `allowed_paths` in `src/rootly_mcp_server/server.py`.
95
+
96
+ ## Disclaimer
97
+ This project is a prototype and not intended for production use. If you have featured ideas or spotted some issues, feel free to submit a PR or open an issue.
98
+
99
+ ## About the Rootly AI Labs
100
+ This project was developed by the [Rootly AI Labs](https://labs.rootly.ai/). The AI Labs is building the future of system reliability and operational excellence. We operate as an open-source incubator, sharing ideas, experimenting, and rapidly prototyping. We're committed to ensuring our research benefits the entire community.
101
+ ![Rootly AI logo](https://github.com/Rootly-AI-Labs/EventOrOutage/raw/main/rootly-ai.png)
102
+
103
+ ## Developer Setup & Troubleshooting
104
+
105
+ ### 1. Install dependencies with `uv`
106
+ This project uses [`uv`](https://github.com/astral-sh/uv) for fast dependency management. To install all dependencies from your `pyproject.toml`:
107
+ ```bash
108
+ uv pip install .
109
+ ```
110
+
111
+ ### 2. Using a virtual environment
112
+ It is recommended to use a virtual environment for development:
113
+ ```bash
114
+ uv venv .venv
115
+ source .venv/bin/activate
116
+ ```
117
+
118
+ ### 3. Running the test client
119
+ To run the test client and verify your setup:
120
+ ```bash
121
+ python test_mcp_client.py
122
+ ```
123
+
124
+ ### 5. General tips
125
+ - Always activate your virtual environment before running scripts.
126
+ - If you add new dependencies, use `uv pip install <package>` to keep your environment up to date.
127
+ - If you encounter issues, check your Python version and ensure it matches the project's requirements.
128
+
@@ -0,0 +1,104 @@
1
+ # Rootly MCP Server
2
+
3
+ An MCP server for [Rootly API](https://docs.rootly.com/api-reference/overview) that you can plug into your favorite MCP-compatible editors like Cursor, Windsurf, and Claude. Resolve production incidents in under a minute without leaving your IDE.
4
+ <br>
5
+ <br>
6
+
7
+ ![Demo GIF](rootly-mcp-server-demo.gif)
8
+
9
+
10
+ ## Prerequisites
11
+
12
+ - Python 3.12 or higher
13
+ - `uv` package manager
14
+ ```bash
15
+ curl -LsSf https://astral.sh/uv/install.sh | sh
16
+ ```
17
+ - [Rootly API token](https://docs.rootly.com/api-reference/overview#how-to-generate-an-api-key%3F)
18
+
19
+ ## Run it in your IDE
20
+ Install with our [PyPi package](https://pypi.org/project/rootly-mcp-server/) or by cloning this repo.
21
+
22
+ To set it up in your favorite MCP-compatible editor (we tested it with Cursor and Windsurf), here is the config :
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "rootly": {
27
+ "command": "uvx",
28
+ "args": [
29
+ "--from",
30
+ "rootly-mcp-server",
31
+ "rootly-mcp-server"
32
+ ],
33
+ "env": {
34
+ "ROOTLY_API_TOKEN": "<YOUR_ROOTLY_API_TOKEN>"
35
+ }
36
+ }
37
+ }
38
+ }
39
+ ```
40
+ If you want to customize `allowed_paths` to access more Rootly API paths, clone the package and use this config.
41
+ ```json
42
+ {
43
+ "mcpServers": {
44
+ "rootly": {
45
+ "command": "uv",
46
+ "args": [
47
+ "run",
48
+ "--directory",
49
+ "/path/to/rootly-mcp-server",
50
+ "rootly-mcp-server"
51
+ ],
52
+ "env": {
53
+ "ROOTLY_API_TOKEN": "<YOUR_ROOTLY_API_TOKEN>"
54
+ }
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ ## Features
61
+ This server dynamically generates MCP resources based on Rootly's OpenAPI (Swagger) specification:
62
+ - Dynamically generated MCP tools based on Rootly's OpenAPI specification
63
+ - Default pagination (10 items) for incident endpoints to prevent context window overflow
64
+ - Limits the number of API paths exposed to the AI agent
65
+
66
+ We limited the number of API paths exposed for 2 reasons
67
+ * Context size: because [Rootly's API](https://docs.rootly.com/api-reference/overview) is very rich in paths, AI agents can get overwhelmed and not perform simple actions properly. As of now we only expose the [/incidents](https://docs.rootly.com/api-reference/incidents/list-incidents) and [/incidents/{incident_id}/alerts](https://docs.rootly.com/api-reference/incidentevents/list-incident-events).
68
+ * Security: if you want to limit the type of information or actions that users can access through the MCP server
69
+
70
+ If you want to make more path available, edit the variable `allowed_paths` in `src/rootly_mcp_server/server.py`.
71
+
72
+ ## Disclaimer
73
+ This project is a prototype and not intended for production use. If you have featured ideas or spotted some issues, feel free to submit a PR or open an issue.
74
+
75
+ ## About the Rootly AI Labs
76
+ This project was developed by the [Rootly AI Labs](https://labs.rootly.ai/). The AI Labs is building the future of system reliability and operational excellence. We operate as an open-source incubator, sharing ideas, experimenting, and rapidly prototyping. We're committed to ensuring our research benefits the entire community.
77
+ ![Rootly AI logo](https://github.com/Rootly-AI-Labs/EventOrOutage/raw/main/rootly-ai.png)
78
+
79
+ ## Developer Setup & Troubleshooting
80
+
81
+ ### 1. Install dependencies with `uv`
82
+ This project uses [`uv`](https://github.com/astral-sh/uv) for fast dependency management. To install all dependencies from your `pyproject.toml`:
83
+ ```bash
84
+ uv pip install .
85
+ ```
86
+
87
+ ### 2. Using a virtual environment
88
+ It is recommended to use a virtual environment for development:
89
+ ```bash
90
+ uv venv .venv
91
+ source .venv/bin/activate
92
+ ```
93
+
94
+ ### 3. Running the test client
95
+ To run the test client and verify your setup:
96
+ ```bash
97
+ python test_mcp_client.py
98
+ ```
99
+
100
+ ### 5. General tips
101
+ - Always activate your virtual environment before running scripts.
102
+ - If you add new dependencies, use `uv pip install <package>` to keep your environment up to date.
103
+ - If you encounter issues, check your Python version and ensure it matches the project's requirements.
104
+
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "rootly-mcp-server"
3
- version = "0.0.4"
3
+ version = "1.0.0"
4
4
  description = "A Model Context Protocol server for Rootly APIs using OpenAPI spec"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
7
7
  authors = [{ name = "Rootly AI Labs", email="support@rootly.com"}]
8
8
  keywords = ["rootly", "mcp", "llm", "automation", "incidents"]
9
- license = "AGPL-3.0-only"
9
+ license = "Apache-2.0"
10
10
  license-files = ["LICEN[CS]E*"]
11
11
  classifiers = [
12
12
  "Development Status :: 4 - Beta",
@@ -67,7 +67,11 @@ def setup_logging(log_level, debug=False):
67
67
 
68
68
  # Set specific logger levels
69
69
  logging.getLogger("rootly_mcp_server").setLevel(numeric_level)
70
- logging.getLogger("mcp").setLevel(numeric_level)
70
+ logging.getLogger("rootly_mcp_server.server").setLevel(logging.WARNING) # Reduce server-specific logs
71
+
72
+ # Always set MCP logger to ERROR level to fix Cline UI issue
73
+ # This prevents INFO logs from causing problems with Cline tool display
74
+ logging.getLogger("mcp").setLevel(logging.ERROR)
71
75
 
72
76
  # Log the configuration
73
77
  logger = logging.getLogger(__name__)
@@ -24,7 +24,7 @@ class RootlyClient:
24
24
  raise ValueError("ROOTLY_API_TOKEN environment variable is not set")
25
25
  return api_token
26
26
 
27
- def make_request(self, method: str, path: str, query_params: Optional[Dict[str, Any]] = None, json_data: Optional[Dict[str, Any]] = None) -> str:
27
+ def make_request(self, method: str, path: str, query_params: Optional[Dict[str, Any]] = None, json_data: Optional[Dict[str, Any]] = None, json_api_type: Optional[str] = None) -> str:
28
28
  """
29
29
  Make an authenticated request to the Rootly API.
30
30
 
@@ -33,16 +33,32 @@ class RootlyClient:
33
33
  path: The API path.
34
34
  query_params: Query parameters for the request.
35
35
  json_data: JSON data for the request body.
36
+ json_api_type: If set, use JSON-API format and this type value.
36
37
 
37
38
  Returns:
38
39
  The API response as a JSON string.
39
40
  """
41
+ # Default headers
40
42
  headers = {
41
43
  "Authorization": f"Bearer {self._api_token}",
42
44
  "Content-Type": "application/json",
43
45
  "Accept": "application/json"
44
46
  }
45
-
47
+
48
+ # If JSON-API, update headers and wrap payload
49
+ if json_api_type and method.upper() in ["POST", "PUT", "PATCH"]:
50
+ headers["Content-Type"] = "application/vnd.api+json"
51
+ headers["Accept"] = "application/vnd.api+json"
52
+ if json_data:
53
+ json_data = {
54
+ "data": {
55
+ "type": json_api_type,
56
+ "attributes": json_data
57
+ }
58
+ }
59
+ else:
60
+ json_data = None
61
+
46
62
  # Ensure path starts with a slash
47
63
  if not path.startswith("/"):
48
64
  path = f"/{path}"
@@ -55,7 +55,40 @@ class RootlyMCPServer(FastMCP):
55
55
  # Set default allowed paths if none provided
56
56
  self.allowed_paths = allowed_paths or [
57
57
  "/incidents",
58
- "/incidents/{incident_id}/alerts"
58
+ "/incidents/{incident_id}/alerts",
59
+ "/alerts",
60
+ "/alerts/{alert_id}",
61
+ "/severities",
62
+ "/severities/{severity_id}",
63
+ "/teams",
64
+ "/teams/{team_id}",
65
+ "/services",
66
+ "/services/{service_id}",
67
+ "/functionalities",
68
+ "/functionalities/{functionality_id}",
69
+ # Incident types
70
+ "/incident_types",
71
+ "/incident_types/{incident_type_id}",
72
+ # Action items (all, by id, by incident)
73
+ "/incident_action_items",
74
+ "/incident_action_items/{incident_action_item_id}",
75
+ "/incidents/{incident_id}/action_items",
76
+ # Workflows
77
+ "/workflows",
78
+ "/workflows/{workflow_id}",
79
+ # Workflow runs
80
+ "/workflow_runs",
81
+ "/workflow_runs/{workflow_run_id}",
82
+ # Environments
83
+ "/environments",
84
+ "/environments/{environment_id}",
85
+ # Users
86
+ "/users",
87
+ "/users/{user_id}",
88
+ "/users/me",
89
+ # Status pages
90
+ "/status_pages",
91
+ "/status_pages/{status_page_id}"
59
92
  ]
60
93
  # Add /v1 prefix to paths if not present
61
94
  self.allowed_paths = [
@@ -64,7 +97,8 @@ class RootlyMCPServer(FastMCP):
64
97
  ]
65
98
 
66
99
  logger.info(f"Initializing RootlyMCPServer with allowed paths: {self.allowed_paths}")
67
- super().__init__(name)
100
+ # Initialize FastMCP with ERROR log level to fix Cline UI issue
101
+ super().__init__(name, log_level="ERROR")
68
102
 
69
103
  # Initialize the Rootly API client
70
104
  self.client = RootlyClient()
@@ -356,7 +390,7 @@ class RootlyMCPServer(FastMCP):
356
390
  path: The API path.
357
391
  method: The HTTP method.
358
392
  operation: The Swagger operation object.
359
- **kwargs: The parameters for the request.
393
+ **v: The parameters for the request.
360
394
 
361
395
  Returns:
362
396
  The API response as a JSON string.
@@ -378,38 +412,39 @@ class RootlyMCPServer(FastMCP):
378
412
  body_params = {}
379
413
 
380
414
  if method.lower() == "get":
381
- # For GET requests, all remaining parameters are query parameters
382
415
  query_params = kwargs
383
-
384
- # Add default pagination for incident-related endpoints
385
416
  if "incidents" in path and method.lower() == "get":
386
- # Check if pagination parameters are already specified
387
417
  has_pagination = any(param.startswith("page[") for param in query_params.keys())
388
-
389
- # If no pagination parameters are specified, add default page size
390
418
  if not has_pagination:
391
419
  query_params["page[size]"] = self.default_page_size
392
- logger.info(f"Added default pagination (page[size]={self.default_page_size}) for incidents endpoint: {path}")
420
+ logger.debug(f"Added default pagination (page[size]={self.default_page_size}) for incidents endpoint: {path}")
393
421
  else:
394
- # For other methods, check which parameters are query parameters
395
422
  for param in operation.get("parameters", []):
396
423
  param_name = param.get("name")
397
424
  param_in = param.get("in")
398
-
399
425
  if param_in == "query" and param_name in kwargs:
400
426
  query_params[param_name] = kwargs.pop(param_name)
401
-
402
- # All remaining parameters go in the request body
403
427
  body_params = kwargs
404
428
 
405
- # Make the API request
406
429
  try:
430
+ json_api_type = None
431
+ if method.lower() in ["post", "put", "patch"]:
432
+ segments = [seg for seg in actual_path.split("/") if seg and not seg.startswith(":") and not seg.startswith("{")]
433
+ if segments:
434
+ if segments[-1].startswith("by_") or segments[-1].endswith("_id") or segments[-1].startswith("id") or segments[-1].startswith("{id"):
435
+ if len(segments) > 1:
436
+ json_api_type = segments[-2]
437
+ else:
438
+ json_api_type = segments[-1]
439
+
407
440
  response = self.client.make_request(
408
441
  method=method.upper(),
409
442
  path=actual_path,
410
443
  query_params=query_params if query_params else None,
411
- json_data=body_params if body_params else None
444
+ json_data=body_params if body_params else None,
445
+ json_api_type=json_api_type
412
446
  )
447
+ # Do not include kwargs or payload in the output, just return the response
413
448
  return response
414
449
  except Exception as e:
415
450
  logger.error(f"Error calling Rootly API: {e}")
@@ -78,7 +78,16 @@ def main():
78
78
  }
79
79
  })
80
80
  response = receive_message(process)
81
- print(f"Call Tool Response: {json.dumps(response, indent=2)}")
81
+ # Check for 'kwargs' in the response and print only its value parsed as JSON
82
+ if response and isinstance(response, dict) and "kwargs" in response:
83
+ try:
84
+ parsed_kwargs = json.loads(response["kwargs"])
85
+ print(json.dumps(parsed_kwargs, indent=2))
86
+ except Exception as e:
87
+ print(f"Error parsing 'kwargs': {e}")
88
+ print(f"Raw kwargs: {response['kwargs']}")
89
+ else:
90
+ print(f"Call Tool Response: {json.dumps(response, indent=2)}")
82
91
 
83
92
  except Exception as e:
84
93
  print(f"Error: {e}")
@@ -380,7 +380,7 @@ wheels = [
380
380
 
381
381
  [[package]]
382
382
  name = "rootly-mcp-server"
383
- version = "0.0.4"
383
+ version = "1.0.0"
384
384
  source = { editable = "." }
385
385
  dependencies = [
386
386
  { name = "mcp" },