You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide async connect() variant for running event loop contexts #35
CapiscioMCPServer.connect() and the underlying MCPServerIdentity.from_env_sync() / connect_sync() use asyncio.run(), which raises RuntimeError: asyncio.run() cannot be called from a running event loop when invoked from:
Jupyter notebooks
ASGI frameworks (FastAPI, Starlette)
FastMCP setups that already have an event loop
Any async def entrypoint
This is a common usage pattern for MCP server bootstrapping code.
Proposed fix
Add CapiscioMCPServer.connect_async() (or make connect() async and provide connect_sync())
Alternatively, detect a running loop and use run_coroutine_threadsafe as other sync wrappers in the repo do
Document the limitation prominently in the meantime
Activity