fastmcp 2.13.0rc1__py3-none-any.whl → 2.13.0rc2__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.
@@ -605,15 +605,8 @@ class OAuthProxy(OAuthProvider):
605
605
  self._redirect_path = (
606
606
  redirect_path if redirect_path.startswith("/") else f"/{redirect_path}"
607
607
  )
608
- # Redirect URI validation (consent flow provides primary protection)
609
- if allowed_client_redirect_uris is None:
610
- logger.info(
611
- "allowed_client_redirect_uris not specified; accepting all redirect URIs. "
612
- "Consent flow provides protection against confused deputy attacks. "
613
- "Configure allowed patterns for defense-in-depth."
614
- )
615
- self._allowed_client_redirect_uris = None
616
- elif (
608
+
609
+ if (
617
610
  isinstance(allowed_client_redirect_uris, list)
618
611
  and not allowed_client_redirect_uris
619
612
  ):
@@ -621,9 +614,7 @@ class OAuthProxy(OAuthProvider):
621
614
  "allowed_client_redirect_uris is empty list; no redirect URIs will be accepted. "
622
615
  "This will block all OAuth clients."
623
616
  )
624
- self._allowed_client_redirect_uris = []
625
- else:
626
- self._allowed_client_redirect_uris = allowed_client_redirect_uris
617
+ self._allowed_client_redirect_uris = allowed_client_redirect_uris
627
618
 
628
619
  # PKCE configuration
629
620
  self._forward_pkce = forward_pkce
@@ -776,7 +767,7 @@ class OAuthProxy(OAuthProvider):
776
767
  )
777
768
  logger.info(
778
769
  "Using ephemeral JWT signing key - tokens will NOT survive server restart. "
779
- "For production, provide explicit jwt_signing_key parameter."
770
+ "For production, provide explicit jwt_signing_key parameter and use persistent storage."
780
771
  )
781
772
 
782
773
  # Initialize JWT issuer
@@ -809,7 +800,7 @@ class OAuthProxy(OAuthProvider):
809
800
  encryption_key = base64.urlsafe_b64encode(key_material)
810
801
  logger.info(
811
802
  "Using ephemeral token encryption key - encrypted tokens will NOT survive server restart. "
812
- "For production, provide explicit token_encryption_key parameter."
803
+ "For production, provide explicit token_encryption_key parameter and use persistent storage."
813
804
  )
814
805
 
815
806
  self._token_encryption = TokenEncryption(encryption_key)
@@ -173,7 +173,7 @@ class Auth0Provider(OIDCProxy):
173
173
 
174
174
  super().__init__(**init_kwargs)
175
175
 
176
- logger.info(
176
+ logger.debug(
177
177
  "Initialized Auth0 OAuth provider for client %s with scopes: %s",
178
178
  settings.client_id,
179
179
  auth0_required_scopes,
@@ -217,7 +217,7 @@ class AWSCognitoProvider(OIDCProxy):
217
217
  client_storage=client_storage,
218
218
  )
219
219
 
220
- logger.info(
220
+ logger.debug(
221
221
  "Initialized AWS Cognito OAuth provider for client %s with scopes: %s",
222
222
  settings.client_id,
223
223
  required_scopes_final,
@@ -282,7 +282,7 @@ class GitHubProvider(OAuthProxy):
282
282
  client_storage=client_storage,
283
283
  )
284
284
 
285
- logger.info(
285
+ logger.debug(
286
286
  "Initialized GitHub OAuth provider for client %s with scopes: %s",
287
287
  settings.client_id,
288
288
  required_scopes_final,
@@ -79,7 +79,7 @@ class GoogleTokenVerifier(TokenVerifier):
79
79
  """Initialize the Google token verifier.
80
80
 
81
81
  Args:
82
- required_scopes: Required OAuth scopes (e.g., ['openid', 'email'])
82
+ required_scopes: Required OAuth scopes (e.g., ['openid', 'https://www.googleapis.com/auth/userinfo.email'])
83
83
  timeout_seconds: HTTP request timeout
84
84
  """
85
85
  super().__init__(required_scopes=required_scopes)
@@ -301,7 +301,7 @@ class GoogleProvider(OAuthProxy):
301
301
  client_storage=client_storage,
302
302
  )
303
303
 
304
- logger.info(
304
+ logger.debug(
305
305
  "Initialized Google OAuth provider for client %s with scopes: %s",
306
306
  settings.client_id,
307
307
  required_scopes_final,
@@ -258,7 +258,7 @@ class WorkOSProvider(OAuthProxy):
258
258
  client_storage=client_storage,
259
259
  )
260
260
 
261
- logger.info(
261
+ logger.debug(
262
262
  "Initialized WorkOS OAuth provider for client %s with AuthKit domain %s",
263
263
  settings.client_id,
264
264
  authkit_domain_final,
fastmcp/server/http.py CHANGED
@@ -9,7 +9,9 @@ from mcp.server.auth.middleware.bearer_auth import RequireAuthMiddleware
9
9
  from mcp.server.auth.routes import build_resource_metadata_url
10
10
  from mcp.server.lowlevel.server import LifespanResultT
11
11
  from mcp.server.sse import SseServerTransport
12
- from mcp.server.streamable_http import EventStore
12
+ from mcp.server.streamable_http import (
13
+ EventStore,
14
+ )
13
15
  from mcp.server.streamable_http_manager import StreamableHTTPSessionManager
14
16
  from starlette.applications import Starlette
15
17
  from starlette.middleware import Middleware
@@ -179,7 +181,7 @@ def create_sse_app(
179
181
  build_resource_metadata_url(resource_url) if resource_url else None
180
182
  )
181
183
 
182
- # Create protected SSE endpoint route with GET method only
184
+ # Create protected SSE endpoint route
183
185
  server_routes.append(
184
186
  Route(
185
187
  sse_path,
@@ -316,6 +318,7 @@ def create_streamable_http_app(
316
318
  auth.required_scopes,
317
319
  resource_metadata_url,
318
320
  ),
321
+ methods=["GET", "POST", "DELETE"],
319
322
  )
320
323
  )
321
324
  else:
fastmcp/utilities/cli.py CHANGED
@@ -2,7 +2,6 @@ from __future__ import annotations
2
2
 
3
3
  import json
4
4
  import os
5
- from importlib.metadata import version
6
5
  from pathlib import Path
7
6
  from typing import TYPE_CHECKING, Any, Literal
8
7
 
@@ -138,7 +137,7 @@ def load_and_merge_config(
138
137
  return new_config, resolved_spec
139
138
 
140
139
 
141
- LOGO_ASCII = r"""
140
+ LOGO_ASCII_1 = r"""
142
141
  _ __ ___ _____ __ __ _____________ ____ ____
143
142
  _ __ ___ .'____/___ ______/ /_/ |/ / ____/ __ \ |___ \ / __ \
144
143
  _ __ ___ / /_ / __ `/ ___/ __/ /|_/ / / / /_/ / ___/ / / / / /
@@ -147,6 +146,26 @@ _ __ ___ /_/ \____/____/\__/_/ /_/\____/_/ /_____(*)____/
147
146
 
148
147
  """.lstrip("\n")
149
148
 
149
+ # This prints the below in a blue gradient
150
+ # █▀▀ ▄▀█ █▀▀ ▀█▀ █▀▄▀█ █▀▀ █▀█
151
+ # █▀ █▀█ ▄▄█ █ █ ▀ █ █▄▄ █▀▀
152
+ LOGO_ASCII_2 = (
153
+ "\033[38;2;0;198;255m \033[38;2;0;195;255m█\033[38;2;0;192;255m▀\033[38;2;0;189;255m▀\033[38;2;0;186;255m "
154
+ "\033[38;2;0;184;255m▄\033[38;2;0;181;255m▀\033[38;2;0;178;255m█\033[38;2;0;175;255m "
155
+ "\033[38;2;0;172;255m█\033[38;2;0;169;255m▀\033[38;2;0;166;255m▀\033[38;2;0;163;255m "
156
+ "\033[38;2;0;160;255m▀\033[38;2;0;157;255m█\033[38;2;0;155;255m▀\033[38;2;0;152;255m "
157
+ "\033[38;2;0;149;255m█\033[38;2;0;146;255m▀\033[38;2;0;143;255m▄\033[38;2;0;140;255m▀\033[38;2;0;137;255m█\033[38;2;0;134;255m "
158
+ "\033[38;2;0;131;255m█\033[38;2;0;128;255m▀\033[38;2;0;126;255m▀\033[38;2;0;123;255m "
159
+ "\033[38;2;0;120;255m█\033[38;2;0;117;255m▀\033[38;2;0;114;255m█\033[39m\n"
160
+ "\033[38;2;0;198;255m \033[38;2;0;195;255m█\033[38;2;0;192;255m▀\033[38;2;0;189;255m \033[38;2;0;186;255m "
161
+ "\033[38;2;0;184;255m█\033[38;2;0;181;255m▀\033[38;2;0;178;255m█\033[38;2;0;175;255m "
162
+ "\033[38;2;0;172;255m▄\033[38;2;0;169;255m▄\033[38;2;0;166;255m█\033[38;2;0;163;255m "
163
+ "\033[38;2;0;160;255m \033[38;2;0;157;255m█\033[38;2;0;155;255m \033[38;2;0;152;255m "
164
+ "\033[38;2;0;149;255m█\033[38;2;0;146;255m \033[38;2;0;143;255m▀\033[38;2;0;140;255m \033[38;2;0;137;255m█\033[38;2;0;134;255m "
165
+ "\033[38;2;0;131;255m█\033[38;2;0;128;255m▄\033[38;2;0;126;255m▄\033[38;2;0;123;255m "
166
+ "\033[38;2;0;120;255m█\033[38;2;0;117;255m▀\033[38;2;0;114;255m▀\033[39m"
167
+ ).strip()
168
+
150
169
 
151
170
  def log_server_banner(
152
171
  server: FastMCP[Any],
@@ -167,10 +186,11 @@ def log_server_banner(
167
186
  """
168
187
 
169
188
  # Create the logo text
170
- logo_text = Text(LOGO_ASCII, style="bold green")
189
+ # Use Text with no_wrap and markup disabled to preserve ANSI escape codes
190
+ logo_text = Text.from_ansi(LOGO_ASCII_2, no_wrap=True)
171
191
 
172
192
  # Create the main title
173
- title_text = Text("FastMCP 2.0", style="bold blue")
193
+ title_text = Text(f"FastMCP {fastmcp.__version__}", style="bold blue")
174
194
 
175
195
  # Create the information table
176
196
  info_table = Table.grid(padding=(0, 1))
@@ -180,13 +200,13 @@ def log_server_banner(
180
200
 
181
201
  match transport:
182
202
  case "http" | "streamable-http":
183
- display_transport = "Streamable-HTTP"
203
+ display_transport = "HTTP"
184
204
  case "sse":
185
205
  display_transport = "SSE"
186
206
  case "stdio":
187
207
  display_transport = "STDIO"
188
208
 
189
- info_table.add_row("🖥", "Server name:", server.name)
209
+ info_table.add_row("🖥", "Server name:", Text(server.name + "\n", style="bold blue"))
190
210
  info_table.add_row("📦", "Transport:", display_transport)
191
211
 
192
212
  # Show connection info based on transport
@@ -197,27 +217,15 @@ def log_server_banner(
197
217
  server_url += f"/{path.lstrip('/')}"
198
218
  info_table.add_row("🔗", "Server URL:", server_url)
199
219
 
200
- # Add version information with explicit style overrides
201
- info_table.add_row("", "", "")
202
- info_table.add_row(
203
- "🏎",
204
- "FastMCP version:",
205
- Text(fastmcp.__version__, style="dim white", no_wrap=True),
206
- )
207
- info_table.add_row(
208
- "🤝",
209
- "MCP SDK version:",
210
- Text(version("mcp"), style="dim white", no_wrap=True),
211
- )
212
-
213
220
  # Add documentation link
214
221
  info_table.add_row("", "", "")
215
222
  info_table.add_row("📚", "Docs:", "https://gofastmcp.com")
216
- info_table.add_row("🚀", "Deploy:", "https://fastmcp.cloud")
223
+ info_table.add_row("🚀", "Hosting:", "https://fastmcp.cloud")
217
224
 
218
225
  # Create panel with logo, title, and information using Group
219
226
  panel_content = Group(
220
227
  Align.center(logo_text),
228
+ "",
221
229
  Align.center(title_text),
222
230
  "",
223
231
  "",
@@ -228,8 +236,10 @@ def log_server_banner(
228
236
  panel_content,
229
237
  border_style="dim",
230
238
  padding=(1, 4),
231
- expand=False,
239
+ # expand=False,
240
+ width=80, # Set max width for the panel
232
241
  )
233
242
 
234
243
  console = Console(stderr=True)
235
- console.print(Group("\n", panel, "\n"))
244
+ # Center the panel itself
245
+ console.print(Group("\n", Align.center(panel), "\n"))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastmcp
3
- Version: 2.13.0rc1
3
+ Version: 2.13.0rc2
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
@@ -69,7 +69,7 @@ fastmcp/server/__init__.py,sha256=bMD4aQD4yJqLz7-mudoNsyeV8UgQfRAg3PRwPvwTEds,11
69
69
  fastmcp/server/context.py,sha256=Yzo4H2n-RtObDTB9NkLeK73pMYUig553sFDwV3D6BIg,26128
70
70
  fastmcp/server/dependencies.py,sha256=so60cBZc4QuiKP2Y4ajR_NPkIF5d_b5wp8U3-ZfZMEQ,3888
71
71
  fastmcp/server/elicitation.py,sha256=gmP17CzLQVpGzU00Ks31TWxdS-OLL5wTX_W5xRzs1Cc,8777
72
- fastmcp/server/http.py,sha256=R-xFjA93v73veMWuSp38q03cu6Qs78XpeOVchXbgSJY,12028
72
+ fastmcp/server/http.py,sha256=23jme2iAbvwRQoERCkECdshwp1fnJqdBlhKRy4BKFT0,12067
73
73
  fastmcp/server/low_level.py,sha256=b1Sx0_Py0QxeLXSLdDA5PjR9Dd9ANB7KSNkkGSr1AeE,5490
74
74
  fastmcp/server/openapi.py,sha256=vm8A8Qy-jzXuxILJs-nPOJLwU2yB0YHDqVpz2HX-AqM,42198
75
75
  fastmcp/server/proxy.py,sha256=LoYoBEclvW_UJ6lLuckm2muzW_bOWHCc8oTxyzgTGsA,25769
@@ -77,23 +77,23 @@ fastmcp/server/server.py,sha256=H9XHioDShn4lDdC-pKydcISahlbGvdoZMSqZVaTzSDM,1086
77
77
  fastmcp/server/auth/__init__.py,sha256=GwoyosVxuWCPzFHaCnj6iFp9fulnp124G2gQfsnzcgc,695
78
78
  fastmcp/server/auth/auth.py,sha256=b6QM-CEErFoQJgQFzgHDZTOAN33zTLmxEjeE83Crrw8,13628
79
79
  fastmcp/server/auth/jwt_issuer.py,sha256=Ft1KdLrQn3UQT8bXmPd82OkxDEpqw7zr3TQr5vEIm5Y,8680
80
- fastmcp/server/auth/oauth_proxy.py,sha256=pMJzMK3bSGrx5ZDOzYLuQBUgOGaxMImi85wGxw0r1HM,84212
80
+ fastmcp/server/auth/oauth_proxy.py,sha256=CAM5GKOGlVzRMqqdi9oXtOJO2_UF4XNCxMXXGCm5gDo,83732
81
81
  fastmcp/server/auth/oidc_proxy.py,sha256=Cyqh4nqJ4KQBguDphYJfP9Q_NGqHsDq0dT5Mz-UTN4U,13283
82
82
  fastmcp/server/auth/redirect_validation.py,sha256=Jlhela9xpTbw4aWnQ04A5Z-TW0HYOC3f9BMsq3NXx1Q,2000
83
83
  fastmcp/server/auth/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
84
- fastmcp/server/auth/providers/auth0.py,sha256=u965WO09X7fMrqElrE0eATztGoBVtHshnb-fs2OF7r0,6671
85
- fastmcp/server/auth/providers/aws.py,sha256=B4G9qPKA8VVOQLRkP_31pEQezGM4zuced0-_UoS-6YA,9634
84
+ fastmcp/server/auth/providers/auth0.py,sha256=-KTTXIWuQE1juSUErhFKckEWO5qxZknRMCNmTV939w4,6672
85
+ fastmcp/server/auth/providers/aws.py,sha256=B75Y_7ZpgGVgXHV571bNHNz5B69bmEYNZ27ONOK5vsw,9635
86
86
  fastmcp/server/auth/providers/azure.py,sha256=38XZgBONhJzZaMW9RTrX6JPH6I_B2INhNeWAhVnmEkM,11660
87
87
  fastmcp/server/auth/providers/bearer.py,sha256=iu4pUj7TF5pT1wPuAGzDuM6lt5WtzenBN3c0otUleQY,923
88
88
  fastmcp/server/auth/providers/descope.py,sha256=mbqToTMLVR5-ZTUECv9jhVeT3TNjrXStL-D_zCE2Y1U,6348
89
- fastmcp/server/auth/providers/github.py,sha256=JKzxFnbBiy6bDMaF-CtUWx-d-KJYbG43D1qDI-lh6ew,11201
90
- fastmcp/server/auth/providers/google.py,sha256=SBHWnL_D7bhrFJUXEKy5dA_-S3zAZv4QcT5Y2LSbDfk,12375
89
+ fastmcp/server/auth/providers/github.py,sha256=HjRJRlse3haN6r5JGDXAe8vJv9yJiVN5FuyszFv5gD8,11202
90
+ fastmcp/server/auth/providers/google.py,sha256=Xh485rlpIWNvhoiKhvj3YoEDkhJEZ8cuNd_XRn7_ofc,12417
91
91
  fastmcp/server/auth/providers/in_memory.py,sha256=CFCfYWMIPUxHNF5Liqud6ksedbykKV-RILWZqTxh3MY,14245
92
92
  fastmcp/server/auth/providers/introspection.py,sha256=Izp8vEJG8Kyvu5Z-GWIvpKSeEZ2MYpw635MeqkPfb8w,10733
93
93
  fastmcp/server/auth/providers/jwt.py,sha256=KzbvPjOKIE6hDvfQ_BdjYMT2CrNcErNOGHF8DvmfQF4,19666
94
94
  fastmcp/server/auth/providers/scalekit.py,sha256=_CEdJ5S9eT24gnNlVYzRMhNAjrkoysVOAPDoyAz8Pxw,6628
95
95
  fastmcp/server/auth/providers/supabase.py,sha256=6fPSFGxOUdA4E9zCB9AqyZpZTDNF3yHF5M0lQRipYLc,6478
96
- fastmcp/server/auth/providers/workos.py,sha256=y1grEFmMWMTpS-p6QfE5y4XVrtQa1k1_I7kfew2qr4c,16019
96
+ fastmcp/server/auth/providers/workos.py,sha256=SLoftlPeKfquw9QnMsuhMdcw36iAYwSt9_4NKeSsvWw,16020
97
97
  fastmcp/server/middleware/__init__.py,sha256=vh5C9ubN6q-y5QND32P4mQ4zDT89C7XYK39yqhELNAk,155
98
98
  fastmcp/server/middleware/caching.py,sha256=L5cKT4_BrCvjQXIN4pMnrGNR3QAUXDpmk5h-Gl9qk6U,18279
99
99
  fastmcp/server/middleware/error_handling.py,sha256=4PGbF39Cpa-h-WXwxOhPLvEM9_iAJ8IKbMTPnXbEyd8,7736
@@ -108,7 +108,7 @@ fastmcp/tools/tool_manager.py,sha256=soE35w8QJPs1MX1PJ8DGTzOOLLCIhTLxS9mtHRD9HAs
108
108
  fastmcp/tools/tool_transform.py,sha256=De_E_adWwBdBcmULpRDroiPrdGEbC4fFwXqcKxRVTpU,38462
109
109
  fastmcp/utilities/__init__.py,sha256=-imJ8S-rXmbXMWeDamldP-dHDqAPg_wwmPVz-LNX14E,31
110
110
  fastmcp/utilities/auth.py,sha256=ZVHkNb4YBpLE1EmmFyhvFB2qfWDZdEYNH9TRI9jylOE,1140
111
- fastmcp/utilities/cli.py,sha256=UZ8bFvNQSxZ6Cmmo9ogQQ3MS7HBSp_p0vQcijxDEYRk,8656
111
+ fastmcp/utilities/cli.py,sha256=7MaWUZVXS-_e1efGDcM3u7vjmOlQ61ZoMfTdvcnz6Vc,10152
112
112
  fastmcp/utilities/components.py,sha256=lYB58QVm97szKjZ5kBs0aUKTQeIIEREte7WX5IHK5TU,5991
113
113
  fastmcp/utilities/exceptions.py,sha256=7Z9j5IzM5rT27BC1Mcn8tkS-bjqCYqMKwb2MMTaxJYU,1350
114
114
  fastmcp/utilities/http.py,sha256=1ns1ymBS-WSxbZjGP6JYjSO52Wa_ls4j4WbnXiupoa4,245
@@ -131,8 +131,8 @@ fastmcp/utilities/mcp_server_config/v1/environments/uv.py,sha256=DPVAXM5JDTN89wO
131
131
  fastmcp/utilities/mcp_server_config/v1/sources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
132
132
  fastmcp/utilities/mcp_server_config/v1/sources/base.py,sha256=KWunc5peDLFdSdLX8l3UI9SNxtN-KNq2FOXAZ7XD62c,980
133
133
  fastmcp/utilities/mcp_server_config/v1/sources/filesystem.py,sha256=eFX47XNXz2oKHW8MZvx60dqyHkBxdg2FMOrHcyAS28g,8106
134
- fastmcp-2.13.0rc1.dist-info/METADATA,sha256=DK6xv8A1JARU_raRaRq1qei-OYTyLgf6cvlCsGi1kJo,20050
135
- fastmcp-2.13.0rc1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
136
- fastmcp-2.13.0rc1.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
137
- fastmcp-2.13.0rc1.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
138
- fastmcp-2.13.0rc1.dist-info/RECORD,,
134
+ fastmcp-2.13.0rc2.dist-info/METADATA,sha256=VtwiJ_jggV4vS-rzVX59TKswvO1Lid7JSa0a_JNIe0Y,20050
135
+ fastmcp-2.13.0rc2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
136
+ fastmcp-2.13.0rc2.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
137
+ fastmcp-2.13.0rc2.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
138
+ fastmcp-2.13.0rc2.dist-info/RECORD,,