awslabs.openapi-mcp-server 0.2.8__py3-none-any.whl → 0.2.10__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.
- awslabs/__init__.py +1 -0
- awslabs/openapi_mcp_server/__init__.py +1 -1
- awslabs/openapi_mcp_server/prompts/generators/operation_prompts.py +7 -7
- awslabs/openapi_mcp_server/server.py +4 -9
- {awslabs_openapi_mcp_server-0.2.8.dist-info → awslabs_openapi_mcp_server-0.2.10.dist-info}/METADATA +17 -16
- {awslabs_openapi_mcp_server-0.2.8.dist-info → awslabs_openapi_mcp_server-0.2.10.dist-info}/RECORD +10 -10
- {awslabs_openapi_mcp_server-0.2.8.dist-info → awslabs_openapi_mcp_server-0.2.10.dist-info}/WHEEL +0 -0
- {awslabs_openapi_mcp_server-0.2.8.dist-info → awslabs_openapi_mcp_server-0.2.10.dist-info}/entry_points.txt +0 -0
- {awslabs_openapi_mcp_server-0.2.8.dist-info → awslabs_openapi_mcp_server-0.2.10.dist-info}/licenses/LICENSE +0 -0
- {awslabs_openapi_mcp_server-0.2.8.dist-info → awslabs_openapi_mcp_server-0.2.10.dist-info}/licenses/NOTICE +0 -0
awslabs/__init__.py
CHANGED
|
@@ -20,7 +20,7 @@ from awslabs.openapi_mcp_server.prompts.models import (
|
|
|
20
20
|
)
|
|
21
21
|
from fastmcp.prompts.prompt import Prompt
|
|
22
22
|
from fastmcp.prompts.prompt import PromptArgument as FastMCPPromptArgument
|
|
23
|
-
from fastmcp.server.openapi import
|
|
23
|
+
from fastmcp.server.openapi import MCPType
|
|
24
24
|
from typing import Any, Dict, List, Optional
|
|
25
25
|
|
|
26
26
|
|
|
@@ -178,16 +178,16 @@ def determine_operation_type(server: Any, path: str, method: str) -> str:
|
|
|
178
178
|
for route in routes:
|
|
179
179
|
route_path = getattr(route, 'path', '')
|
|
180
180
|
route_method = getattr(route, 'method', '')
|
|
181
|
-
|
|
181
|
+
mcp_type = getattr(route, 'mcp_type', None)
|
|
182
182
|
|
|
183
183
|
# Check if this route matches our operation
|
|
184
|
-
if route_path == path and route_method.upper() == method.upper() and
|
|
185
|
-
# Convert
|
|
186
|
-
if
|
|
184
|
+
if route_path == path and route_method.upper() == method.upper() and mcp_type:
|
|
185
|
+
# Convert MCPType enum to string
|
|
186
|
+
if mcp_type == MCPType.RESOURCE:
|
|
187
187
|
operation_type = 'resource'
|
|
188
|
-
elif
|
|
188
|
+
elif mcp_type == MCPType.RESOURCE_TEMPLATE:
|
|
189
189
|
operation_type = 'resource_template'
|
|
190
|
-
elif
|
|
190
|
+
elif mcp_type == MCPType.TOOL:
|
|
191
191
|
operation_type = 'tool'
|
|
192
192
|
break
|
|
193
193
|
|
|
@@ -29,7 +29,7 @@ from awslabs.openapi_mcp_server.utils.metrics_provider import metrics
|
|
|
29
29
|
from awslabs.openapi_mcp_server.utils.openapi import load_openapi_spec
|
|
30
30
|
from awslabs.openapi_mcp_server.utils.openapi_validator import validate_openapi_spec
|
|
31
31
|
from fastmcp import FastMCP
|
|
32
|
-
from fastmcp.server.openapi import FastMCPOpenAPI,
|
|
32
|
+
from fastmcp.server.openapi import FastMCPOpenAPI, MCPType, RouteMap
|
|
33
33
|
from typing import Any, Dict
|
|
34
34
|
|
|
35
35
|
|
|
@@ -57,11 +57,6 @@ def create_mcp_server(config: Config) -> FastMCP:
|
|
|
57
57
|
server = FastMCP(
|
|
58
58
|
'awslabs.openapi-mcp-server',
|
|
59
59
|
instructions='This server acts as a bridge between OpenAPI specifications and LLMs, allowing models to have a better understanding of available API capabilities without requiring manual tool definitions.',
|
|
60
|
-
dependencies=[
|
|
61
|
-
'pydantic',
|
|
62
|
-
'loguru',
|
|
63
|
-
'httpx',
|
|
64
|
-
],
|
|
65
60
|
)
|
|
66
61
|
|
|
67
62
|
try:
|
|
@@ -184,7 +179,7 @@ def create_mcp_server(config: Config) -> FastMCP:
|
|
|
184
179
|
RouteMap(
|
|
185
180
|
methods=['GET'],
|
|
186
181
|
pattern=f'^{re.escape(path)}$',
|
|
187
|
-
|
|
182
|
+
mcp_type=MCPType.TOOL,
|
|
188
183
|
)
|
|
189
184
|
)
|
|
190
185
|
|
|
@@ -214,8 +209,8 @@ def create_mcp_server(config: Config) -> FastMCP:
|
|
|
214
209
|
for i, route in enumerate(routes):
|
|
215
210
|
path = getattr(route, 'path', 'unknown')
|
|
216
211
|
method = getattr(route, 'method', 'unknown')
|
|
217
|
-
|
|
218
|
-
logger.debug(f'Route {i}: {method} {path} - Type: {
|
|
212
|
+
mcp_type = getattr(route, 'mcp_type', 'unknown')
|
|
213
|
+
logger.debug(f'Route {i}: {method} {path} - Type: {mcp_type}')
|
|
219
214
|
|
|
220
215
|
logger.info(f'Successfully configured API: {config.api_name}')
|
|
221
216
|
|
{awslabs_openapi_mcp_server-0.2.8.dist-info → awslabs_openapi_mcp_server-0.2.10.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: awslabs.openapi-mcp-server
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.10
|
|
4
4
|
Summary: An AWS Labs Model Context Protocol (MCP) server for OpenAPI
|
|
5
5
|
Project-URL: Homepage, https://awslabs.github.io/mcp/
|
|
6
6
|
Project-URL: Documentation, https://awslabs.github.io/mcp/servers/openapi-mcp-server/
|
|
@@ -24,7 +24,7 @@ Requires-Python: >=3.10
|
|
|
24
24
|
Requires-Dist: bcrypt>=4.3.0
|
|
25
25
|
Requires-Dist: boto3>=1.39.3
|
|
26
26
|
Requires-Dist: cachetools>=6.1.0
|
|
27
|
-
Requires-Dist: fastmcp>=2.
|
|
27
|
+
Requires-Dist: fastmcp>=2.14.0
|
|
28
28
|
Requires-Dist: httpx>=0.28.1
|
|
29
29
|
Requires-Dist: loguru>=0.7.3
|
|
30
30
|
Requires-Dist: openapi-spec-validator>=0.7.2
|
|
@@ -86,9 +86,9 @@ This project is a server that dynamically creates Model Context Protocol (MCP) t
|
|
|
86
86
|
|
|
87
87
|
## Installation
|
|
88
88
|
|
|
89
|
-
| Cursor | VS Code |
|
|
90
|
-
|
|
91
|
-
| [](https://cursor.com/en/install-mcp?name=awslabs.openapi-mcp-server&config=eyJjb21tYW5kIjoidXZ4IGF3c2xhYnMub3BlbmFwaS1tY3Atc2VydmVyQGxhdGVzdCIsImVudiI6eyJBUElfTkFNRSI6InlvdXItYXBpLW5hbWUiLCJBUElfQkFTRV9VUkwiOiJodHRwczovL2FwaS5leGFtcGxlLmNvbSIsIkFQSV9TUEVDX1VSTCI6Imh0dHBzOi8vYXBpLmV4YW1wbGUuY29tL29wZW5hcGkuanNvbiIsIkxPR19MRVZFTCI6IkVSUk9SIiwiRU5BQkxFX1BST01FVEhFVVMiOiJmYWxzZSIsIkVOQUJMRV9PUEVSQVRJT05fUFJPTVBUUyI6InRydWUiLCJVVklDT1JOX1RJTUVPVVRfR1JBQ0VGVUxfU0hVVERPV04iOiI1LjAiLCJVVklDT1JOX0dSQUNFRlVMX1NIVVRET1dOIjoidHJ1ZSJ9LCJkaXNhYmxlZCI6ZmFsc2UsImF1dG9BcHByb3ZlIjpbXX0%3D) | [](https://insiders.vscode.dev/redirect/mcp/install?name=OpenAPI%20MCP%20Server&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22awslabs.openapi-mcp-server%40latest%22%5D%2C%22env%22%3A%7B%22API_NAME%22%3A%22your-api-name%22%2C%22API_BASE_URL%22%3A%22https%3A%2F%2Fapi.example.com%22%2C%22API_SPEC_URL%22%3A%22https%3A%2F%2Fapi.example.com%2Fopenapi.json%22%2C%22LOG_LEVEL%22%3A%22ERROR%22%2C%22ENABLE_PROMETHEUS%22%3A%22false%22%2C%22ENABLE_OPERATION_PROMPTS%22%3A%22true%22%2C%22UVICORN_TIMEOUT_GRACEFUL_SHUTDOWN%22%3A%225.0%22%2C%22UVICORN_GRACEFUL_SHUTDOWN%22%3A%22true%22%7D%2C%22disabled%22%3Afalse%2C%22autoApprove%22%3A%5B%5D%7D) |
|
|
89
|
+
| Kiro | Cursor | VS Code |
|
|
90
|
+
|:----:|:------:|:-------:|
|
|
91
|
+
| [](https://kiro.dev/launch/mcp/add?name=awslabs.openapi-mcp-server&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22awslabs.openapi-mcp-server%40latest%22%5D%2C%22env%22%3A%7B%22API_NAME%22%3A%22your-api-name%22%2C%22API_BASE_URL%22%3A%22https%3A//api.example.com%22%2C%22API_SPEC_URL%22%3A%22https%3A//api.example.com/openapi.json%22%2C%22LOG_LEVEL%22%3A%22ERROR%22%2C%22ENABLE_PROMETHEUS%22%3A%22false%22%2C%22ENABLE_OPERATION_PROMPTS%22%3A%22true%22%2C%22UVICORN_TIMEOUT_GRACEFUL_SHUTDOWN%22%3A%225.0%22%2C%22UVICORN_GRACEFUL_SHUTDOWN%22%3A%22true%22%7D%7D) | [](https://cursor.com/en/install-mcp?name=awslabs.openapi-mcp-server&config=eyJjb21tYW5kIjoidXZ4IGF3c2xhYnMub3BlbmFwaS1tY3Atc2VydmVyQGxhdGVzdCIsImVudiI6eyJBUElfTkFNRSI6InlvdXItYXBpLW5hbWUiLCJBUElfQkFTRV9VUkwiOiJodHRwczovL2FwaS5leGFtcGxlLmNvbSIsIkFQSV9TUEVDX1VSTCI6Imh0dHBzOi8vYXBpLmV4YW1wbGUuY29tL29wZW5hcGkuanNvbiIsIkxPR19MRVZFTCI6IkVSUk9SIiwiRU5BQkxFX1BST01FVEhFVVMiOiJmYWxzZSIsIkVOQUJMRV9PUEVSQVRJT05fUFJPTVBUUyI6InRydWUiLCJVVklDT1JOX1RJTUVPVVRfR1JBQ0VGVUxfU0hVVERPV04iOiI1LjAiLCJVVklDT1JOX0dSQUNFRlVMX1NIVVRET1dOIjoidHJ1ZSJ9LCJkaXNhYmxlZCI6ZmFsc2UsImF1dG9BcHByb3ZlIjpbXX0%3D) | [](https://insiders.vscode.dev/redirect/mcp/install?name=OpenAPI%20MCP%20Server&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22awslabs.openapi-mcp-server%40latest%22%5D%2C%22env%22%3A%7B%22API_NAME%22%3A%22your-api-name%22%2C%22API_BASE_URL%22%3A%22https%3A%2F%2Fapi.example.com%22%2C%22API_SPEC_URL%22%3A%22https%3A%2F%2Fapi.example.com%2Fopenapi.json%22%2C%22LOG_LEVEL%22%3A%22ERROR%22%2C%22ENABLE_PROMETHEUS%22%3A%22false%22%2C%22ENABLE_OPERATION_PROMPTS%22%3A%22true%22%2C%22UVICORN_TIMEOUT_GRACEFUL_SHUTDOWN%22%3A%225.0%22%2C%22UVICORN_GRACEFUL_SHUTDOWN%22%3A%22true%22%7D%2C%22disabled%22%3Afalse%2C%22autoApprove%22%3A%5B%5D%7D) |
|
|
92
92
|
|
|
93
93
|
### From PyPI
|
|
94
94
|
|
|
@@ -124,7 +124,7 @@ pip install -e .
|
|
|
124
124
|
|
|
125
125
|
### Using MCP Configuration
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
Example configuration for Kiro (`~/.kiro/settings/mcp.json`):
|
|
128
128
|
|
|
129
129
|
```json
|
|
130
130
|
{
|
|
@@ -397,17 +397,18 @@ The server includes built-in monitoring capabilities:
|
|
|
397
397
|
- Prometheus metrics (disabled by default)
|
|
398
398
|
- Detailed logging of API calls and tool usage
|
|
399
399
|
- Performance tracking for API operations
|
|
400
|
-
## Testing with Amazon Q
|
|
401
400
|
|
|
402
|
-
|
|
401
|
+
## Testing with Kiro
|
|
403
402
|
|
|
404
|
-
|
|
403
|
+
To test the OpenAPI MCP Server with Kiro, you need to configure Kiro to use your MCP server. Here's how:
|
|
404
|
+
|
|
405
|
+
1. **Configure Kiro MCP Integration**
|
|
405
406
|
|
|
406
407
|
Create or edit the MCP configuration file:
|
|
407
408
|
|
|
408
409
|
```bash
|
|
409
|
-
mkdir -p ~/.
|
|
410
|
-
nano ~/.
|
|
410
|
+
mkdir -p ~/.kiro/settings
|
|
411
|
+
nano ~/.kiro/settings/mcp.json
|
|
411
412
|
```
|
|
412
413
|
|
|
413
414
|
Add the following configuration:
|
|
@@ -437,20 +438,20 @@ To test the OpenAPI MCP Server with Amazon Q, you need to configure Amazon Q to
|
|
|
437
438
|
}
|
|
438
439
|
```
|
|
439
440
|
|
|
440
|
-
2. **Start
|
|
441
|
+
2. **Start Kiro CLI**
|
|
441
442
|
|
|
442
|
-
Launch the
|
|
443
|
+
Launch the Kiro CLI:
|
|
443
444
|
|
|
444
445
|
```bash
|
|
445
|
-
|
|
446
|
+
kiro-cli chat
|
|
446
447
|
```
|
|
447
448
|
|
|
448
449
|
3. **Test the Operation Prompts**
|
|
449
450
|
|
|
450
|
-
Once connected, you can test the operation prompts by asking
|
|
451
|
+
Once connected, you can test the operation prompts by asking Kiro to help you with specific API operations:
|
|
451
452
|
|
|
452
453
|
```
|
|
453
454
|
I need to find a pet by ID using the Petstore API
|
|
454
455
|
```
|
|
455
456
|
|
|
456
|
-
|
|
457
|
+
Kiro should respond with guidance using the natural language prompt.
|
{awslabs_openapi_mcp_server-0.2.8.dist-info → awslabs_openapi_mcp_server-0.2.10.dist-info}/RECORD
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
awslabs/__init__.py,sha256=
|
|
2
|
-
awslabs/openapi_mcp_server/__init__.py,sha256=
|
|
3
|
-
awslabs/openapi_mcp_server/server.py,sha256=
|
|
1
|
+
awslabs/__init__.py,sha256=S-EDeDHGZzllMFhAeuJx_47fv85t2OUMOcsOisD5d_8,796
|
|
2
|
+
awslabs/openapi_mcp_server/__init__.py,sha256=KvZTootEq0yM2pvTuKzQxatRs-QrhMrcmocQMEU4VlQ,2061
|
|
3
|
+
awslabs/openapi_mcp_server/server.py,sha256=NVe2uoqEsP2N30gIo6WihLaWyTMFvcgq8_LA0LFCUhY,21633
|
|
4
4
|
awslabs/openapi_mcp_server/api/__init__.py,sha256=KWcmd1bH1vact1QJBfR0zFX7knWhFrBgaMEe9Tu9qi0,774
|
|
5
5
|
awslabs/openapi_mcp_server/api/config.py,sha256=WT9ELzBOtZkd_DrzrkL_uuVoDibw2k94tU28CvHL32Q,9503
|
|
6
6
|
awslabs/openapi_mcp_server/auth/__init__.py,sha256=wDFPpe2PmaDVvlYSdzR4saSKthgQmVPr9lwaKe3Z2RE,1109
|
|
@@ -20,7 +20,7 @@ awslabs/openapi_mcp_server/prompts/__init__.py,sha256=exMV01HgSORPPbkPC7AZE2Uqfr
|
|
|
20
20
|
awslabs/openapi_mcp_server/prompts/models.py,sha256=rExqLJWMJSYwzgXXilXZCJCHA8inrddOoW4591X2SEo,2748
|
|
21
21
|
awslabs/openapi_mcp_server/prompts/prompt_manager.py,sha256=Vmbv9nkzkAFD7y-ZIhN8WKZDHOA9ljU1mpZdflwLEYg,5700
|
|
22
22
|
awslabs/openapi_mcp_server/prompts/generators/__init__.py,sha256=rd7gP2YOqE0OFgTqlSyS9AFABh_xsT33KdbSwQ5RuMM,968
|
|
23
|
-
awslabs/openapi_mcp_server/prompts/generators/operation_prompts.py,sha256=
|
|
23
|
+
awslabs/openapi_mcp_server/prompts/generators/operation_prompts.py,sha256=Rj_0BQBO8RGvluhHPyjdNF-nMQcCU0ftjOwLacSNstY,25744
|
|
24
24
|
awslabs/openapi_mcp_server/prompts/generators/workflow_prompts.py,sha256=IfexW1eQseeW2SBqTPKq3GgqMKTKPtvMXQ4JR-2YdXk,10138
|
|
25
25
|
awslabs/openapi_mcp_server/utils/__init__.py,sha256=6ATm6O_0iCswDeBA2LZKwRdZVePcXrG4VxDo2YW-sK0,728
|
|
26
26
|
awslabs/openapi_mcp_server/utils/cache_provider.py,sha256=gyPOnfrc0RGf-w3e6FbinZFHPTjWmVm66FHi-TjL0Uo,8252
|
|
@@ -30,9 +30,9 @@ awslabs/openapi_mcp_server/utils/http_client.py,sha256=a2wu7lfyuq1O_6ilaFQ9geFJy
|
|
|
30
30
|
awslabs/openapi_mcp_server/utils/metrics_provider.py,sha256=1R__ZUxUrrB5KoKx4q6WYWHhaDTpFnr0UWTgZO28HVI,17731
|
|
31
31
|
awslabs/openapi_mcp_server/utils/openapi.py,sha256=eRQUC5AidkyR1ALQNsR0kLXlr0Mq8ZXCduLVWUXXhuA,8802
|
|
32
32
|
awslabs/openapi_mcp_server/utils/openapi_validator.py,sha256=MVJj84a8vw0BUn21pfkav6oJagDF1dSotcLK9otXzE4,9614
|
|
33
|
-
awslabs_openapi_mcp_server-0.2.
|
|
34
|
-
awslabs_openapi_mcp_server-0.2.
|
|
35
|
-
awslabs_openapi_mcp_server-0.2.
|
|
36
|
-
awslabs_openapi_mcp_server-0.2.
|
|
37
|
-
awslabs_openapi_mcp_server-0.2.
|
|
38
|
-
awslabs_openapi_mcp_server-0.2.
|
|
33
|
+
awslabs_openapi_mcp_server-0.2.10.dist-info/METADATA,sha256=v6HokDxOcB0ehygaFvG6oP102rSk-zrcFbZA9bP7J28,19955
|
|
34
|
+
awslabs_openapi_mcp_server-0.2.10.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
35
|
+
awslabs_openapi_mcp_server-0.2.10.dist-info/entry_points.txt,sha256=0BwvRNOdGm62ExFDks-9tSTWgtOdI3qmg-aemCMXQkM,86
|
|
36
|
+
awslabs_openapi_mcp_server-0.2.10.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
|
|
37
|
+
awslabs_openapi_mcp_server-0.2.10.dist-info/licenses/NOTICE,sha256=fG29aqEG3L4KHNXheKdyD5TdsgFh7eaaFlXu-okbf5o,94
|
|
38
|
+
awslabs_openapi_mcp_server-0.2.10.dist-info/RECORD,,
|
{awslabs_openapi_mcp_server-0.2.8.dist-info → awslabs_openapi_mcp_server-0.2.10.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|