Get the FREE Ultimate OpenClaw Setup Guide →

webapi

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

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio yinzhouzhi-webapi-mcp-server npx -y @yinzhouzhi/webapi-mcp-server start

How to use

This MCP server converts traditional Web APIs into MCP tools, enabling batch registration of API definitions and centralized control of default request headers. It supports loading API definitions from JSON or Markdown files or directories, and allows dynamic registration and removal at runtime. Core MCP tools exposed by the server include: register_web_api for registering a Web API as an MCP tool, set_default_headers to apply global headers to all requests, list_registered_apis to view current registrations, unregister_api to remove a registered API, and load_api_from_file/load_apis_from_directory/load_from_config to bulk-import definitions from files, directories, or config. Start by running the server, then use these tools to register your APIs and manage global headers for consistent behavior across all API calls.

How to install

Prerequisites:

  • Node.js and npm installed
  • Basic familiarity with npm/yarn and CLI usage

Installation steps:

  1. Clone the repository (or install from npm if provided): git clone <repository-url> cd webapi-mcp-server

  2. Install dependencies: npm install

  3. Initialize project directory (if applicable): npm run setup

  4. Start the server (default): npm start

  5. Optional: run with a custom config or API directory: npm start -- --config path/to/config.json --apis-dir path/to/apis

Environment variables you can use:

  • WEBAPI_CONFIG_FILE: path to the config file
  • WEBAPI_APIS_DIR: directory containing API definitions
  • WEBAPI_DEBUG: enable debugging (true/false)

If you need to run with a specific MCP configuration, you can also use the provided mcp_config snippet to start via npx as shown in the repository’s usage example.

Additional notes

Tips and notes:

  • The server supports JSON, YAML, and YML configuration formats for API definition loading.
  • Global headers defined in the config are merged with per-API headers when requests are made.
  • You can dynamically register or unregister APIs at runtime without redeploying the server.
  • Use load_from_config to load multiple APIs and settings from a single config file for convenience.
  • Ensure API definitions include essential fields such as name, description, url, and method for MCP tooling to function correctly.
  • If you encounter issues with environment variables, double-check that the variable names match those listed in the README and that you restart the server after changes.

Related MCP Servers

Sponsor this space

Reach thousands of developers