添加mcp配置

This commit is contained in:
2026-01-15 17:34:22 +08:00
parent 0e4a85551f
commit d3bf64ae61
21 changed files with 1601 additions and 275 deletions

View File

View File

@@ -0,0 +1,42 @@
import httpx
class HttpxRequest:
@classmethod
async def get(
cls, url: str, params: dict | None = None, headers: dict | None = None
) -> dict:
"""
发送GET请求
@param url: 请求URL
@param params: 请求参数
@param headers: 请求头
@return: 响应内容
"""
async with httpx.AsyncClient() as client:
response = await client.get(url, params=params, headers=headers)
response.raise_for_status()
return response.json()
@classmethod
async def post(
cls,
url: str,
params: dict | None = None,
data: dict | None = None,
json: dict | None = None,
headers: dict | None = None,
) -> dict:
"""
发送POST请求
@param url: 请求URL
@param params: 请求参数
@param headers: 请求头
@return: 响应内容
"""
async with httpx.AsyncClient() as client:
response = await client.post(
url, params=params, data=data, json=json, headers=headers
)
response.raise_for_status()
return response.json()