Skip to content

feat: integrate with MCPO perhaps via a new Transport #8

@afraazali

Description

@afraazali

MCPO (https://docs.openwebui.com/openapi-servers/mcp/) exposes your MCP tools over HTTP using OpenAPI. Under the hood I believe it uses FastAPI which generates the OpenAPI spec.

It would be cool to see a new OpenAPI transport, which could parse the OpenAPI spec document and make the proper requests.

Here's a sample OpenAPI spec document from an MCP Server that gets weather alerts:

{
  "openapi": "3.1.0",
  "info": {
    "title": "weather",
    "description": "weather MCP Server",
    "version": "1.8.0"
  },
  "paths": {
    "/get_alerts": {
      "post": {
        "summary": "Get Alerts",
        "description": "Get weather alerts for a US state.\n\n    Args:\n        state: Two-letter US state code (e.g. CA, NY)",
        "operationId": "tool_get_alerts_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/get_alerts_form_model"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Tool Get Alerts Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": [
              
            ]
          }
        ]
      }
    },
    "/get_forecast": {
      "post": {
        "summary": "Get Forecast",
        "description": "Get weather forecast for a location.\n\n    Args:\n        latitude: Latitude of the location\n        longitude: Longitude of the location",
        "operationId": "tool_get_forecast_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/get_forecast_form_model"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Tool Get Forecast Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": [
              
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "get_alerts_form_model": {
        "properties": {
          "state": {
            "type": "string",
            "title": "State",
            "description": ""
          }
        },
        "type": "object",
        "required": [
          "state"
        ],
        "title": "get_alerts_form_model"
      },
      "get_forecast_form_model": {
        "properties": {
          "latitude": {
            "type": "number",
            "title": "Latitude",
            "description": ""
          },
          "longitude": {
            "type": "number",
            "title": "Longitude",
            "description": ""
          }
        },
        "type": "object",
        "required": [
          "latitude",
          "longitude"
        ],
        "title": "get_forecast_form_model"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions