MCP.so
Sign In

WebAPI MCP 服务器

@yinzhouzhi

About WebAPI MCP 服务器

(一键将传统业务系统转换成智能体)支持将传统的WebAPI,转换成MCP工具的mcp服务器

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "webapi-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@yinzhouzhi/webapi-mcp-server",
        "start"
      ]
    }
  }
}

Tools

7

将Web API注册为MCP工具,使其可以通过MCP协议直接调用。您可以指定API名称、URL、HTTP方法、参数定义、请求头和结果处理路径。注册后将创建与API名称相同的新工具。

设置适用于所有API请求的全局默认请求头。这些请求头将自动应用于通过register_web_api注册的所有API调用,但可以被单个API的特定请求头覆盖。

列出当前已注册的所有Web API,包括它们的名称、URL、方法、参数定义和请求头配置等详细信息。

移除已注册的Web API工具。成功移除后,相应的MCP工具将不再可用。

从JSON或Markdown文件加载API定义并注册为MCP工具

从目录加载所有API定义文件并注册为MCP工具

从配置文件加载API定义

Overview

What is WebAPI MCP 服务器?

WebAPI MCP 服务器 converts traditional Web APIs into MCP (Model Context Protocol) tools, enabling direct integration between legacy business systems and large language models without requiring custom interface development. It supports batch registration of API definitions from JSON or Markdown files or directories, and allows setting default request headers globally for all registered APIs.

How to use WebAPI MCP 服务器?

Install via npx or clone the repository and run npm install and npm start. Configure using a JSON/YAML/YML configuration file specifying API directories, individual API files, and global headers, or via environment variables (WEBAPI_CONFIG_FILE, WEBAPI_APIS_DIR, WEBAPI_DEBUG). Define APIs in JSON or Markdown format and use built-in MCP tools to register, unregister, list, and manage them.

Key features of WebAPI MCP 服务器

  • Converts any Web API to an MCP tool
  • Dynamic runtime registration and removal of APIs
  • Centralized global request header management
  • Supports multiple parameter types and validation
  • Extracts specific data from nested responses via result path
  • Batch loads API definitions from files or directories

Use cases of WebAPI MCP 服务器

  • Directly connect existing enterprise HTTP APIs to LLM applications without extra code
  • Expose internal weather, database, or authentication APIs as MCP tools
  • Centralize API permission control by setting default authorization headers
  • Rapidly prototype MCP-compatible tools from legacy REST endpoints

FAQ from WebAPI MCP 服务器

How does WebAPI MCP 服务器 differ from RAG-based approaches?

It replaces vector database retrieval with direct API calls, providing more precise and reliable data without data chunking or embedding, and is simpler to deploy.

What API definition formats are supported?

Both JSON and Markdown formats are supported. JSON requires name, description, url, method; Markdown uses headings (name, URL, method, parameters, headers, result path, etc.).

Can I set global headers for all API calls?

Yes. Global headers can be defined in the configuration file via the globalHeaders object or set dynamically using the set_default_headers MCP tool.

What MCP tools are built into the server?

The server provides register_web_api, set_default_headers, list_registered_apis, unregister_api, load_api_from_file, load_apis_from_directory, and load_from_config.

Does WebAPI MCP 服务器 work with Cursor or other MCP clients?

Yes. It can be added as an MCP server in Cursor by using the npx command with the package @yinzhouzhi/webapi-mcp-server start in the MCP client configuration.

Frequently asked questions

How does WebAPI MCP 服务器 differ from RAG-based approaches?

It replaces vector database retrieval with direct API calls, providing more precise and reliable data without data chunking or embedding, and is simpler to deploy.

What API definition formats are supported?

Both JSON and Markdown formats are supported. JSON requires name, description, url, method; Markdown uses headings (name, URL, method, parameters, headers, result path, etc.).

Can I set global headers for all API calls?

Yes. Global headers can be defined in the configuration file via the `globalHeaders` object or set dynamically using the `set_default_headers` MCP tool.

What MCP tools are built into the server?

The server provides `register_web_api`, `set_default_headers`, `list_registered_apis`, `unregister_api`, `load_api_from_file`, `load_apis_from_directory`, and `load_from_config`.

Does WebAPI MCP 服务器 work with Cursor or other MCP clients?

Yes. It can be added as an MCP server in Cursor by using the npx command with the package `@yinzhouzhi/webapi-mcp-server start` in the MCP client configuration.

Comments

More Other MCP servers