yapi-mcp 0.1.1__tar.gz → 0.1.2__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.
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/PKG-INFO +1 -1
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/pyproject.toml +1 -1
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/src/yapi_mcp/server.py +18 -18
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/.gitignore +0 -0
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/LICENSE +0 -0
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/README.md +0 -0
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/src/yapi_mcp/__init__.py +0 -0
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/src/yapi_mcp/__main__.py +0 -0
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/src/yapi_mcp/config.py +0 -0
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/src/yapi_mcp/tools/__init__.py +0 -0
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/src/yapi_mcp/yapi/__init__.py +0 -0
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/src/yapi_mcp/yapi/client.py +0 -0
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/src/yapi_mcp/yapi/errors.py +0 -0
- {yapi_mcp-0.1.1 → yapi_mcp-0.1.2}/src/yapi_mcp/yapi/models.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: yapi-mcp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Model Context Protocol server for YApi 1.12.0 API management platform
|
|
5
5
|
Project-URL: Homepage, https://github.com/geq1fan/yapi-mcp
|
|
6
6
|
Project-URL: Repository, https://github.com/geq1fan/yapi-mcp
|
|
@@ -123,39 +123,39 @@ async def yapi_get_interface(
|
|
|
123
123
|
@mcp.tool()
|
|
124
124
|
async def yapi_save_interface(
|
|
125
125
|
catid: Annotated[int, "分类 ID (必需)"],
|
|
126
|
-
project_id: Annotated[int
|
|
127
|
-
interface_id: Annotated[int
|
|
128
|
-
title: Annotated[str
|
|
129
|
-
path: Annotated[str
|
|
130
|
-
method: Annotated[str
|
|
126
|
+
project_id: Annotated[int, "项目 ID (创建时必需)"] = 0,
|
|
127
|
+
interface_id: Annotated[int, "接口 ID (有值=更新,无值=创建)"] = 0,
|
|
128
|
+
title: Annotated[str, "接口标题 (创建时必需)"] = "",
|
|
129
|
+
path: Annotated[str, "接口路径 (创建时必需,以/开头)"] = "",
|
|
130
|
+
method: Annotated[str, "HTTP方法 (创建时必需)"] = "",
|
|
131
131
|
req_body: Annotated[str, "请求参数(JSON字符串)"] = "",
|
|
132
132
|
res_body: Annotated[str, "响应结构(JSON字符串)"] = "",
|
|
133
133
|
desc: Annotated[str, "接口描述"] = "",
|
|
134
|
-
req_body_type: Annotated[str
|
|
135
|
-
req_body_is_json_schema: Annotated[bool
|
|
136
|
-
res_body_type: Annotated[str
|
|
137
|
-
res_body_is_json_schema: Annotated[bool
|
|
134
|
+
req_body_type: Annotated[str, "请求体类型(form/json/raw/file)"] = "",
|
|
135
|
+
req_body_is_json_schema: Annotated[bool, "请求体是否为JSON Schema"] = True,
|
|
136
|
+
res_body_type: Annotated[str, "响应体类型(json/raw)"] = "",
|
|
137
|
+
res_body_is_json_schema: Annotated[bool, "响应体是否为JSON Schema"] = True,
|
|
138
138
|
) -> str:
|
|
139
139
|
"""保存 YApi 接口定义。interface_id 有值则更新,无值则创建新接口。"""
|
|
140
140
|
config = get_config()
|
|
141
141
|
try:
|
|
142
|
-
if path
|
|
143
|
-
|
|
142
|
+
if path and not path.startswith("/"):
|
|
143
|
+
raise InvalidInterfacePathError
|
|
144
144
|
|
|
145
145
|
async with YApiClient(str(config.yapi_server_url), config.cookies) as client:
|
|
146
146
|
result = await client.save_interface(
|
|
147
147
|
catid=catid,
|
|
148
|
-
project_id=project_id,
|
|
149
|
-
interface_id=interface_id,
|
|
150
|
-
title=title,
|
|
151
|
-
path=path,
|
|
152
|
-
method=method,
|
|
148
|
+
project_id=project_id if project_id else None,
|
|
149
|
+
interface_id=interface_id if interface_id else None,
|
|
150
|
+
title=title if title else None,
|
|
151
|
+
path=path if path else None,
|
|
152
|
+
method=method if method else None,
|
|
153
153
|
req_body=req_body,
|
|
154
154
|
res_body=res_body,
|
|
155
155
|
desc=desc,
|
|
156
|
-
req_body_type=req_body_type,
|
|
156
|
+
req_body_type=req_body_type if req_body_type else None,
|
|
157
157
|
req_body_is_json_schema=req_body_is_json_schema,
|
|
158
|
-
res_body_type=res_body_type,
|
|
158
|
+
res_body_type=res_body_type if res_body_type else None,
|
|
159
159
|
res_body_is_json_schema=res_body_is_json_schema,
|
|
160
160
|
)
|
|
161
161
|
action = result["action"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|