
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

一个将传统 Web API 转换为 MCP 工具的服务器,支持批量注册 API、管理全局请求头并从文件或目录加载 API 定义。
WebAPI MCP 服务器 is cataloged as an MCP server attributed to yinzhouzhi. 一个将传统 Web API 转换为 MCP 工具的服务器,支持批量注册 API、管理全局请求头并从文件或目录加载 API 定义。 It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for WebAPI MCP 服务器 are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
支持 JSON 和 Markdown 两种格式定义 API,也可从文件目录批量导入。
通过 resultPath 字段使用点表示法从响应中提取结果,例如 data.items。
README.md · 91a84ac765f7 · Fetched 2026-11-13 10:32:19 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
将传统Web API转换为MCP工具的服务器,支持API接口批量注册,通过MCP工具设置默认请求头。
优势: 1.比传统的RAG模式更简单,部署起来更方便,并且可以实现传统业务系统和大模型的直接对接,无需开发额外接口增加冗余代码和工作量 2.支持json文件或者md文件格式或者文件目录批量导入 3.相较于RAG通过向量库进行数据切片,检索的数据,直接通过模型调用API获取数据可以更精准更可靠 4.数据安全,通过设置转换的mcp工具的请求头参数可以做到更精准的数据权限管理和控制
原文链接:https://blog.csdn.net/qq_39336120/article/details/147537618
{
"mcpServers": {
"webapi-mcp-server": {
"command": "npx",
"args": [
"-y",
"@yinzhouzhi/webapi-mcp-server",
"start"
]
}
}
}
# 克隆项目
git clone <repository-url>
cd webapi-mcp-server
# 安装依赖
npm install
# 初始化项目目录
npm run setup
npm start
# 使用自定义配置启动
npm start -- --config path/to/config.json --apis-dir path/to/apis
# 使用环境变量启动
WEBAPI_CONFIG_FILE=path/to/config.json WEBAPI_APIS_DIR=path/to/apis WEBAPI_DEBUG=true npm start
配置文件支持JSON、YAML和YML格式,可以包含以下选项:
{
"apiDirectories": [ // 包含API定义文件的目录列表
"./apis",
"./more-apis"
],
"apiFiles": [ // 单独API定义文件的路径列表
"./specific-api.json",
"./another-api.md"
],
"globalHeaders": { // 应用于所有API请求的默认请求头
"User-Agent": "WebAPI MCP Client/1.0", // 用户代理
"Accept": "application/json", // 接受的内容类型
"Authorization": "Bearer YOUR_TOKEN" // 授权令牌
},
"debug": true // 是否启用调试模式
}
| 配置项 | 类型 | 描述 |
|---|---|---|
apiDirectories | 数组 | 包含API定义文件的目录列表 |
apiFiles | 数组 | 单独API定义文件的路径列表 |
globalHeaders | 对象 | 应用于所有API请求的默认请求头 |
debug | 布尔值 | 是否启用调试模式 |
npm run run-example
# 启动服务器
npm run start
# 显示示例
npm run example
服务器也可以通过环境变量进行配置:
| 环境变量 | 描述 |
|---|---|
WEBAPI_CONFIG_FILE | 配置文件的路径 |
WEBAPI_APIS_DIR | API定义目录的路径 |
WEBAPI_DEBUG | 启用调试模式(设置为 'true') |
服务器内置了以下MCP工具:
| 工具名称 | 描述 |
|---|---|
register_web_api | 将Web API注册为MCP工具,使其可以通过MCP协议直接调用。 |
set_default_headers | 设置适用于所有API请求的全局默认请求头。 |
list_registered_apis | 列出当前已注册的所有Web API及其配置。 |
unregister_api | 移除已注册的Web API工具。 |
load_api_from_file | 从指定文件加载API定义并注册为MCP工具。 |
load_apis_from_directory | 从指定目录加载所有API定义文件并注册为MCP工具。 |
load_from_config | 从配置文件加载API定义和设置。 |
可以使用JSON或Markdown格式定义API:
{
"name": "weather",
"description": "获取当前天气信息",
"url": "https://api.example.com/weather",
"method": "GET",
"parameters": {
"city": {
"type": "string",
"required": true, // 是否必填
"description": "城市名称"
},
"units": {
"type": "string",
"required": false,
"description": "温度单位 (celsius, fahrenheit)"
}
},
"headers": {
"X-API-Key": "your-api-key"
},
"resultPath": "data.current"
}
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
name | 字符串 | 是 | API工具的唯一名称,用于MCP调用 |
description | 字符串 | 是 | API功能的简要描述 |
url | 字符串 | 是 | API的完整URL地址,支持带参数的URL模板 |
method | 字符串 | 是 | HTTP请求方法(GET, POST, PUT, DELETE等) |
parameters | 对象 | 否 | API参数定义,每个参数包含type, required和description属性 |
headers | 对象 | 否 | 特定于此API的请求头(会与全局请求头合并) |
resultPath | 字符串 | 否 | 从响应中提取结果的路径,使用点表示法(如"data.items") |
bodyTemplate | 对象/字符串 | 否 | POST/PUT请求的请求体模板 |
responseType | 字符串 | 否 | 期望的响应类型(json, text, blob等) |
transform | 字符串 | 否 | 用于转换响应的JavaScript代码字符串 |
# Weather API
获取当前天气信息
## URL
https://api.example.com/weather
## 方法
GET
## 参数
- city (string, required): 城市名称
- units (string, optional): 温度单位 (celsius, fahrenheit)
## 请求头
- X-API-Key: your-api-key
## 结果路径
data.current
Markdown格式的API定义需遵循以下结构:
## URL开头,下一行为API的完整URL## 方法开头,下一行为HTTP方法(GET, POST等)## 参数开头,每个参数使用列表项格式
参数名 (类型, required/optional): 描述## 请求头开头,每个请求头使用列表项格式
请求头名: 值## 结果路径开头,下一行为提取结果的路径## 请求体开头,后面是JSON格式的请求体模板## 响应类型开头,指定期望的响应类型## 转换函数开头,包含JavaScript转换代码查看API示例了解如何:
const webapi = require('webapi-mcp-server');
// 创建自定义服务器
const server = webapi.createServer({
debug: true,
configFile: './config.json',
apisDir: './apis'
});
// 使用其他导出函数
webapi.registerApi(apiDefinition);
webapi.unregisterApi('apiName');
webapi.getRegisteredApis();
webapi.loadApiFile('./path/to/api.json');
webapi.loadApisFromDirectory('./apis');
MIT
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for WebAPI MCP 服务器 from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/webapi-mcp-server)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.