Generate openapi.json #582
rainer85ah
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I have a simple question. What is the simplest or best way to generate an openapi.json file from a mcp server app?
My setup include 3 docker containers with ollama, open-webui, and my mcp-server, which it can talk to ollama without problems, but I can't add my mcp server to the open-webui tools because there is no openapi.json file available.
In the docs, there is information of creating a mcp server from a fastapi app or openapi.json, but what I need is going from mcp-server app to fastapi app or generate the openapi.json file.
All suggestions are welcome.
`import asyncio
import logging
from fastmcp import FastMCP
from tools.general import *
logger = logging.getLogger("MainAgent")
mcp = FastMCP(name="MainAgent")
mcp.dependencies = []
async def main():
logger.info(f"Mounting Sub-Agents ...")
mcp.mount(prefix='general', server=general_mcp)
if name == "main":
asyncio.run(main())`
Beta Was this translation helpful? Give feedback.
All reactions