fastmcp 2.10.5__py3-none-any.whl → 2.11.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. fastmcp/__init__.py +7 -2
  2. fastmcp/cli/cli.py +128 -33
  3. fastmcp/cli/install/__init__.py +2 -2
  4. fastmcp/cli/install/claude_code.py +42 -1
  5. fastmcp/cli/install/claude_desktop.py +42 -1
  6. fastmcp/cli/install/cursor.py +42 -1
  7. fastmcp/cli/install/{mcp_config.py → mcp_json.py} +51 -7
  8. fastmcp/cli/run.py +127 -1
  9. fastmcp/client/__init__.py +2 -0
  10. fastmcp/client/auth/oauth.py +68 -99
  11. fastmcp/client/oauth_callback.py +18 -0
  12. fastmcp/client/transports.py +69 -15
  13. fastmcp/contrib/component_manager/example.py +2 -2
  14. fastmcp/experimental/server/openapi/README.md +266 -0
  15. fastmcp/experimental/server/openapi/__init__.py +38 -0
  16. fastmcp/experimental/server/openapi/components.py +348 -0
  17. fastmcp/experimental/server/openapi/routing.py +132 -0
  18. fastmcp/experimental/server/openapi/server.py +466 -0
  19. fastmcp/experimental/utilities/openapi/README.md +239 -0
  20. fastmcp/experimental/utilities/openapi/__init__.py +68 -0
  21. fastmcp/experimental/utilities/openapi/director.py +208 -0
  22. fastmcp/experimental/utilities/openapi/formatters.py +355 -0
  23. fastmcp/experimental/utilities/openapi/json_schema_converter.py +340 -0
  24. fastmcp/experimental/utilities/openapi/models.py +85 -0
  25. fastmcp/experimental/utilities/openapi/parser.py +618 -0
  26. fastmcp/experimental/utilities/openapi/schemas.py +538 -0
  27. fastmcp/mcp_config.py +125 -88
  28. fastmcp/prompts/prompt.py +11 -1
  29. fastmcp/prompts/prompt_manager.py +1 -1
  30. fastmcp/resources/resource.py +21 -1
  31. fastmcp/resources/resource_manager.py +2 -2
  32. fastmcp/resources/template.py +20 -1
  33. fastmcp/server/auth/__init__.py +17 -2
  34. fastmcp/server/auth/auth.py +144 -7
  35. fastmcp/server/auth/providers/bearer.py +25 -473
  36. fastmcp/server/auth/providers/in_memory.py +4 -2
  37. fastmcp/server/auth/providers/jwt.py +538 -0
  38. fastmcp/server/auth/providers/workos.py +170 -0
  39. fastmcp/server/auth/registry.py +52 -0
  40. fastmcp/server/context.py +110 -26
  41. fastmcp/server/dependencies.py +9 -2
  42. fastmcp/server/http.py +62 -30
  43. fastmcp/server/middleware/middleware.py +3 -23
  44. fastmcp/server/openapi.py +26 -13
  45. fastmcp/server/proxy.py +89 -8
  46. fastmcp/server/server.py +170 -62
  47. fastmcp/settings.py +83 -18
  48. fastmcp/tools/tool.py +41 -6
  49. fastmcp/tools/tool_manager.py +39 -3
  50. fastmcp/tools/tool_transform.py +122 -6
  51. fastmcp/utilities/components.py +35 -2
  52. fastmcp/utilities/json_schema.py +136 -98
  53. fastmcp/utilities/json_schema_type.py +1 -3
  54. fastmcp/utilities/mcp_config.py +28 -0
  55. fastmcp/utilities/openapi.py +306 -30
  56. fastmcp/utilities/tests.py +54 -6
  57. fastmcp/utilities/types.py +89 -11
  58. {fastmcp-2.10.5.dist-info → fastmcp-2.11.0.dist-info}/METADATA +4 -3
  59. fastmcp-2.11.0.dist-info/RECORD +108 -0
  60. fastmcp/server/auth/providers/bearer_env.py +0 -63
  61. fastmcp/utilities/cache.py +0 -26
  62. fastmcp-2.10.5.dist-info/RECORD +0 -93
  63. {fastmcp-2.10.5.dist-info → fastmcp-2.11.0.dist-info}/WHEEL +0 -0
  64. {fastmcp-2.10.5.dist-info → fastmcp-2.11.0.dist-info}/entry_points.txt +0 -0
  65. {fastmcp-2.10.5.dist-info → fastmcp-2.11.0.dist-info}/licenses/LICENSE +0 -0
@@ -8,11 +8,19 @@ from collections.abc import Callable
8
8
  from functools import lru_cache
9
9
  from pathlib import Path
10
10
  from types import EllipsisType, UnionType
11
- from typing import Annotated, TypeAlias, TypeVar, Union, get_args, get_origin
11
+ from typing import (
12
+ Annotated,
13
+ TypeAlias,
14
+ TypeVar,
15
+ Union,
16
+ get_args,
17
+ get_origin,
18
+ get_type_hints,
19
+ )
12
20
 
13
21
  import mcp.types
14
22
  from mcp.types import Annotations
15
- from pydantic import AnyUrl, BaseModel, ConfigDict, TypeAdapter, UrlConstraints
23
+ from pydantic import AnyUrl, BaseModel, ConfigDict, Field, TypeAdapter, UrlConstraints
16
24
 
17
25
  T = TypeVar("T")
18
26
 
@@ -35,6 +43,66 @@ def get_cached_typeadapter(cls: T) -> TypeAdapter[T]:
35
43
  However, this isn't feasible for user-generated functions. Instead, we use a
36
44
  cache to minimize the cost of creating them as much as possible.
37
45
  """
46
+ # For functions, process annotations to handle forward references and convert
47
+ # Annotated[Type, "string"] to Annotated[Type, Field(description="string")]
48
+ if inspect.isfunction(cls) or inspect.ismethod(cls):
49
+ if hasattr(cls, "__annotations__") and cls.__annotations__:
50
+ try:
51
+ # Resolve forward references first
52
+ resolved_hints = get_type_hints(cls, include_extras=True)
53
+ except Exception:
54
+ # If forward reference resolution fails, use original annotations
55
+ resolved_hints = cls.__annotations__
56
+
57
+ # Process annotations to convert string descriptions to Fields
58
+ processed_hints = {}
59
+
60
+ for name, annotation in resolved_hints.items():
61
+ # Check if this is Annotated[Type, "string"] and convert to Annotated[Type, Field(description="string")]
62
+ if (
63
+ get_origin(annotation) is Annotated
64
+ and len(get_args(annotation)) == 2
65
+ and isinstance(get_args(annotation)[1], str)
66
+ ):
67
+ base_type, description = get_args(annotation)
68
+ processed_hints[name] = Annotated[
69
+ base_type, Field(description=description)
70
+ ]
71
+ else:
72
+ processed_hints[name] = annotation
73
+
74
+ # Create new function if annotations changed
75
+ if processed_hints != cls.__annotations__:
76
+ import types
77
+
78
+ # Handle both functions and methods
79
+ if inspect.ismethod(cls):
80
+ actual_func = cls.__func__
81
+ code = actual_func.__code__
82
+ globals_dict = actual_func.__globals__
83
+ name = actual_func.__name__
84
+ defaults = actual_func.__defaults__
85
+ closure = actual_func.__closure__
86
+ else:
87
+ code = cls.__code__
88
+ globals_dict = cls.__globals__
89
+ name = cls.__name__
90
+ defaults = cls.__defaults__
91
+ closure = cls.__closure__
92
+
93
+ new_func = types.FunctionType(
94
+ code,
95
+ globals_dict,
96
+ name,
97
+ defaults,
98
+ closure,
99
+ )
100
+ new_func.__dict__.update(cls.__dict__)
101
+ new_func.__module__ = cls.__module__
102
+ new_func.__qualname__ = getattr(cls, "__qualname__", cls.__name__)
103
+ new_func.__annotations__ = processed_hints
104
+ return TypeAdapter(new_func)
105
+
38
106
  return TypeAdapter(cls)
39
107
 
40
108
 
@@ -77,12 +145,21 @@ def find_kwarg_by_type(fn: Callable, kwarg_type: type) -> str | None:
77
145
  Includes union types that contain the kwarg_type, as well as Annotated types.
78
146
  """
79
147
  if inspect.ismethod(fn) and hasattr(fn, "__func__"):
80
- sig = inspect.signature(fn.__func__)
81
- else:
82
- sig = inspect.signature(fn)
148
+ fn = fn.__func__
83
149
 
150
+ # Try to get resolved type hints
151
+ try:
152
+ # Use include_extras=True to preserve Annotated metadata
153
+ type_hints = get_type_hints(fn, include_extras=True)
154
+ except Exception:
155
+ # If resolution fails, use raw annotations if they exist
156
+ type_hints = getattr(fn, "__annotations__", {})
157
+
158
+ sig = inspect.signature(fn)
84
159
  for name, param in sig.parameters.items():
85
- if is_class_member_of_type(param.annotation, kwarg_type):
160
+ # Use resolved hint if available, otherwise raw annotation
161
+ annotation = type_hints.get(name, param.annotation)
162
+ if is_class_member_of_type(annotation, kwarg_type):
86
163
  return name
87
164
  return None
88
165
 
@@ -303,12 +380,13 @@ def replace_type(type_, type_map: dict[type, type]):
303
380
  new_type: The type to replace old_type with.
304
381
 
305
382
  Examples:
306
- >>> replace_type(list[int | bool], {int: str})
307
- list[str | bool]
308
-
309
- >>> replace_type(list[list[int]], {int: str})
310
- list[list[str]]
383
+ ```python
384
+ >>> replace_type(list[int | bool], {int: str})
385
+ list[str | bool]
311
386
 
387
+ >>> replace_type(list[list[int]], {int: str})
388
+ list[list[str]]
389
+ ```
312
390
  """
313
391
  if type_ in type_map:
314
392
  return type_map[type_]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastmcp
3
- Version: 2.10.5
3
+ Version: 2.11.0
4
4
  Summary: The fast, Pythonic way to build MCP servers and clients.
5
5
  Project-URL: Homepage, https://gofastmcp.com
6
6
  Project-URL: Repository, https://github.com/jlowin/fastmcp
@@ -22,6 +22,7 @@ Requires-Dist: cyclopts>=3.0.0
22
22
  Requires-Dist: exceptiongroup>=1.2.2
23
23
  Requires-Dist: httpx>=0.28.1
24
24
  Requires-Dist: mcp>=1.10.0
25
+ Requires-Dist: openapi-core>=0.19.5
25
26
  Requires-Dist: openapi-pydantic>=0.5.1
26
27
  Requires-Dist: pydantic[email]>=2.11.7
27
28
  Requires-Dist: pyperclip>=1.9.0
@@ -38,7 +39,7 @@ Description-Content-Type: text/markdown
38
39
 
39
40
  <strong>The fast, Pythonic way to build MCP servers and clients.</strong>
40
41
 
41
- *FastMCP is made with 💙 by [Prefect](https://www.prefect.io/)*
42
+ *Made with ☕️ by [Prefect](https://www.prefect.io/)*
42
43
 
43
44
  [![Docs](https://img.shields.io/badge/docs-gofastmcp.com-blue)](https://gofastmcp.com)
44
45
  [![PyPI - Version](https://img.shields.io/pypi/v/fastmcp.svg)](https://pypi.org/project/fastmcp)
@@ -341,7 +342,7 @@ Learn more in the [**Composition Documentation**](https://gofastmcp.com/patterns
341
342
 
342
343
  Automatically generate FastMCP servers from existing OpenAPI specifications (`FastMCP.from_openapi()`) or FastAPI applications (`FastMCP.from_fastapi()`), instantly bringing your web APIs to the MCP ecosystem.
343
344
 
344
- Learn more: [**OpenAPI Integration**](https://gofastmcp.com/servers/openapi#openapi-integration) | [**FastAPI Integration**](https://gofastmcp.com/deployment/asgi#fastapi-integration).
345
+ Learn more: [**OpenAPI Integration**](https://gofastmcp.com/integrations/openapi) | [**FastAPI Integration**](https://gofastmcp.com/integrations/fastapi).
345
346
 
346
347
  ### Authentication & Security
347
348
 
@@ -0,0 +1,108 @@
1
+ fastmcp/__init__.py,sha256=B_FAqsxbTJmwvJKyIDMOZWpUUdmO806bKo8RR32oZL0,1503
2
+ fastmcp/exceptions.py,sha256=-krEavxwddQau6T7MESCR4VjKNLfP9KHJrU1p3y72FU,744
3
+ fastmcp/mcp_config.py,sha256=jf6VyGHli3GcZNg4spdV1L_lPOeNCKTJh-nGIBaMgn4,10324
4
+ fastmcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ fastmcp/settings.py,sha256=70cxWrYktvHSOHCgj2rKLJ09HU-pHnfs0jCxxv2Rf80,11131
6
+ fastmcp/cli/__init__.py,sha256=Ii284TNoG5lxTP40ETMGhHEq3lQZWxu9m9JuU57kUpQ,87
7
+ fastmcp/cli/claude.py,sha256=IAlcZ4qZKBBj09jZUMEx7EANZE_IR3vcu7zOBJmMOuU,4567
8
+ fastmcp/cli/cli.py,sha256=ovUWG-E3lAfIfKegn2zfYM9oiB0yyPkLViQZd12mYKw,15669
9
+ fastmcp/cli/run.py,sha256=OOdau2sNQsgan4NXucY-3LWOWn6cKjmdALfzht2RXQ0,10508
10
+ fastmcp/cli/install/__init__.py,sha256=cDEc0hhuf_xwGpI6ghpqlvlMdBMJUGHq_rs-tgmOJZ8,695
11
+ fastmcp/cli/install/claude_code.py,sha256=ayTZtudjNWHE8MIGeJfb_TmJI3F5K_DHD1X3qEjxEWg,7712
12
+ fastmcp/cli/install/claude_desktop.py,sha256=y8ha2OKM8IuvQbmGNq842q-m-vs_ts2P9cMxAhbBvs4,6872
13
+ fastmcp/cli/install/cursor.py,sha256=q5jXBzpxvoWrgP9pItwNlyl13XpYbtIlZS_dRBkBSdc,6837
14
+ fastmcp/cli/install/mcp_json.py,sha256=uxCN8fsIjJStWtL0J7kfQ9haIJU0SYF8CXYT-crl_o0,5923
15
+ fastmcp/cli/install/shared.py,sha256=Y0YZei1YemVCkg0ieUgfRse-lqSlIn5Ho8t6pB9nDa4,2683
16
+ fastmcp/client/__init__.py,sha256=J-RcLU2WcnYnstXWoW01itGtAg7DEjvCsWyqQKQljoo,663
17
+ fastmcp/client/client.py,sha256=GniETS28L8B-ahzztU2ZLI_XSCcEib-miGzE2ZnG4Xc,34054
18
+ fastmcp/client/elicitation.py,sha256=Jf9yqna8R7r1hqedXAyh9a2-QNVzbCSKUDZhkFHqHqg,2403
19
+ fastmcp/client/logging.py,sha256=7GJ-BLFW16_IOJPlGTNEWPP0P-yqqRpmsLdiKrlVsw8,757
20
+ fastmcp/client/messages.py,sha256=NIPjt-5js_DkI5BD4OVdTf6pz-nGjc2dtbgt-vAY234,4329
21
+ fastmcp/client/oauth_callback.py,sha256=2btKmVWEDqQDY7XaK_pt1gcV3LgaodDhljn33XmSSP4,10829
22
+ fastmcp/client/progress.py,sha256=WjLLDbUKMsx8DK-fqO7AGsXb83ak-6BMrLvzzznGmcI,1043
23
+ fastmcp/client/roots.py,sha256=IxI_bHwHTmg6c2H-s1av1ZgrRnNDieHtYwdGFbzXT5c,2471
24
+ fastmcp/client/sampling.py,sha256=Q8PzYCERa1W3xGGI9I9QOhhDM-M4i3P5lESb0cp2iI8,1595
25
+ fastmcp/client/transports.py,sha256=_uOTkKbMmVuG8lYQWdpBU8DOHWrGd11KLcFoTvLoKHc,35601
26
+ fastmcp/client/auth/__init__.py,sha256=4DNsfp4iaQeBcpds0JDdMn6Mmfud44stWLsret0sVKY,91
27
+ fastmcp/client/auth/bearer.py,sha256=MFEFqcH6u_V86msYiOsEFKN5ks1V9BnBNiPsPLHUTqo,399
28
+ fastmcp/client/auth/oauth.py,sha256=qV-dfrJz34UN4kYVqkQyZ2ApAMI8ZFez0qx2zfs654k,10772
29
+ fastmcp/contrib/README.md,sha256=rKknYSI1T192UvSszqwwDlQ2eYQpxywrNTLoj177SYU,878
30
+ fastmcp/contrib/bulk_tool_caller/README.md,sha256=5aUUY1TSFKtz1pvTLSDqkUCkGkuqMfMZNsLeaNqEgAc,1960
31
+ fastmcp/contrib/bulk_tool_caller/__init__.py,sha256=xvGSSaUXTQrc31erBoi1Gh7BikgOliETDiYVTP3rLxY,75
32
+ fastmcp/contrib/bulk_tool_caller/bulk_tool_caller.py,sha256=2NcrGS59qvHo1lfbRaT8NSWfCxN66knciLxFvnGwCLY,4165
33
+ fastmcp/contrib/bulk_tool_caller/example.py,sha256=6og_8pCJN_CabworC5R82zPAwwwM-W7HNJLQQSnS3lU,319
34
+ fastmcp/contrib/component_manager/README.md,sha256=sTan1D51jzkPNnCQTxwd5JXGzWVy4DtkUjrUfNH3-F0,4457
35
+ fastmcp/contrib/component_manager/__init__.py,sha256=4bppVrCOSEepKmBRwVWN-ndu5BYAz1Kv2Z8yhjEUmlo,164
36
+ fastmcp/contrib/component_manager/component_manager.py,sha256=4R1FPVYjCr-j7Mn6OcbHH-psl9-JTdd1hgNZHasC52Y,6412
37
+ fastmcp/contrib/component_manager/component_service.py,sha256=dLIOtXvMpCAu8CGlrqAWb9pX0AhVGqkC4j0uxv6XnXs,8759
38
+ fastmcp/contrib/component_manager/example.py,sha256=N16OIHmQuR-LNEv7bkrv2rGdMs862Nc3AKKEPfw-6rU,1587
39
+ fastmcp/contrib/mcp_mixin/README.md,sha256=X6rzt_4vC_rmq9jbHmrVPqYLGVVlw9b4TVL4H_0SMmQ,4277
40
+ fastmcp/contrib/mcp_mixin/__init__.py,sha256=aw9IQ1ssNjCgws4ZNt8bkdpossAAGVAwwjBpMp9O5ZQ,153
41
+ fastmcp/contrib/mcp_mixin/example.py,sha256=GnunkXmtG5hLLTUsM8aW5ZURU52Z8vI4tNLl-fK7Dg0,1228
42
+ fastmcp/contrib/mcp_mixin/mcp_mixin.py,sha256=sUSJ2o0sTsb061MyPN2xuYP0oI4W6YVQXupY3nnjD50,8687
43
+ fastmcp/experimental/server/openapi/README.md,sha256=1Mc1Ur15OxMn-wAPEa1rZIiNNSMdv9sboQ3YpvNpUXM,9886
44
+ fastmcp/experimental/server/openapi/__init__.py,sha256=f1Mc7dkuRRJb_6-3umSHuyuXtvXTzH72t8gw1GBHgZU,772
45
+ fastmcp/experimental/server/openapi/components.py,sha256=jp5xy0xkn14cFRk9FYlp3LpW-j44C0KcXvMQmdWVpB8,13237
46
+ fastmcp/experimental/server/openapi/routing.py,sha256=qZuY0YeM51y_tTeAAeQMqI3BNRzA469tX1QhlzIn-JI,4174
47
+ fastmcp/experimental/server/openapi/server.py,sha256=UV75LCZLtctqTBbcCeOs8-mmVP2bAs5v4l8ubWOgykY,16973
48
+ fastmcp/experimental/utilities/openapi/README.md,sha256=pOXftamuVXxEMlOt-JAfpuvHeRGauC3l46ntD1WzM-A,8604
49
+ fastmcp/experimental/utilities/openapi/__init__.py,sha256=0I1BpkGbOeqveRKCvyKv6InZgsaUZBhIzeV1OXGy6aY,1671
50
+ fastmcp/experimental/utilities/openapi/director.py,sha256=0YnazKmfaSPkBRAz5aI6blFN9nzXJWru3fvU6llYltA,7859
51
+ fastmcp/experimental/utilities/openapi/formatters.py,sha256=rtNuU-H6XqkPFiEAdcx1BdWnmHEM-zearPueMTuXdQY,14242
52
+ fastmcp/experimental/utilities/openapi/json_schema_converter.py,sha256=W_40IPyuYnstcYtGf--eyTquecmwpvFYBK0W-XQ7OAw,12921
53
+ fastmcp/experimental/utilities/openapi/models.py,sha256=KegqsEWTKddQafyOPHKpN1sBhsuVNy406ArF368g9JQ,2640
54
+ fastmcp/experimental/utilities/openapi/parser.py,sha256=h-yxYbkEzMCaK2WrPw49EihizCYg2est3mR3kWSCyGM,26399
55
+ fastmcp/experimental/utilities/openapi/schemas.py,sha256=-rkuL36YqPRe1YJuY9hOI5XZ7taxhEZe6Oy8RkKRgoU,20521
56
+ fastmcp/prompts/__init__.py,sha256=An8uMBUh9Hrb7qqcn_5_Hent7IOeSh7EA2IUVsIrtHc,179
57
+ fastmcp/prompts/prompt.py,sha256=lxlxQi9gylLW36-eVKUyH7PwndoxhA6ii8m4Cok6MEU,14158
58
+ fastmcp/prompts/prompt_manager.py,sha256=lErodAnqVHRu_1FttfHTh-arWf9rkCOCGTxZzZP_3SE,7707
59
+ fastmcp/resources/__init__.py,sha256=y1iAuqx-GIrS1NqIYzKezIDiYyjNEzzHD35epHpMnXE,463
60
+ fastmcp/resources/resource.py,sha256=IW2PToUgBOWDuZ1q8tiT7s0iSeh7a1mIFr56UyYbJ1E,6727
61
+ fastmcp/resources/resource_manager.py,sha256=jmnKAkA7jevvKeccAVDsAAeXvI0IkrQeIXHCC36tf_0,19837
62
+ fastmcp/resources/template.py,sha256=HXL_T1hUXMwv1h0962NTtszGY68R1TbumjJMvC0PjjU,11030
63
+ fastmcp/resources/types.py,sha256=SiYNLnpXT-mHgNUrzqKUvXYUsY-V3gwJIrYdJfFwDDo,4868
64
+ fastmcp/server/__init__.py,sha256=bMD4aQD4yJqLz7-mudoNsyeV8UgQfRAg3PRwPvwTEds,119
65
+ fastmcp/server/context.py,sha256=ooVwF4RoIbLB2S043E5HtK_dCyAWQkDm1YWCkqfUPzs,22638
66
+ fastmcp/server/dependencies.py,sha256=gfb1l3KD2m3h7BpN8lgKWrHY3_OJdDrlnJXCvzmU5YM,2487
67
+ fastmcp/server/elicitation.py,sha256=jZIHjV4NjhYbT-w8pBArwd0vNzP8OYwzmsnWDdk6Bd0,6136
68
+ fastmcp/server/http.py,sha256=aFWWPB_l9HPFnqTh_RMdrDGFMUETGkiQIeXqSzf7ZoA,13396
69
+ fastmcp/server/low_level.py,sha256=LNmc_nU_wx-fRG8OEHdLPKopZpovcrWlyAxJzKss3TA,1239
70
+ fastmcp/server/openapi.py,sha256=-7-pKwQ1hT-UV9OnLlWrjbbXXRfZld8YJqa4Duybhtw,42102
71
+ fastmcp/server/proxy.py,sha256=4eHW2Vgwe7zvd0g-ozsvYRyIoengyGyhlyMcSPhcaIU,24975
72
+ fastmcp/server/server.py,sha256=hmNiwYFnWhERY-WhxAvS9jIvXOx8_g8ylX-Ju91Y4qk,87597
73
+ fastmcp/server/auth/__init__.py,sha256=_9t3pctON0W55jLFTZp06oS6BLiRUQhmX5LgtA-ya48,504
74
+ fastmcp/server/auth/auth.py,sha256=TZ_XBJ66gR5vb4BdIpe-EkUa1pRR03AA-oZj-YiAtsA,7035
75
+ fastmcp/server/auth/registry.py,sha256=4ftVbbuyAi-8zBiJL9-dYIKLU_EOpxY-pFdzHMrmjV8,1306
76
+ fastmcp/server/auth/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
77
+ fastmcp/server/auth/providers/bearer.py,sha256=iu4pUj7TF5pT1wPuAGzDuM6lt5WtzenBN3c0otUleQY,923
78
+ fastmcp/server/auth/providers/in_memory.py,sha256=tlUwbUZK5stUC_wjezcDs61PxjaHjykXbd8aH0cnW6k,14359
79
+ fastmcp/server/auth/providers/jwt.py,sha256=oHwtnQ8hUBwV9ZZZsCBNCj9s4yUYUaweULQYl6MMHgk,18887
80
+ fastmcp/server/auth/providers/workos.py,sha256=fIMmTFJpX6QyYsetxtPO87QJH8Aom9UmHSgedo0DMY4,6131
81
+ fastmcp/server/middleware/__init__.py,sha256=vh5C9ubN6q-y5QND32P4mQ4zDT89C7XYK39yqhELNAk,155
82
+ fastmcp/server/middleware/error_handling.py,sha256=SoDatr9i3T2qSIUbSEGWrOnu4WPPyMDymnsF5GR_BiE,7572
83
+ fastmcp/server/middleware/logging.py,sha256=UIAoafnKRGWpQa7OX5nzChep-9EhKdyTDBmmcRcEVdo,6239
84
+ fastmcp/server/middleware/middleware.py,sha256=9_4zjkVVIa6pfUTHq57gKGxRDiIU-xKrGT8FlkHOKiU,6020
85
+ fastmcp/server/middleware/rate_limiting.py,sha256=VTrCoQFmWCm0BxwOrNfG21CBFDDOKJT7IiSEjpJgmPA,7921
86
+ fastmcp/server/middleware/timing.py,sha256=lL_xc-ErLD5lplfvd5-HIyWEbZhgNBYkcQ74KFXAMkA,5591
87
+ fastmcp/tools/__init__.py,sha256=vzqb-Y7Kf0d5T0aOsld-O-FA8kD7-4uFExChewFHEzY,201
88
+ fastmcp/tools/tool.py,sha256=s6kWgXwxmmQIDoHDKeO2KmAikPEUvJ2jh_Sk-CUtBfQ,18613
89
+ fastmcp/tools/tool_manager.py,sha256=Pr6BI7IInvhkTw2S4ENWj8qMewdYi2CpzbOBiJIk40c,9032
90
+ fastmcp/tools/tool_transform.py,sha256=f8Bt79qdmOM8Zietm7lXb5_5DlJLu02ovGmQBQJ6orw,36671
91
+ fastmcp/utilities/__init__.py,sha256=-imJ8S-rXmbXMWeDamldP-dHDqAPg_wwmPVz-LNX14E,31
92
+ fastmcp/utilities/cli.py,sha256=TXuSyALFAGJwi7tWEBwBmaGhYZBdF1aG6dLgl3zjM1w,3272
93
+ fastmcp/utilities/components.py,sha256=WbmAn925ESRsMc4jm3gNQghvAkfeCjSXquOxU4ENZc4,5085
94
+ fastmcp/utilities/exceptions.py,sha256=7Z9j5IzM5rT27BC1Mcn8tkS-bjqCYqMKwb2MMTaxJYU,1350
95
+ fastmcp/utilities/http.py,sha256=1ns1ymBS-WSxbZjGP6JYjSO52Wa_ls4j4WbnXiupoa4,245
96
+ fastmcp/utilities/inspect.py,sha256=XNA0dfYM5G-FVbJaVJO8loSUUCNypyLA-QjqTOneJyU,10833
97
+ fastmcp/utilities/json_schema.py,sha256=Nk6qQKtp0-MlMbRQmx8ps8SJ7SW9CpuWhSes1VASFPQ,8141
98
+ fastmcp/utilities/json_schema_type.py,sha256=fSG-af3OPGgOhuhY_xb0-JsTu5tqi275zXlUw4ItjNo,22287
99
+ fastmcp/utilities/logging.py,sha256=1y7oNmy8WrR0NsfNVw1LPoKu92OFdmzIO65syOKi_BI,1388
100
+ fastmcp/utilities/mcp_config.py,sha256=zzs4VWHqG0eWEnEUwVve7mef_JFThwfvqBYt7nx3jXc,871
101
+ fastmcp/utilities/openapi.py,sha256=URb_OG3D1HQ2KW38rqeyy_fHzpthf-RYlGhDm_7KDjE,63310
102
+ fastmcp/utilities/tests.py,sha256=9FVLmGYfUjqfn0pPH33awlTgvg-JCNbnZnraJHNSYTg,6156
103
+ fastmcp/utilities/types.py,sha256=JmIgOGlFDf3Ksde9p22M8S60AlO6YJywNGtLeQMwwyo,13790
104
+ fastmcp-2.11.0.dist-info/METADATA,sha256=azUYPj5I8ygluPs1Ix-pCrHi7NjCLF50twldOVe1eE4,17839
105
+ fastmcp-2.11.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
106
+ fastmcp-2.11.0.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
107
+ fastmcp-2.11.0.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
108
+ fastmcp-2.11.0.dist-info/RECORD,,
@@ -1,63 +0,0 @@
1
- from types import EllipsisType
2
-
3
- from pydantic_settings import BaseSettings, SettingsConfigDict
4
-
5
- from fastmcp.server.auth.providers.bearer import BearerAuthProvider
6
-
7
-
8
- class EnvBearerAuthProviderSettings(BaseSettings):
9
- """Settings for the BearerAuthProvider."""
10
-
11
- model_config = SettingsConfigDict(
12
- env_prefix="FASTMCP_AUTH_BEARER_",
13
- env_file=".env",
14
- extra="ignore",
15
- )
16
-
17
- public_key: str | None = None
18
- jwks_uri: str | None = None
19
- issuer: str | None = None
20
- algorithm: str | None = None
21
- audience: str | None = None
22
- required_scopes: list[str] | None = None
23
-
24
-
25
- class EnvBearerAuthProvider(BearerAuthProvider):
26
- """
27
- A BearerAuthProvider that loads settings from environment variables. Any
28
- providing setting will always take precedence over the environment
29
- variables.
30
- """
31
-
32
- def __init__(
33
- self,
34
- public_key: str | None | EllipsisType = ...,
35
- jwks_uri: str | None | EllipsisType = ...,
36
- issuer: str | None | EllipsisType = ...,
37
- algorithm: str | None | EllipsisType = ...,
38
- audience: str | None | EllipsisType = ...,
39
- required_scopes: list[str] | None | EllipsisType = ...,
40
- ):
41
- """
42
- Initialize the provider.
43
-
44
- Args:
45
- public_key: RSA public key in PEM format (for static key)
46
- jwks_uri: URI to fetch keys from (for key rotation)
47
- issuer: Expected issuer claim (optional)
48
- algorithm: Algorithm to use for verification (optional)
49
- audience: Expected audience claim (optional)
50
- required_scopes: List of required scopes for access (optional)
51
- """
52
- kwargs = {
53
- "public_key": public_key,
54
- "jwks_uri": jwks_uri,
55
- "issuer": issuer,
56
- "algorithm": algorithm,
57
- "audience": audience,
58
- "required_scopes": required_scopes,
59
- }
60
- settings = EnvBearerAuthProviderSettings(
61
- **{k: v for k, v in kwargs.items() if v is not ...}
62
- )
63
- super().__init__(**settings.model_dump())
@@ -1,26 +0,0 @@
1
- import datetime
2
- from typing import Any
3
-
4
- UTC = datetime.timezone.utc
5
-
6
-
7
- class TimedCache:
8
- NOT_FOUND = object()
9
-
10
- def __init__(self, expiration: datetime.timedelta):
11
- self.expiration = expiration
12
- self.cache: dict[Any, tuple[Any, datetime.datetime]] = {}
13
-
14
- def set(self, key: Any, value: Any) -> None:
15
- expires = datetime.datetime.now(UTC) + self.expiration
16
- self.cache[key] = (value, expires)
17
-
18
- def get(self, key: Any) -> Any:
19
- value = self.cache.get(key)
20
- if value is not None and value[1] > datetime.datetime.now(UTC):
21
- return value[0]
22
- else:
23
- return self.NOT_FOUND
24
-
25
- def clear(self) -> None:
26
- self.cache.clear()
@@ -1,93 +0,0 @@
1
- fastmcp/__init__.py,sha256=5ChT4kg3srdFl0-9dZekGqpzCESlpc6ohrfPbWf1aTo,1300
2
- fastmcp/exceptions.py,sha256=-krEavxwddQau6T7MESCR4VjKNLfP9KHJrU1p3y72FU,744
3
- fastmcp/mcp_config.py,sha256=hOF_NO7F9LbrbmRTj99TVSqHIul4sExNpf1T1HRLpzo,9606
4
- fastmcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- fastmcp/settings.py,sha256=Ta0TKA75xda9sNkIOpPVIEEk4W9jf_2gwcmO26uDQpg,8946
6
- fastmcp/cli/__init__.py,sha256=Ii284TNoG5lxTP40ETMGhHEq3lQZWxu9m9JuU57kUpQ,87
7
- fastmcp/cli/claude.py,sha256=IAlcZ4qZKBBj09jZUMEx7EANZE_IR3vcu7zOBJmMOuU,4567
8
- fastmcp/cli/cli.py,sha256=Q4HDVDSty1Gx6qN_M4FDx8RYat34vhWT25338X-quNs,12672
9
- fastmcp/cli/run.py,sha256=V268Lf7LXdeMZ4_D4fKdFST7cOs8pGgLXZTxtcEJRWg,6715
10
- fastmcp/cli/install/__init__.py,sha256=afaNANIhivfKi4QhJdYUP56Q2XZ4da4dUbDq9HAMJqo,701
11
- fastmcp/cli/install/claude_code.py,sha256=VlFVGKKRppkmp42io6VPTQrQHgNww4H2ppa6mAWM-Ao,6430
12
- fastmcp/cli/install/claude_desktop.py,sha256=o3p3KiW0QzsrzOEa3OU_gkvzTuFSkabDwEqwwgp1mYU,5590
13
- fastmcp/cli/install/cursor.py,sha256=296a22T3fdaC8deCwh3TreVFoJ0QpjLxRF1gNsp3Wjg,5555
14
- fastmcp/cli/install/mcp_config.py,sha256=D1vkZj13ofNFbFhdn8eAuEx-CHTr3nGiVkjSZTdnetY,4559
15
- fastmcp/cli/install/shared.py,sha256=Y0YZei1YemVCkg0ieUgfRse-lqSlIn5Ho8t6pB9nDa4,2683
16
- fastmcp/client/__init__.py,sha256=kd2hhSuD8rZuF87c9zlPJP_icJ-Rx3exyNoK0EzfOtE,617
17
- fastmcp/client/client.py,sha256=GniETS28L8B-ahzztU2ZLI_XSCcEib-miGzE2ZnG4Xc,34054
18
- fastmcp/client/elicitation.py,sha256=Jf9yqna8R7r1hqedXAyh9a2-QNVzbCSKUDZhkFHqHqg,2403
19
- fastmcp/client/logging.py,sha256=7GJ-BLFW16_IOJPlGTNEWPP0P-yqqRpmsLdiKrlVsw8,757
20
- fastmcp/client/messages.py,sha256=NIPjt-5js_DkI5BD4OVdTf6pz-nGjc2dtbgt-vAY234,4329
21
- fastmcp/client/oauth_callback.py,sha256=ODAnVX-ettL82RuI5KpfkKf8iDtYMDue3Tnab5sjQtM,10071
22
- fastmcp/client/progress.py,sha256=WjLLDbUKMsx8DK-fqO7AGsXb83ak-6BMrLvzzznGmcI,1043
23
- fastmcp/client/roots.py,sha256=IxI_bHwHTmg6c2H-s1av1ZgrRnNDieHtYwdGFbzXT5c,2471
24
- fastmcp/client/sampling.py,sha256=Q8PzYCERa1W3xGGI9I9QOhhDM-M4i3P5lESb0cp2iI8,1595
25
- fastmcp/client/transports.py,sha256=AIQ0ni3lI0MoewgPNlkLHvym1iEnc8vCa513lHKCIqA,33803
26
- fastmcp/client/auth/__init__.py,sha256=4DNsfp4iaQeBcpds0JDdMn6Mmfud44stWLsret0sVKY,91
27
- fastmcp/client/auth/bearer.py,sha256=MFEFqcH6u_V86msYiOsEFKN5ks1V9BnBNiPsPLHUTqo,399
28
- fastmcp/client/auth/oauth.py,sha256=pSyuI0FlRK1qkBA6mvq-bxKzl2B-pMCvPPzIByTJBEo,11745
29
- fastmcp/contrib/README.md,sha256=rKknYSI1T192UvSszqwwDlQ2eYQpxywrNTLoj177SYU,878
30
- fastmcp/contrib/bulk_tool_caller/README.md,sha256=5aUUY1TSFKtz1pvTLSDqkUCkGkuqMfMZNsLeaNqEgAc,1960
31
- fastmcp/contrib/bulk_tool_caller/__init__.py,sha256=xvGSSaUXTQrc31erBoi1Gh7BikgOliETDiYVTP3rLxY,75
32
- fastmcp/contrib/bulk_tool_caller/bulk_tool_caller.py,sha256=2NcrGS59qvHo1lfbRaT8NSWfCxN66knciLxFvnGwCLY,4165
33
- fastmcp/contrib/bulk_tool_caller/example.py,sha256=6og_8pCJN_CabworC5R82zPAwwwM-W7HNJLQQSnS3lU,319
34
- fastmcp/contrib/component_manager/README.md,sha256=sTan1D51jzkPNnCQTxwd5JXGzWVy4DtkUjrUfNH3-F0,4457
35
- fastmcp/contrib/component_manager/__init__.py,sha256=4bppVrCOSEepKmBRwVWN-ndu5BYAz1Kv2Z8yhjEUmlo,164
36
- fastmcp/contrib/component_manager/component_manager.py,sha256=4R1FPVYjCr-j7Mn6OcbHH-psl9-JTdd1hgNZHasC52Y,6412
37
- fastmcp/contrib/component_manager/component_service.py,sha256=dLIOtXvMpCAu8CGlrqAWb9pX0AhVGqkC4j0uxv6XnXs,8759
38
- fastmcp/contrib/component_manager/example.py,sha256=AdFrUoN2jhtnF4JE4ywRg6O4oP8lZ3S64ds0mRTH3sg,1604
39
- fastmcp/contrib/mcp_mixin/README.md,sha256=X6rzt_4vC_rmq9jbHmrVPqYLGVVlw9b4TVL4H_0SMmQ,4277
40
- fastmcp/contrib/mcp_mixin/__init__.py,sha256=aw9IQ1ssNjCgws4ZNt8bkdpossAAGVAwwjBpMp9O5ZQ,153
41
- fastmcp/contrib/mcp_mixin/example.py,sha256=GnunkXmtG5hLLTUsM8aW5ZURU52Z8vI4tNLl-fK7Dg0,1228
42
- fastmcp/contrib/mcp_mixin/mcp_mixin.py,sha256=sUSJ2o0sTsb061MyPN2xuYP0oI4W6YVQXupY3nnjD50,8687
43
- fastmcp/prompts/__init__.py,sha256=An8uMBUh9Hrb7qqcn_5_Hent7IOeSh7EA2IUVsIrtHc,179
44
- fastmcp/prompts/prompt.py,sha256=Ux_FT8GTnejvjDWEgf5nSAIwbhV-9otgCJm-EqnzxvY,13861
45
- fastmcp/prompts/prompt_manager.py,sha256=Pt9cg_c9FR2EA0ITIHJT5Utihkd383JzhqhT-y2VnKo,7677
46
- fastmcp/resources/__init__.py,sha256=y1iAuqx-GIrS1NqIYzKezIDiYyjNEzzHD35epHpMnXE,463
47
- fastmcp/resources/resource.py,sha256=GGCUHUQe4ALrVJc-Ng1uz8-mtQSg_vuVA71H_qJkko0,6031
48
- fastmcp/resources/resource_manager.py,sha256=zjhso9ZP0EK_beTpUz_amqJ7XSABqU8mqPSk-JturOE,19777
49
- fastmcp/resources/template.py,sha256=mYsw3xPWRq1AgOVFkG_A1otY3NXYw5oUJnVzMC1Qy80,10346
50
- fastmcp/resources/types.py,sha256=SiYNLnpXT-mHgNUrzqKUvXYUsY-V3gwJIrYdJfFwDDo,4868
51
- fastmcp/server/__init__.py,sha256=bMD4aQD4yJqLz7-mudoNsyeV8UgQfRAg3PRwPvwTEds,119
52
- fastmcp/server/context.py,sha256=OFkdgT53NkN_VYwwHjdR2C_28CWtPsFln36X0QLM23g,20258
53
- fastmcp/server/dependencies.py,sha256=iKJdz1XsVJcrfHo_reXj9ZSldw-HeAwsp9S6lAgfGA8,2358
54
- fastmcp/server/elicitation.py,sha256=jZIHjV4NjhYbT-w8pBArwd0vNzP8OYwzmsnWDdk6Bd0,6136
55
- fastmcp/server/http.py,sha256=d0Jij4HVTaAohluRXArSniXLb1HcHP3ytbe-mMHg6nE,11678
56
- fastmcp/server/low_level.py,sha256=LNmc_nU_wx-fRG8OEHdLPKopZpovcrWlyAxJzKss3TA,1239
57
- fastmcp/server/openapi.py,sha256=LWT5rI8TN90MCppuo-LWkYM_ZVnxT6xtS-7Ny8sJIFI,41531
58
- fastmcp/server/proxy.py,sha256=3cABSJyOalxnqmHGaS8kb6jyaJEAXshQcOh8XihY7Kk,21936
59
- fastmcp/server/server.py,sha256=8ah5ZYgKLFT2sHzPRT3NUKBrQWi4nny_LPx6cN8EhQs,82816
60
- fastmcp/server/auth/__init__.py,sha256=doHCLwOIElvH1NrTdpeP9JKfnNf3MDYPSpQfdsQ-uI0,84
61
- fastmcp/server/auth/auth.py,sha256=A00OKxglEMrGMMIiMbc6UmpGc2VoWDkEVU5g2pIzDIg,2119
62
- fastmcp/server/auth/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
- fastmcp/server/auth/providers/bearer.py,sha256=rjwuKFgCm4fLsAQzUaIaE8OD6bml3sBaO7NYq3Wgs24,16718
64
- fastmcp/server/auth/providers/bearer_env.py,sha256=NYPCW363Q8u8BdiPPz1FdB3_kwmbCaWT5yKdAO-ZgwA,2081
65
- fastmcp/server/auth/providers/in_memory.py,sha256=Sb3GOtLL2bWbm8z-T8cEsMz1qcQUSHpPEEgYRvTOQi4,14251
66
- fastmcp/server/middleware/__init__.py,sha256=vh5C9ubN6q-y5QND32P4mQ4zDT89C7XYK39yqhELNAk,155
67
- fastmcp/server/middleware/error_handling.py,sha256=SoDatr9i3T2qSIUbSEGWrOnu4WPPyMDymnsF5GR_BiE,7572
68
- fastmcp/server/middleware/logging.py,sha256=UIAoafnKRGWpQa7OX5nzChep-9EhKdyTDBmmcRcEVdo,6239
69
- fastmcp/server/middleware/middleware.py,sha256=jFy7NmLHvGmrGkKViS1PvR_7oGM1EklxNx66EJtUzYU,6441
70
- fastmcp/server/middleware/rate_limiting.py,sha256=VTrCoQFmWCm0BxwOrNfG21CBFDDOKJT7IiSEjpJgmPA,7921
71
- fastmcp/server/middleware/timing.py,sha256=lL_xc-ErLD5lplfvd5-HIyWEbZhgNBYkcQ74KFXAMkA,5591
72
- fastmcp/tools/__init__.py,sha256=vzqb-Y7Kf0d5T0aOsld-O-FA8kD7-4uFExChewFHEzY,201
73
- fastmcp/tools/tool.py,sha256=fW-xZQCLN2qSZrlAo2eQ1aEFa-VN5jYEHx5H936-_50,17466
74
- fastmcp/tools/tool_manager.py,sha256=Sm_tOO-SY0m7tEN_dofP-tvBnC2HroPRKLU6sp8gnUw,7739
75
- fastmcp/tools/tool_transform.py,sha256=nGvxxKsyfp3gYl_nkYFHlnb8Fc4Jtw6t7WL291S4Vh4,32558
76
- fastmcp/utilities/__init__.py,sha256=-imJ8S-rXmbXMWeDamldP-dHDqAPg_wwmPVz-LNX14E,31
77
- fastmcp/utilities/cache.py,sha256=aV3oZ-ZhMgLSM9iAotlUlEy5jFvGXrVo0Y5Bj4PBtqY,707
78
- fastmcp/utilities/cli.py,sha256=TXuSyALFAGJwi7tWEBwBmaGhYZBdF1aG6dLgl3zjM1w,3272
79
- fastmcp/utilities/components.py,sha256=0eldO8mqG0o0sLlMK5heTOFaQdLzscn1Mup-AR-MnTA,3994
80
- fastmcp/utilities/exceptions.py,sha256=7Z9j5IzM5rT27BC1Mcn8tkS-bjqCYqMKwb2MMTaxJYU,1350
81
- fastmcp/utilities/http.py,sha256=1ns1ymBS-WSxbZjGP6JYjSO52Wa_ls4j4WbnXiupoa4,245
82
- fastmcp/utilities/inspect.py,sha256=XNA0dfYM5G-FVbJaVJO8loSUUCNypyLA-QjqTOneJyU,10833
83
- fastmcp/utilities/json_schema.py,sha256=8qyb3qOvk1gc3p63uP6LGyKdOANkNdD9YA32OiBxyNw,5495
84
- fastmcp/utilities/json_schema_type.py,sha256=Sml03nJGOnUfxCGrHWRMwZMultV0X5JThMepUnHIUiA,22377
85
- fastmcp/utilities/logging.py,sha256=1y7oNmy8WrR0NsfNVw1LPoKu92OFdmzIO65syOKi_BI,1388
86
- fastmcp/utilities/openapi.py,sha256=Fvn6M_deDdm3qHGMLXClpIi5ZBp9bM31lvZ9XSnQkH4,52047
87
- fastmcp/utilities/tests.py,sha256=kZH8HQAC702a5vNJb4K0tO1ll9CZADWQ_P-5ERWSvSA,4242
88
- fastmcp/utilities/types.py,sha256=c6HPvHCpkq8EXh0hWjaUlj9aCZklmxzAQHCXZy7llNo,10636
89
- fastmcp-2.10.5.dist-info/METADATA,sha256=T3PxSdKmyz51Fpby151d0mvdIQX-HZK0ns0aXlyIql0,17842
90
- fastmcp-2.10.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
91
- fastmcp-2.10.5.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
92
- fastmcp-2.10.5.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
93
- fastmcp-2.10.5.dist-info/RECORD,,