Skip to content

[BUG] recursion error #242

@Hemanth-stack

Description

@Hemanth-stack

Describe the bug
A clear and concise description of what the bug is.

File "/opt/hemanth/lumencipher-server/main.py", line 152, in
mcp = FastApiMCP(app, name=mcp_settings.name, include_operations=mcp_settings.include_operations,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hemanth/lumencipher-server/.venv/lib/python3.12/site-packages/fastapi_mcp/server.py", line 124, in init
self.setup_server()
File "/opt/hemanth/lumencipher-server/.venv/lib/python3.12/site-packages/fastapi_mcp/server.py", line 135, in setup_server
all_tools, self.operation_map = convert_openapi_to_mcp_tools(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hemanth/lumencipher-server/.venv/lib/python3.12/site-packages/fastapi_mcp/openapi/convert.py", line 36, in convert_openapi_to_mcp_tools
resolved_openapi_schema = resolve_schema_references(openapi_schema, openapi_schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hemanth/lumencipher-server/.venv/lib/python3.12/site-packages/fastapi_mcp/openapi/utils.py", line 50, in resolve_schema_references
schema_part[key] = resolve_schema_references(value, reference_schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hemanth/lumencipher-server/.venv/lib/python3.12/site-packages/fastapi_mcp/openapi/utils.py", line 50, in resolve_schema_references
schema_part[key] = resolve_schema_references(value, reference_schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hemanth/lumencipher-server/.venv/lib/python3.12/site-packages/fastapi_mcp/openapi/utils.py", line 50, in resolve_schema_references
schema_part[key] = resolve_schema_references(value, reference_schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Previous line repeated 967 more times]
File "/opt/hemanth/lumencipher-server/.venv/lib/python3.12/site-packages/fastapi_mcp/openapi/utils.py", line 54, in resolve_schema_references
resolve_schema_references(item, reference_schema) if isinstance(item, dict) else item for item in value
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded

To Reproduce
Steps to reproduce the behavior, including example code.

just import and start initilazing error occurs.
mcp = FastApiMCP(app)

mcp.mount()

System Info
Please specify the relevant information of your work environment.
python=3.12.12
fastapi-mcp=0.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions