Skip to content

Commit 5c55b04

Browse files
authored
Merge pull request #36 from mayurkhandave/34-fixes
Integrate Limits MCP server
2 parents 7c838ae + 1b805ca commit 5c55b04

File tree

10 files changed

+2087
-0
lines changed

10 files changed

+2087
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Copyright (c) 2025 Oracle and/or its affiliates.
2+
3+
The Universal Permissive License (UPL), Version 1.0
4+
5+
Subject to the condition set forth below, permission is hereby granted to any
6+
person obtaining a copy of this software, associated documentation and/or data
7+
(collectively the "Software"), free of charge and under any and all copyright
8+
rights in the Software, and any and all patent rights owned or freely
9+
licensable by each licensor hereunder covering either (i) the unmodified
10+
Software as contributed to or provided by such licensor, or (ii) the Larger
11+
Works (as defined below), to deal in both
12+
13+
(a) the Software, and
14+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
15+
one is included with the Software (each a "Larger Work" to which the Software
16+
is contributed by such licensors),
17+
18+
without restriction, including without limitation the rights to copy, create
19+
derivative works of, display, perform, and distribute the Software and make,
20+
use, sell, offer for sale, import, export, have made, and have sold the
21+
Software and the Larger Work(s), and to sublicense the foregoing rights on
22+
either these or other terms.
23+
24+
This license is subject to the following condition:
25+
The above copyright notice and either this complete permission notice or at
26+
a minimum a reference to the UPL must be included in all copies or
27+
substantial portions of the Software.
28+
29+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35+
SOFTWARE.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# OCI Limits MCP Server
2+
3+
## Overview
4+
5+
This MCP server exposes Oracle Cloud Infrastructure Limits APIs through tools mirroring public endpoints.
6+
7+
## Running the Server
8+
9+
To run the server:
10+
```sh
11+
uv run oracle.oci-limits-mcp-server
12+
```
13+
14+
## Tools
15+
16+
| Tool Name | Description | Parameters |
17+
| --- | --- | --- |
18+
| list_services | Returns supported services | compartment_id, sort_by='name', sort_order='ASC', limit=100, page=None, subscription_id=None |
19+
| list_limit_definitions | Returns limit definitions | compartment_id, service_name=None, name=None, sort_by='name', sort_order='ASC', limit=100, page=None, subscription_id=None |
20+
| list_limit_values | Returns limit values | compartment_id, service_name, scope_type=None, availability_domain=None, name=None, sort_by='name', sort_order='ASC', limit=100, page=None, subscription_id=None, external_location=None |
21+
| get_resource_availability | Returns usage/availability for a specific limit | service_name, limit_name, compartment_id, availability_domain=None, subscription_id=None, external_location=None |
22+
23+
## Authentication
24+
25+
Follows the same pattern as other OCI MCP servers:
26+
- Reads OCI config from ~/.oci/config
27+
- Uses security token authentication
28+
- Adds custom user agent header
29+
30+
## Notes
31+
32+
- For AD-scoped limits, `availability_domain` is required.
33+
- Tools return dicts aligned with Swagger models.
34+
35+
## License
36+
37+
Copyright (c) 2025 Oracle and/or its affiliates.
38+
Released under the Universal Permissive License v1.0.
39+
40+
## Third-Party APIs
41+
42+
Developers distributing binary implementations must obtain and provide required third-party licenses and copyright notices.
43+
44+
## Disclaimer
45+
46+
Users are responsible for local environment and credential safety. Different language models may yield different results.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""
2+
Copyright (c) 2025, Oracle and/or its affiliates.
3+
Licensed under the Universal Permissive License v1.0 as shown at
4+
https://oss.oracle.com/licenses/upl.
5+
"""
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"""
2+
Copyright (c) 2025, Oracle and/or its affiliates.
3+
Licensed under the Universal Permissive License v1.0 as shown at
4+
https://oss.oracle.com/licenses/upl.
5+
"""
6+
7+
__project__ = "oracle.oci-limits-mcp-server"
8+
__version__ = "1.0.1"
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
"""
2+
Copyright (c) 2025, Oracle and/or its affiliates.
3+
Licensed under the Universal Permissive License v1.0 as shown at
4+
https://oss.oracle.com/licenses/upl.
5+
"""
6+
7+
from __future__ import annotations
8+
9+
import oci
10+
11+
12+
# ----------------------------
13+
# Mappers to stable dict shapes
14+
# ----------------------------
15+
def map_service_summary(svc: "oci.limits.models.ServiceSummary") -> dict:
16+
"""Map OCI ServiceSummary to a stable dict shape used by our tools."""
17+
return {
18+
"name": getattr(svc, "name", None),
19+
"description": getattr(svc, "description", None),
20+
"supported_subscriptions": getattr(svc, "supported_subscriptions", None),
21+
}
22+
23+
24+
def map_limit_definition_summary(
25+
defn: "oci.limits.models.LimitDefinitionSummary",
26+
) -> dict:
27+
"""Map OCI LimitDefinitionSummary to a stable dict shape used by our tools."""
28+
return {
29+
"name": getattr(defn, "name", None),
30+
"serviceName": getattr(defn, "service_name", None),
31+
"description": getattr(defn, "description", None),
32+
"scopeType": getattr(defn, "scope_type", None),
33+
"areQuotasSupported": getattr(defn, "are_quotas_supported", None),
34+
"isResourceAvailabilitySupported": getattr(
35+
defn, "is_resource_availability_supported", None
36+
),
37+
"isDeprecated": getattr(defn, "is_deprecated", None),
38+
"isEligibleForLimitIncrease": getattr(
39+
defn, "is_eligible_for_limit_increase", None
40+
),
41+
"isDynamic": getattr(defn, "is_dynamic", None),
42+
"externalLocationSupportedSubscriptions": getattr(
43+
defn, "external_location_supported_subscriptions", None
44+
),
45+
"supportedSubscriptions": getattr(defn, "supported_subscriptions", None),
46+
"supportedQuotaFamilies": getattr(defn, "supported_quota_families", None),
47+
}
48+
49+
50+
def map_limit_value_summary(val: "oci.limits.models.LimitValueSummary") -> dict:
51+
"""Map OCI LimitValueSummary to a stable dict shape used by our tools."""
52+
return {
53+
"name": getattr(val, "name", None),
54+
"scopeType": getattr(val, "scope_type", None),
55+
"availabilityDomain": getattr(val, "availability_domain", None),
56+
"value": getattr(val, "value", None),
57+
}
58+
59+
60+
def map_resource_availability(ra: "oci.limits.models.ResourceAvailability") -> dict:
61+
"""Map OCI ResourceAvailability to a stable dict shape used by our tools."""
62+
return {
63+
"used": getattr(ra, "used", None),
64+
"available": getattr(ra, "available", None),
65+
"fractionalUsage": getattr(ra, "fractional_usage", None),
66+
"fractionalAvailability": getattr(ra, "fractional_availability", None),
67+
"effectiveQuotaValue": getattr(ra, "effective_quota_value", None),
68+
}
69+
70+
71+
__all__ = [
72+
"map_service_summary",
73+
"map_limit_definition_summary",
74+
"map_limit_value_summary",
75+
"map_resource_availability",
76+
]

0 commit comments

Comments
 (0)