v2.7.0: Pare Programming
This is primarily a housekeeping release to remove or deprecate cruft that's accumulated since v1. Primarily, this release refactors FastMCP's internals in preparation for features planned in the next few major releases. However please note that as a result, this release has some minor breaking changes (which is why it's 2.7, not 2.6.2, in accordance with repo guidelines) though not to the core user-facing APIs. Examples include:
- decorators return the objects they create, not the decorated function
- websockets is an optional dependency
- methods on the server for automatically converting functions into tools/resources/prompts have been deprecated in favor of using the decorators directly
Happily, this release DOES permit the use of "naked" decorators to align with Pythonic practice:
@mcp.tool
def my_tool():
...What's Changed
New Features 🎉
- allow passing flags to servers by @zzstoatzz in #690
- replace $ref pointing to
#/components/schemas/with#/$defs/by @phateffect in #697 - Split Tool into Tool and FunctionTool by @jlowin in #700
- Use strict basemodel for Prompt; relax from_function deprecation by @jlowin in #701
- Formalize resource/functionresource replationship by @jlowin in #702
- Formalize template/functiontemplate split by @jlowin in #703
- Support flexible @tool decorator call patterns by @jlowin in #706
- Ensure deprecation warnings have stacklevel=2 by @jlowin in #710
- Allow naked prompt decorator by @jlowin in #711
Fixes 🐞
- Updates / Fixes for Tool Content Conversion by @strawgate in #642
- Fix pr labeler permissions by @jlowin in #708
- remove -n auto by @jlowin in #709
- Fix links in README.md by @alainivars in #723
Breaking Changes 🛫
- Deprecate passing functions to the server in favor of core objects by @jlowin in #705
- Remove websockets dependency by @jlowin in #726
- Return objects from FastMCP decorators by @jlowin in #727
Docs 📚
- Add banner by @jlowin in #712
- Allow clicking on banner by @jlowin in #713
- Add empty parens to docs by @jlowin in #714
- Update banner link by @jlowin in #716
- Add updates by @jlowin in #718
- Add tags by @jlowin in #719
- Update docs.json by @jlowin in #720
- Remove empty parens from decorators in docs by @jlowin in #729
New Contributors
- @phateffect made their first contribution in #697
Full Changelog: v2.6.1...v2.7.0