Skip to main content

yooztech_mcp_api_request —— 基于 MCP 的通用 API 请求工具

该 MCP 服务器用于向真实后端 API 发起请求,帮助前端/AI 获取最真实的接口返回;包含:

  • init_config(project_root=None, overwrite=false, tokens=None, fmt="yaml"):在项目根创建配置文件,存储鉴权信息
  • api_request(method, url, params=None, headers=None, body=None, project_root=None, timeout_seconds=30):读取配置并发起请求,返回基本信息与完整响应

在 Cursor 中配置

在 Cursor 的设置中添加 MCP Server(示例):

{
  "mcpServers": {
    "yooztech_mcp_api_request": {
      "command": "yooztech_mcp_api_request",
      "args": []
    }
  }
}

如不想全局安装,可使用 uvx 方式:

{
  "mcpServers": {
    "yooztech_mcp_api_request": {
      "command": "uvx",
      "args": ["yooztech_mcp_api_request"]
    }
  }
}

脚本与入口

  • 控制台脚本:yooztech_mcp_api_request(见 pyproject.toml 的 [project.scripts])

开发

  • 依赖安装:pip install -r requirements.txt
  • 运行:yooztech_mcp_api_request

配置文件

  • 默认文件名(写入项目根目录):.mcp_api_request.yml(或 .json 当 fmt=json)
  • 文件结构:列表,每项为 {type, key, value}
    • type: header | param
    • key: token 的字段名
    • value: token 的值

示例(YAML):

- type: header
  key: Authorization
  value: Bearer xxxxxx
- type: param
  key: access_token
  value: xxxxxx

或(JSON):

[
  {"type":"header","key":"Authorization","value":"Bearer xxxxxx"},
  {"type":"param","key":"access_token","value":"xxxxxx"}
]

使用流程

  1. 初始化(生成空值模板):
{"tool":"init_config","args":{"overwrite":false}}

执行后会在项目根创建 .mcp_api_request.yml(或 .json),其中示例条目的 value 为空。请手动编辑为你的真实 token;空值项在请求时不会发送。

  1. 发起请求:
{
  "tool":"api_request",
  "args":{
    "method":"GET",
    "url":"https://api.example.com/users",
    "params":{"page":1},
    "headers":{"X-Debug":"1"}
  }
}

许可证

  • MIT(见 LICENSE)

Metadata

Release files for yooztech-mcp-api-request 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yooztech-mcp-api-request 0.0.6
File Size Uploaded Provenance
yooztech_mcp_api_request-0.0.6.tar.gz 7.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for yooztech-mcp-api-request 0.0.6
File Interpreter ABI Platform
yooztech_mcp_api_request-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / yooztech_mcp_api_request-0.0.6.tar.gz

Download URL yooztech_mcp_api_request-0.0.6.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cea0ef657943c81429a1d6370c18a7051a5d950d961c66b8fae326f704095f8d
BLAKE2b-256 checksum
How to use checksums
7cceea72b738163bffdd2abb68902ae6c612d9e2b11fea3a28b23bea3f83b203
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.7

Release files / yooztech_mcp_api_request-0.0.6-py3-none-any.whl

Download URL yooztech_mcp_api_request-0.0.6-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a91b0eb398cf11ff95443065cb3d9ae9bf51085a27affb1cd25e9b6137159c2
BLAKE2b-256 checksum
How to use checksums
c3e0fc283959147aae2d72afb6df39947e396f5db1293584f5826de9d8a02357
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.7

Security for yooztech-mcp-api-request 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page