Skip to content

docs(adr): record that FastMCP 4 fired ADR 0001's revisit trigger - #192

Closed
lesnik512 wants to merge 1 commit into
mainfrom
docs/fastmcp-adr-revisit-trigger
Closed

docs(adr): record that FastMCP 4 fired ADR 0001's revisit trigger#192
lesnik512 wants to merge 1 commit into
mainfrom
docs/fastmcp-adr-revisit-trigger

Conversation

@lesnik512

Copy link
Copy Markdown
Member

ADR 0001 chose FastMCP.add_provider() for teardown and set a revisit trigger: FastMCP grows a
first-class shutdown hook, either an on_shutdown API or a documented public way to compose a
lifespan post-construction.

Checked against fastmcp 4.0.3. The trigger fired on its second clause, but the replacement it
pointed at is worse than what we have, so this records the evaluation and narrows the trigger rather
than changing the decision.

  • on_shutdown and on_startup are still absent, so the first clause did not fire.
  • add_extension(ServerExtension) exists, and ServerExtension.lifespan() is documented as
    "A context manager entered with the server's lifespan, exited on shutdown", to "start and stop
    resources an extension owns". That satisfies the second clause literally.
  • But ServerExtension.identifier is a required reverse-DNS string, validated at registration, and
    documented as "advertised under ServerCapabilities.extensions". Registering one purely for a
    shutdown callback would announce a protocol capability the bootstrapper does not implement. The
    Provider route's thinness is invisible outside the process; this would not be.
  • The fastmcp extra declares an unbounded "fastmcp", so ServerExtension may not exist at
    runtime. Adopting it would force a fastmcp>=4 floor on an optional extra.

The trigger now names a hook that is neither client-visible nor tied to another abstraction's
semantics, and says explicitly that add_extension does not qualify, so this does not get
re-litigated on every version bump.

Docs only, no code change.

add_extension/ServerExtension.lifespan satisfies the trigger's second clause,
but ServerExtension.identifier is advertised under ServerCapabilities.extensions,
so adopting it would announce a protocol capability the bootstrapper does not
implement. Narrow the trigger to a hook that is not client-visible.
@lesnik512

Copy link
Copy Markdown
Member Author

Closing unmerged; the ADR amendment is not being pursued for now.

@lesnik512 lesnik512 closed this Sep 7, 2026
@lesnik512
lesnik512 deleted the docs/fastmcp-adr-revisit-trigger branch September 7, 2026 06:34
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