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. Create .env in a folder as below
    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 mcp server using openapi_mcp_server from same folder.
  • Update Claud Desktop configuration with below
    {
      "mcpServers": {
        "openapi_mcp_server":{
          "command": "openapi_mcp_server",
          "env": {
              "DEBUG":"1",
              "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"
          }
        }
      }
    }
    

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.2.0.tar.gz (11.8 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.2.0-py2.py3-none-any.whl (12.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: openapi_mcp_server-0.2.0.tar.gz
  • Upload date:
  • Size: 11.8 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.2.0.tar.gz
Algorithm Hash digest
SHA256 ee33c3067a35d29b9a38bfdcb803a8eed8a3e80614525dc351028dbd9b1ed1e7
MD5 af0e6c64e8bc53eae7c3ee7a2f3e2986
BLAKE2b-256 455b9f1c713e1e0d3e92a0c0cbb84ec7e58ff29782d143e4a3717fe25185d298

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openapi_mcp_server-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 61cc8eb8c7b31eaac30178eb8807c18588cd95742c28855c9aedb2bcc83e27af
MD5 63e899d40f1f50085c7c39397001fed9
BLAKE2b-256 20123ea2d31717b6bb39b24a994538d357a3286be4fea99eb5941f8b2fe18656

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