yapi-mcp 0.1.3__tar.gz → 0.1.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yapi-mcp
3
- Version: 0.1.3
3
+ Version: 0.1.4
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "yapi-mcp"
3
- version = "0.1.3"
3
+ version = "0.1.4"
4
4
  description = "Model Context Protocol server for YApi 1.12.0 API management platform"
5
5
  authors = [{ name = "YApi MCP Team" }]
6
6
  readme = "README.md"
@@ -175,6 +175,7 @@ async def yapi_save_interface(
175
175
  req_body: Annotated[str, "请求参数(JSON字符串)"] = "",
176
176
  res_body: Annotated[str, "响应结构(JSON字符串)"] = "",
177
177
  markdown: Annotated[str, "接口描述(Markdown格式)"] = "",
178
+ req_query: Annotated[str, "Query参数(JSON数组,每项含name/required/desc)"] = "",
178
179
  req_body_type: Annotated[str | None, "请求体类型(form/json/raw/file)"] = None,
179
180
  req_body_is_json_schema: Annotated[bool | None, "请求体是否为JSON Schema"] = None,
180
181
  res_body_type: Annotated[str | None, "响应体类型(json/raw)"] = None,
@@ -207,6 +208,7 @@ async def yapi_save_interface(
207
208
  req_body=req_body,
208
209
  res_body=res_body,
209
210
  markdown=markdown,
211
+ req_query=req_query,
210
212
  req_body_type=req_body_type,
211
213
  req_body_is_json_schema=req_body_is_json_schema,
212
214
  res_body_type=res_body_type if res_body_type else None,
@@ -1,5 +1,6 @@
1
1
  """YApi API HTTP client implementation."""
2
2
 
3
+ import json
3
4
  from typing import Any, NoReturn
4
5
 
5
6
  import httpx
@@ -169,6 +170,7 @@ class YApiClient:
169
170
  req_body: str = "",
170
171
  res_body: str = "",
171
172
  markdown: str = "",
173
+ req_query: str = "",
172
174
  req_body_type: str | None = None,
173
175
  req_body_is_json_schema: bool | None = None,
174
176
  res_body_type: str | None = None,
@@ -240,6 +242,8 @@ class YApiClient:
240
242
  if markdown:
241
243
  payload["markdown"] = markdown
242
244
  payload["desc"] = _markdown_to_html(markdown)
245
+ if req_query:
246
+ payload["req_query"] = json.loads(req_query)
243
247
 
244
248
  response = await self.client.post("/interface/add", json=payload)
245
249
  self._check_response(response)
@@ -272,6 +276,8 @@ class YApiClient:
272
276
  payload["res_body_type"] = res_body_type
273
277
  if res_body_is_json_schema is not None:
274
278
  payload["res_body_is_json_schema"] = res_body_is_json_schema
279
+ if req_query:
280
+ payload["req_query"] = json.loads(req_query)
275
281
 
276
282
  response = await self.client.post("/interface/up", json=payload)
277
283
  self._check_response(response)
File without changes
File without changes
File without changes