konokenj.cdk-api-mcp-server 0.2.3__tar.gz → 0.2.4__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.
- {konokenj_cdk_api_mcp_server-0.2.3 → konokenj_cdk_api_mcp_server-0.2.4}/PKG-INFO +6 -13
- {konokenj_cdk_api_mcp_server-0.2.3 → konokenj_cdk_api_mcp_server-0.2.4}/README.md +4 -5
- {konokenj_cdk_api_mcp_server-0.2.3 → konokenj_cdk_api_mcp_server-0.2.4}/cdk_api_mcp_server/__about__.py +1 -1
- {konokenj_cdk_api_mcp_server-0.2.3 → konokenj_cdk_api_mcp_server-0.2.4}/cdk_api_mcp_server/server.py +21 -21
- {konokenj_cdk_api_mcp_server-0.2.3 → konokenj_cdk_api_mcp_server-0.2.4}/pyproject.toml +1 -7
- {konokenj_cdk_api_mcp_server-0.2.3 → konokenj_cdk_api_mcp_server-0.2.4}/.gitignore +0 -0
- {konokenj_cdk_api_mcp_server-0.2.3 → konokenj_cdk_api_mcp_server-0.2.4}/LICENSE.txt +0 -0
- {konokenj_cdk_api_mcp_server-0.2.3 → konokenj_cdk_api_mcp_server-0.2.4}/cdk_api_mcp_server/__init__.py +0 -0
- {konokenj_cdk_api_mcp_server-0.2.3 → konokenj_cdk_api_mcp_server-0.2.4}/cdk_api_mcp_server/models.py +0 -0
- {konokenj_cdk_api_mcp_server-0.2.3 → konokenj_cdk_api_mcp_server-0.2.4}/cdk_api_mcp_server/resources.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: konokenj.cdk-api-mcp-server
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: An MCP server provides AWS CDK API Reference
|
|
5
5
|
Project-URL: Documentation, https://github.com/konokenj/cdk-api-mcp-server#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/konokenj/cdk-api-mcp-server/issues
|
|
@@ -10,13 +10,7 @@ License-Expression: MIT
|
|
|
10
10
|
License-File: LICENSE.txt
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: Programming Language :: Python
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
-
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
19
|
-
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
14
|
Requires-Python: >=3.8
|
|
21
15
|
Requires-Dist: fastmcp>=2.0.0
|
|
22
16
|
Requires-Dist: pydantic>=2.10.6
|
|
@@ -33,6 +27,8 @@ Description-Content-Type: text/markdown
|
|
|
33
27
|
|
|
34
28
|
---
|
|
35
29
|
|
|
30
|
+
Provide AWS CDK API references and integration test code for sample. Can be used in offline because all documents are included in the released python artifact.
|
|
31
|
+
|
|
36
32
|
## Usage
|
|
37
33
|
|
|
38
34
|
Add to your mcp.json:
|
|
@@ -61,11 +57,8 @@ Registered as static resources. To get available modules under the package, call
|
|
|
61
57
|
|
|
62
58
|
To get available documents under the module, call `read_resource(uri)` as MCP client.
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- `cdk-api-docs://constructs/@aws-cdk/{module}/`
|
|
68
|
-
- `cdk-api-docs://constructs/aws-cdk-lib/{module}/`
|
|
60
|
+
- `cdk-api-docs://constructs/@aws-cdk/{module}`
|
|
61
|
+
- `cdk-api-docs://constructs/aws-cdk-lib/{module}`
|
|
69
62
|
|
|
70
63
|
### Resource Template: Read file contents
|
|
71
64
|
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
Provide AWS CDK API references and integration test code for sample. Can be used in offline because all documents are included in the released python artifact.
|
|
9
|
+
|
|
8
10
|
## Usage
|
|
9
11
|
|
|
10
12
|
Add to your mcp.json:
|
|
@@ -33,11 +35,8 @@ Registered as static resources. To get available modules under the package, call
|
|
|
33
35
|
|
|
34
36
|
To get available documents under the module, call `read_resource(uri)` as MCP client.
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- `cdk-api-docs://constructs/@aws-cdk/{module}/`
|
|
40
|
-
- `cdk-api-docs://constructs/aws-cdk-lib/{module}/`
|
|
38
|
+
- `cdk-api-docs://constructs/@aws-cdk/{module}`
|
|
39
|
+
- `cdk-api-docs://constructs/aws-cdk-lib/{module}`
|
|
41
40
|
|
|
42
41
|
### Resource Template: Read file contents
|
|
43
42
|
|
{konokenj_cdk_api_mcp_server-0.2.3 → konokenj_cdk_api_mcp_server-0.2.4}/cdk_api_mcp_server/server.py
RENAMED
|
@@ -7,6 +7,7 @@ from typing import Optional
|
|
|
7
7
|
|
|
8
8
|
from fastmcp import FastMCP
|
|
9
9
|
from fastmcp.resources import TextResource
|
|
10
|
+
from mcp.shared.exceptions import ErrorData, McpError
|
|
10
11
|
from pydantic import AnyUrl
|
|
11
12
|
|
|
12
13
|
from cdk_api_mcp_server.resources import (
|
|
@@ -42,8 +43,8 @@ def create_server(provider: Optional[ResourceProvider] = None) -> FastMCP:
|
|
|
42
43
|
# 新しいサーバーインスタンスを作成
|
|
43
44
|
server: FastMCP = FastMCP()
|
|
44
45
|
|
|
45
|
-
#
|
|
46
|
-
|
|
46
|
+
# 説明はコメントで残しておく
|
|
47
|
+
# "AWS CDK API MCP Server"
|
|
47
48
|
|
|
48
49
|
# 定義済みのパッケージとして直接リソース登録
|
|
49
50
|
@server.resource("cdk-api-docs://constructs/@aws-cdk", mime_type="application/json")
|
|
@@ -86,6 +87,11 @@ def create_server(provider: Optional[ResourceProvider] = None) -> FastMCP:
|
|
|
86
87
|
)
|
|
87
88
|
def list_package_modules(package_name: str):
|
|
88
89
|
"""List all modules in the package."""
|
|
90
|
+
# パッケージが存在するか確認
|
|
91
|
+
if not resource_provider.resource_exists(f"constructs/{package_name}"):
|
|
92
|
+
error_message = f"Unknown resource: package '{package_name}' not found"
|
|
93
|
+
raise McpError(ErrorData(message=error_message, code=404))
|
|
94
|
+
|
|
89
95
|
modules = [
|
|
90
96
|
item
|
|
91
97
|
for item in resource_provider.list_resources(f"constructs/{package_name}")
|
|
@@ -111,9 +117,14 @@ def create_server(provider: Optional[ResourceProvider] = None) -> FastMCP:
|
|
|
111
117
|
)
|
|
112
118
|
def list_module_files(package_name: str, module_name: str):
|
|
113
119
|
"""List all files in the module."""
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
120
|
+
resource_path = f"constructs/{package_name}/{module_name}"
|
|
121
|
+
|
|
122
|
+
# モジュールが存在するか確認
|
|
123
|
+
if not resource_provider.resource_exists(resource_path):
|
|
124
|
+
error_message = f"Unknown resource: module '{resource_path}' not found"
|
|
125
|
+
raise McpError(ErrorData(message=error_message, code=404))
|
|
126
|
+
|
|
127
|
+
files = resource_provider.list_resources(resource_path)
|
|
117
128
|
content = json.dumps(files)
|
|
118
129
|
|
|
119
130
|
# JSONとしてレスポンスを返す
|
|
@@ -138,18 +149,8 @@ def create_server(provider: Optional[ResourceProvider] = None) -> FastMCP:
|
|
|
138
149
|
resource_path = f"constructs/{package_name}/{module_name}/{file_name}"
|
|
139
150
|
|
|
140
151
|
if not resource_provider.resource_exists(resource_path):
|
|
141
|
-
error_message = f"
|
|
142
|
-
|
|
143
|
-
uri=AnyUrl.build(
|
|
144
|
-
scheme="cdk-api-docs",
|
|
145
|
-
host="constructs",
|
|
146
|
-
path=f"/{package_name}/{module_name}/{file_name}",
|
|
147
|
-
),
|
|
148
|
-
name=file_name,
|
|
149
|
-
text=error_message,
|
|
150
|
-
description=f"Error: {resource_path}",
|
|
151
|
-
mime_type="text/plain",
|
|
152
|
-
)
|
|
152
|
+
error_message = f"Unknown resource: '{resource_path}' not found"
|
|
153
|
+
raise McpError(ErrorData(message=error_message, code=404))
|
|
153
154
|
|
|
154
155
|
# リソースプロバイダーからコンテンツを取得
|
|
155
156
|
content = resource_provider.get_resource_content(resource_path)
|
|
@@ -169,10 +170,9 @@ def create_server(provider: Optional[ResourceProvider] = None) -> FastMCP:
|
|
|
169
170
|
description = f"JSON file: {package_name}/{module_name}/{file_name}"
|
|
170
171
|
else:
|
|
171
172
|
# その他の場合はmimetypesモジュールで判定
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
mime_type = "text/plain"
|
|
173
|
+
mime_type_guess, _ = mimetypes.guess_type(file_name)
|
|
174
|
+
# None の場合はデフォルトのtext/plainを使用
|
|
175
|
+
mime_type = mime_type_guess if mime_type_guess is not None else "text/plain"
|
|
176
176
|
description = f"File: {package_name}/{module_name}/{file_name}"
|
|
177
177
|
|
|
178
178
|
# Create and return a TextResource
|
|
@@ -19,13 +19,7 @@ authors = [
|
|
|
19
19
|
classifiers = [
|
|
20
20
|
"Development Status :: 4 - Beta",
|
|
21
21
|
"Programming Language :: Python",
|
|
22
|
-
"Programming Language :: Python :: 3.
|
|
23
|
-
"Programming Language :: Python :: 3.9",
|
|
24
|
-
"Programming Language :: Python :: 3.10",
|
|
25
|
-
"Programming Language :: Python :: 3.11",
|
|
26
|
-
"Programming Language :: Python :: 3.12",
|
|
27
|
-
"Programming Language :: Python :: Implementation :: CPython",
|
|
28
|
-
"Programming Language :: Python :: Implementation :: PyPy",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
29
23
|
]
|
|
30
24
|
dependencies = [
|
|
31
25
|
"fastmcp>=2.0.0",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{konokenj_cdk_api_mcp_server-0.2.3 → konokenj_cdk_api_mcp_server-0.2.4}/cdk_api_mcp_server/models.py
RENAMED
|
File without changes
|
|
File without changes
|