MCP.so
登录

MCP Server from OpenAPI

@rajeshm7910

关于 MCP Server from OpenAPI

暂无概览

基本信息

分类

其他

许可证

Apache-2.0 license

运行时

python

传输方式

stdio

发布者

rajeshm7910

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "mcp-server-from-openapi": {
      "command": "python3",
      "args": [
        "-m",
        "venv",
        "venv"
      ]
    }
  }
}

工具

未检测到工具

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is MCP Server from OpenAPI?

MCP Server from OpenAPI is a Model Context Protocol (MCP) server implementation that generates endpoints from OpenAPI specifications, supporting both Server-Sent Events (SSE) and streaming responses. It is designed for developers who want to interact with APIs through MCP clients or Google ADK agents using natural language queries.

How to use MCP Server from OpenAPI?

Install Python 3.x and pip, create a virtual environment, and run pip install -r requirements.txt. Start the server in SSE mode (python server/mcp_server_sse.py --spec <file> --name <name> --base-url <url>) or streaming mode (python server/mcp_server_stream.py ...). Then launch either the SSE client (python client/sse_client.py) or streaming client (python client/stream_client.py). For ADK agents, install google-adk, replace a mcp_session_manager.py file, and configure .env files with the appropriate API keys.

Key features of MCP Server from OpenAPI

  • OpenAPI specification-based endpoint generation
  • Support for both SSE and streaming responses
  • Multiple client implementations (MCP and ADK)
  • Easy configuration through environment variables
  • Example usage with httpbin.org API

Use cases of MCP Server from OpenAPI

  • Query an API (e.g., get headers) using natural language through an MCP client
  • Build agentic workflows with Google ADK agents that call REST APIs
  • Rapidly prototype API interactions without writing custom client code
  • Test and debug OpenAPI specifications with a live server

FAQ from MCP Server from OpenAPI

What are the prerequisites for using this server?

Python 3.x, pip, and an Anthropic API key (for MCP clients) or a Google API key (for ADK agents). The server also requires the dependencies listed in requirements.txt.

How do I run the server in SSE mode?

Run python server/mcp_server_sse.py --spec server/httpbin_openapi.yaml --name httpbin --base-url https://httpbin.org. Replace the spec file, name, and base URL with your own values.

How do I set up ADK agents with this server?

Install ADK (pip install google-adk), download the latest mcp_session_manager.py from the Google ADK repository and replace the existing file in your ADK installation. Then create .env files in the agent directories with GOOGLE_GENAI_USE_VERTEXAI="False" and GOOGLE_API_KEY="your_key". Start the ADK web interface with adk web.

What should I do if ADK streaming mode has issues?

Verify you have replaced the mcp_session_manager.py file, check that your Google API key is correctly set in the .env files, and ensure you are using the latest version of ADK.

Can I use this server with APIs other than httpbin?

Yes, you can provide any OpenAPI specification file using the --spec flag and set the appropriate base URL with --base-url.

评论

其他 分类下的更多 MCP 服务器