Skip to main content

MCP Server For OpenAPI

Project description

OpenAPI MCP Server 🎭

smithery badge

A Model Context Protocol server that provides REST API automation.
This server enable LLMs to interact with RestAPI's.
It takes swagger as input.
Support all HTTP API Call's GET/PUT/POST/PATCH

Installation

  • Install package
    pip install openapi_mcp_server
    
  • Below is an example to test Petstore, details available here
    DEBUG="True"
    API_BASE_URL="https://petstore.swagger.io/v2"
    OPENAPI_SPEC_PATH="https://petstore.swagger.io/v2/swagger.json"
    API_HEADERS="Accept:application/json"
    API_WHITE_LIST="addPet,updatePet,findPetsByStatus"
    
  • Test with above using uv run -m openapi_mcp_server
  • Update Claud Desktop configuration with below
    {
      "mcpServers": {
        "openapi_mcp_server":{
          "command": "uv",
          "args": [
              "--directory",
              "D:\\mcp\\openapi_mcp_server",
              "run",
              "-m",
              "openapi_mcp_server"
          ],
          "env": {
              "DEBUG":"1",
              "API_BASE_URL":"https://petstore.swagger.io/v2",
              "OPENAPI_SPEC_PATH":"D:\\mcp\\swagger\\petstore.json",
              "API_HEADERS":"Accept:application/json",
              "API_WHITE_LIST":"addPet,updatePet,findPetsByStatus"
          }
        }
      }
    }
    

Features

  • FastAPI implementation of MCP
  • RESTful API endpoints
  • Schema validation

Configuration

  • List of available parameters
    • DEBUG: Enable debug logging (optional default is False)
    • OPENAPI_SPEC_PATH: Path to the OpenAPI document
    • API_BASE_URL: Base URL for the API requests
    • API_HEADERS: Headers to include in the API requests (optional)
    • API_WHITE_LIST: White Listed operationId in list format ["operationId1", "operationId2"] (optional)
    • API_BLACK_LIST: Black Listed operationId in list format ["operationId3", "operationId4"] (optional)
    • HTTP_PROXY: HTTP Proxy details
    • HTTPS_PROXY: HTTPS Proxy details
    • NO_PROXY: No Proxy details
  • Demo
    • Pet Store Demo
    • Loan Payment Demo

Contributing

Contributions are welcome. Please feel free to submit a Pull Request.

License

This project is licensed under the terms of the MIT license.

Star History

Star History Chart

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openapi_mcp_server-0.1.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openapi_mcp_server-0.1.0-py2.py3-none-any.whl (11.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file openapi_mcp_server-0.1.0.tar.gz.

File metadata

  • Download URL: openapi_mcp_server-0.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for openapi_mcp_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f39b25a6f0d73a15da02e9a2ab1a3e4b0a5a9ff460b0fae50eb1de0d1cd00164
MD5 74c4cbe610c10e344f5b4a6a358b0907
BLAKE2b-256 d4b4b0b79bfaa204ebbf73d8f819e92bf5a379bf0da7a3523e04ce43d5ced8df

See more details on using hashes here.

File details

Details for the file openapi_mcp_server-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for openapi_mcp_server-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fa90af8c15180f1a8ee4e9ba10e39743388eeceef93acfdbe7616df97745c3a4
MD5 d9a7fb35813a34105e31b023d3f566ba
BLAKE2b-256 84bc093a8ab4ef0b476df4d188f4a1089189155536f8d73db3c2691331c10b69

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page