Skip to content

fastmcp.server.openapi Deprecation#2

Open
Xenov-X wants to merge 2 commits intoCobalt-Strike:mainfrom
Xenov-X:main
Open

fastmcp.server.openapi Deprecation#2
Xenov-X wants to merge 2 commits intoCobalt-Strike:mainfrom
Xenov-X:main

Conversation

@Xenov-X
Copy link
Copy Markdown

@Xenov-X Xenov-X commented Mar 13, 2026

Latest versions of fastmcp will result in silent failure at cs_mcp.py#L308

$ python3 cobaltstrike-mcp-server/cs_mcp.py --insecure --transport stdio
/<PATH>/cs_server.py:10: DeprecationWarning: fastmcp.server.openapi is deprecated. Import from fastmcp.server.providers.openapi instead.
  from fastmcp.server.openapi import RouteMap, MCPType
2026-03-13 11:18:19,914 WARNING __main__ - TLS verification disabled; connections will not be validated
2026-03-13 11:18:19,914 INFO __main__ - Starting Cobalt Strike MCP server
2026-03-13 11:18:19,914 INFO __main__ - Authenticating with Cobalt Strike API as 'MCP'
2026-03-13 11:18:20,203 INFO httpx - HTTP Request: POST https://localhost:50443/api/auth/login "HTTP/1.1 200 "
2026-03-13 11:18:20,204 INFO cs_client - Successfully authenticated with Cobalt Strike API


$ echo $?
1                                         

Adding a traceback exception handler to cs_mcp.py highlighted fastmcp not having the experimental attribute

2026-03-13 11:47:07,613 DEBUG cs_client - Cobalt Strike client closed
Traceback (most recent call last):
  File "/PATH/cs_mcp.py", line 330, in <module>
    asyncio.run(main())
    ~~~~~~~~~~~^^^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/PATH/cs_mcp.py", line 308, in main
    await mcp_server.create_server(args.spec_url)
  File "/PATH/cs_server.py", line 53, in create_server
    fastmcp.settings.experimental.enable_new_openapi_parser = True
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/PATH/main.py", line 1026, in __getattr__
    raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')
AttributeError: 'Settings' object has no attribute 'experimental'

Issues overview

  • fastmcp.server.openapi is deprecated in favour of fastmcp.server.providers.openapi.
  • As of fastmcp v2.14 the experimental openAPI parser has been promoted to standard/default.

Fixes applied

  • added basic exception printer to cs_mcp.py if __name__ == "__main__":
  • removed references to experimental parser (flags etc)
  • bumped minimum version of fastmcp to v2.14.0

Ref: https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant