fastmcp 2.10.0__py3-none-any.whl → 2.10.1__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.
fastmcp/cli/cli.py CHANGED
@@ -64,7 +64,6 @@ def _build_uv_command(
64
64
  server_spec: str,
65
65
  with_editable: Path | None = None,
66
66
  with_packages: list[str] | None = None,
67
- no_banner: bool = False,
68
67
  ) -> list[str]:
69
68
  """Build the uv run command that runs a MCP server through mcp run."""
70
69
  cmd = ["uv"]
@@ -81,10 +80,6 @@ def _build_uv_command(
81
80
 
82
81
  # Add mcp run command
83
82
  cmd.extend(["fastmcp", "run", server_spec])
84
-
85
- if no_banner:
86
- cmd.append("--no-banner")
87
-
88
83
  return cmd
89
84
 
90
85
 
@@ -197,9 +192,7 @@ def dev(
197
192
  if inspector_version:
198
193
  inspector_cmd += f"@{inspector_version}"
199
194
 
200
- uv_cmd = _build_uv_command(
201
- server_spec, with_editable, with_packages, no_banner=True
202
- )
195
+ uv_cmd = _build_uv_command(server_spec, with_editable, with_packages)
203
196
 
204
197
  # Run the MCP Inspector command with shell=True on Windows
205
198
  shell = sys.platform == "win32"
@@ -268,13 +261,6 @@ def run(
268
261
  help="Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)",
269
262
  ),
270
263
  ] = None,
271
- no_banner: Annotated[
272
- bool,
273
- typer.Option(
274
- "--no-banner",
275
- help="Don't show the server banner",
276
- ),
277
- ] = False,
278
264
  ) -> None:
279
265
  """Run a MCP server or connect to a remote one.
280
266
 
@@ -311,7 +297,6 @@ def run(
311
297
  port=port,
312
298
  log_level=log_level,
313
299
  server_args=server_args,
314
- show_banner=not no_banner,
315
300
  )
316
301
  except Exception as e:
317
302
  logger.error(
fastmcp/cli/run.py CHANGED
@@ -169,7 +169,6 @@ def run_command(
169
169
  port: int | None = None,
170
170
  log_level: str | None = None,
171
171
  server_args: list[str] | None = None,
172
- show_banner: bool = True,
173
172
  ) -> None:
174
173
  """Run a MCP server or connect to a remote one.
175
174
 
@@ -202,9 +201,6 @@ def run_command(
202
201
  if log_level:
203
202
  kwargs["log_level"] = log_level
204
203
 
205
- if not show_banner:
206
- kwargs["show_banner"] = False
207
-
208
204
  try:
209
205
  server.run(**kwargs)
210
206
  except Exception as e:
fastmcp/server/server.py CHANGED
@@ -60,7 +60,6 @@ from fastmcp.settings import Settings
60
60
  from fastmcp.tools import ToolManager
61
61
  from fastmcp.tools.tool import FunctionTool, Tool, ToolResult
62
62
  from fastmcp.utilities.cache import TimedCache
63
- from fastmcp.utilities.cli import print_server_banner
64
63
  from fastmcp.utilities.components import FastMCPComponent
65
64
  from fastmcp.utilities.logging import get_logger
66
65
  from fastmcp.utilities.mcp_config import MCPConfig
@@ -286,7 +285,6 @@ class FastMCP(Generic[LifespanResultT]):
286
285
  async def run_async(
287
286
  self,
288
287
  transport: Transport | None = None,
289
- show_banner: bool = True,
290
288
  **transport_kwargs: Any,
291
289
  ) -> None:
292
290
  """Run the FastMCP server asynchronously.
@@ -300,23 +298,15 @@ class FastMCP(Generic[LifespanResultT]):
300
298
  raise ValueError(f"Unknown transport: {transport}")
301
299
 
302
300
  if transport == "stdio":
303
- await self.run_stdio_async(
304
- show_banner=show_banner,
305
- **transport_kwargs,
306
- )
301
+ await self.run_stdio_async(**transport_kwargs)
307
302
  elif transport in {"http", "sse", "streamable-http"}:
308
- await self.run_http_async(
309
- transport=transport,
310
- show_banner=show_banner,
311
- **transport_kwargs,
312
- )
303
+ await self.run_http_async(transport=transport, **transport_kwargs)
313
304
  else:
314
305
  raise ValueError(f"Unknown transport: {transport}")
315
306
 
316
307
  def run(
317
308
  self,
318
309
  transport: Transport | None = None,
319
- show_banner: bool = True,
320
310
  **transport_kwargs: Any,
321
311
  ) -> None:
322
312
  """Run the FastMCP server. Note this is a synchronous function.
@@ -325,14 +315,7 @@ class FastMCP(Generic[LifespanResultT]):
325
315
  transport: Transport protocol to use ("stdio", "sse", or "streamable-http")
326
316
  """
327
317
 
328
- anyio.run(
329
- partial(
330
- self.run_async,
331
- transport,
332
- show_banner=show_banner,
333
- **transport_kwargs,
334
- )
335
- )
318
+ anyio.run(partial(self.run_async, transport, **transport_kwargs))
336
319
 
337
320
  def _setup_handlers(self) -> None:
338
321
  """Set up core MCP protocol handlers."""
@@ -1338,16 +1321,8 @@ class FastMCP(Generic[LifespanResultT]):
1338
1321
  enabled=enabled,
1339
1322
  )
1340
1323
 
1341
- async def run_stdio_async(self, show_banner: bool = True) -> None:
1324
+ async def run_stdio_async(self) -> None:
1342
1325
  """Run the server using stdio transport."""
1343
-
1344
- # Display server banner
1345
- if show_banner:
1346
- print_server_banner(
1347
- server=self,
1348
- transport="stdio",
1349
- )
1350
-
1351
1326
  async with stdio_server() as (read_stream, write_stream):
1352
1327
  logger.info(f"Starting MCP server {self.name!r} with transport 'stdio'")
1353
1328
  await self._mcp_server.run(
@@ -1360,7 +1335,6 @@ class FastMCP(Generic[LifespanResultT]):
1360
1335
 
1361
1336
  async def run_http_async(
1362
1337
  self,
1363
- show_banner: bool = True,
1364
1338
  transport: Literal["http", "streamable-http", "sse"] = "http",
1365
1339
  host: str | None = None,
1366
1340
  port: int | None = None,
@@ -1379,7 +1353,6 @@ class FastMCP(Generic[LifespanResultT]):
1379
1353
  path: Path for the endpoint (defaults to settings.streamable_http_path or settings.sse_path)
1380
1354
  uvicorn_config: Additional configuration for the Uvicorn server
1381
1355
  """
1382
-
1383
1356
  host = host or self._deprecated_settings.host
1384
1357
  port = port or self._deprecated_settings.port
1385
1358
  default_log_level_to_use = (
@@ -1388,23 +1361,6 @@ class FastMCP(Generic[LifespanResultT]):
1388
1361
 
1389
1362
  app = self.http_app(path=path, transport=transport, middleware=middleware)
1390
1363
 
1391
- # Get the path for the server URL
1392
- server_path = (
1393
- app.state.path.lstrip("/")
1394
- if hasattr(app, "state") and hasattr(app.state, "path")
1395
- else path or ""
1396
- )
1397
-
1398
- # Display server banner
1399
- if show_banner:
1400
- print_server_banner(
1401
- server=self,
1402
- transport=transport,
1403
- host=host,
1404
- port=port,
1405
- path=server_path,
1406
- )
1407
-
1408
1364
  _uvicorn_config_from_user = uvicorn_config or {}
1409
1365
 
1410
1366
  config_kwargs: dict[str, Any] = {
@@ -1422,7 +1378,6 @@ class FastMCP(Generic[LifespanResultT]):
1422
1378
  logger.info(
1423
1379
  f"Starting MCP server {self.name!r} with transport {transport!r} on http://{host}:{port}/{path}"
1424
1380
  )
1425
-
1426
1381
  await server.serve()
1427
1382
 
1428
1383
  async def run_sse_async(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastmcp
3
- Version: 2.10.0
3
+ Version: 2.10.1
4
4
  Summary: The fast, Pythonic way to build MCP servers.
5
5
  Project-URL: Homepage, https://gofastmcp.com
6
6
  Project-URL: Repository, https://github.com/jlowin/fastmcp
@@ -4,8 +4,8 @@ fastmcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  fastmcp/settings.py,sha256=yC3f0ITEWYeit37-wnF0G12klTw_hjrWjCr6oZtUT8o,8329
5
5
  fastmcp/cli/__init__.py,sha256=Ii284TNoG5lxTP40ETMGhHEq3lQZWxu9m9JuU57kUpQ,87
6
6
  fastmcp/cli/claude.py,sha256=IAlcZ4qZKBBj09jZUMEx7EANZE_IR3vcu7zOBJmMOuU,4567
7
- fastmcp/cli/cli.py,sha256=uJqUvFuyN7uslaCe5FHKp-EKdIRY5mRr-81f0c1r4PA,16257
8
- fastmcp/cli/run.py,sha256=JKBcy935Jy59WInwEaKt1gZkRDIESB7CRw_Oj987PVw,6301
7
+ fastmcp/cli/cli.py,sha256=598s1S-KdqIB85mwqvXJaBVen6xYY65ek4v-q3lmY4k,15933
8
+ fastmcp/cli/run.py,sha256=Pw3vH5wKRHfbmHRn0saIbC4l450KPOzeQbzPFqG4AbY,6208
9
9
  fastmcp/client/__init__.py,sha256=kd2hhSuD8rZuF87c9zlPJP_icJ-Rx3exyNoK0EzfOtE,617
10
10
  fastmcp/client/client.py,sha256=8Sx7NxnnF5IMv9E-J0MXjTI_TfhlM3j0mD1Rh-LXQJI,29213
11
11
  fastmcp/client/elicitation.py,sha256=8eWZpXbRFctZGgulyJ_GGI4GYXqAFf5Zp47vYTRD4fc,2155
@@ -49,7 +49,7 @@ fastmcp/server/http.py,sha256=d0Jij4HVTaAohluRXArSniXLb1HcHP3ytbe-mMHg6nE,11678
49
49
  fastmcp/server/low_level.py,sha256=LNmc_nU_wx-fRG8OEHdLPKopZpovcrWlyAxJzKss3TA,1239
50
50
  fastmcp/server/openapi.py,sha256=ALIbl0r2T1cvbSeFwz6HpIzut2akdngAtKDdWGyIWHs,36221
51
51
  fastmcp/server/proxy.py,sha256=Ofx7P5rU7mKVPDjvvIKjQS7_C1w4-1UiKc78x7AdjN8,15211
52
- fastmcp/server/server.py,sha256=gfC3xvX6tnT57uRClvY2L0q1DndKoOlJZJRRQ372Cis,80812
52
+ fastmcp/server/server.py,sha256=XKt0vGwQNopBnYvciJtbJ_FVDt1uuwwuxrAcrVBJGa8,79703
53
53
  fastmcp/server/auth/__init__.py,sha256=doHCLwOIElvH1NrTdpeP9JKfnNf3MDYPSpQfdsQ-uI0,84
54
54
  fastmcp/server/auth/auth.py,sha256=A00OKxglEMrGMMIiMbc6UmpGc2VoWDkEVU5g2pIzDIg,2119
55
55
  fastmcp/server/auth/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -68,7 +68,6 @@ fastmcp/tools/tool_manager.py,sha256=Sm_tOO-SY0m7tEN_dofP-tvBnC2HroPRKLU6sp8gnUw
68
68
  fastmcp/tools/tool_transform.py,sha256=YY2DZdJZ6fEGtgEP1Djrc49F8rAEyx6fgRGEyIGaxPE,32601
69
69
  fastmcp/utilities/__init__.py,sha256=-imJ8S-rXmbXMWeDamldP-dHDqAPg_wwmPVz-LNX14E,31
70
70
  fastmcp/utilities/cache.py,sha256=aV3oZ-ZhMgLSM9iAotlUlEy5jFvGXrVo0Y5Bj4PBtqY,707
71
- fastmcp/utilities/cli.py,sha256=xLB7GSLpO7m7PZJCSFRvYg7aoe5FcqG1AxOizKTU-dY,3150
72
71
  fastmcp/utilities/components.py,sha256=WIxNVZ7YxCLpdIm_pbTYeP0lAxikvgptVYhIL0LVmCc,2535
73
72
  fastmcp/utilities/exceptions.py,sha256=7Z9j5IzM5rT27BC1Mcn8tkS-bjqCYqMKwb2MMTaxJYU,1350
74
73
  fastmcp/utilities/http.py,sha256=1ns1ymBS-WSxbZjGP6JYjSO52Wa_ls4j4WbnXiupoa4,245
@@ -80,8 +79,8 @@ fastmcp/utilities/mcp_config.py,sha256=ryjAfJUPquDSoKdSymPH4M2B0WvuM3pWUGI3cOgAX
80
79
  fastmcp/utilities/openapi.py,sha256=neeaXwwn1OWdUp0Gawhx4SJHLfV78gXU5OMMTFGeD24,45235
81
80
  fastmcp/utilities/tests.py,sha256=O9hRSjnyaYQqu1RJ-CFBw1cIjezlwSQtS-Ea_iqO4sY,3899
82
81
  fastmcp/utilities/types.py,sha256=SWtzKpIr9TMeOE6TyPgqSi-SBXpWBPUnA5QPiP4nDzw,10512
83
- fastmcp-2.10.0.dist-info/METADATA,sha256=KFUQ_3rSB_OfFyRM5neIk1NQVFtgSeIwsm7m67hfG-0,17796
84
- fastmcp-2.10.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
85
- fastmcp-2.10.0.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
86
- fastmcp-2.10.0.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
87
- fastmcp-2.10.0.dist-info/RECORD,,
82
+ fastmcp-2.10.1.dist-info/METADATA,sha256=I0_44sR-kc7BcTHdA1mLy4f9zASLk6hCiOWjrcxBfk8,17796
83
+ fastmcp-2.10.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
+ fastmcp-2.10.1.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
85
+ fastmcp-2.10.1.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
86
+ fastmcp-2.10.1.dist-info/RECORD,,
fastmcp/utilities/cli.py DELETED
@@ -1,106 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from importlib.metadata import version
4
- from typing import TYPE_CHECKING, Any
5
-
6
- from rich.console import Console, Group
7
- from rich.panel import Panel
8
- from rich.table import Table
9
- from rich.text import Text
10
-
11
- import fastmcp
12
-
13
- if TYPE_CHECKING:
14
- from typing import Literal
15
-
16
- from fastmcp import FastMCP
17
-
18
- LOGO_ASCII = r"""
19
- _ __ ___ ______ __ __ _____________ ____ ____
20
- _ __ ___ / ____/___ ______/ /_/ |/ / ____/ __ \ |___ \ / __ \
21
- _ __ ___ / /_ / __ `/ ___/ __/ /|_/ / / / /_/ / ___/ / / / / /
22
- _ __ ___ / __/ / /_/ (__ ) /_/ / / / /___/ ____/ / __/_/ /_/ /
23
- _ __ ___ /_/ \__,_/____/\__/_/ /_/\____/_/ /_____(_)____/
24
-
25
- """.lstrip("\n")
26
-
27
-
28
- def print_server_banner(
29
- server: FastMCP[Any],
30
- transport: Literal["stdio", "http", "sse", "streamable-http"],
31
- *,
32
- host: str | None = None,
33
- port: int | None = None,
34
- path: str | None = None,
35
- ) -> None:
36
- """Print a formatted banner with server information and logo.
37
-
38
- Args:
39
- transport: The transport protocol being used
40
- server_name: Optional server name to display
41
- host: Host address (for HTTP transports)
42
- port: Port number (for HTTP transports)
43
- path: Server path (for HTTP transports)
44
- """
45
-
46
- console = Console()
47
-
48
- # Create the logo text
49
- logo_text = Text(LOGO_ASCII, style="bold green")
50
-
51
- # Create the information table
52
- info_table = Table.grid(padding=(0, 1))
53
- info_table.add_column(style="bold cyan", justify="left")
54
- info_table.add_column(style="white", justify="left")
55
-
56
- match transport:
57
- case "http" | "streamable-http":
58
- display_transport = "Streamable-HTTP"
59
- case "sse":
60
- display_transport = "SSE"
61
- case "stdio":
62
- display_transport = "STDIO"
63
-
64
- info_table.add_row("Transport:", display_transport)
65
-
66
- # Show connection info based on transport
67
- if transport in ("http", "streamable-http", "sse"):
68
- if host and port:
69
- server_url = f"http://{host}:{port}"
70
- if path:
71
- server_url += f"/{path.lstrip('/')}"
72
- info_table.add_row("Server URL:", server_url)
73
-
74
- # Add documentation link
75
- info_table.add_row()
76
- info_table.add_row("Docs:", "https://gofastmcp.com")
77
- info_table.add_row("Hosting:", "https://fastmcp.cloud")
78
-
79
- # Add version information with explicit style overrides
80
- info_table.add_row()
81
- info_table.add_row(
82
- "FastMCP version:",
83
- Text(fastmcp.__version__, style="dim white", no_wrap=True),
84
- )
85
- info_table.add_row(
86
- "MCP version:",
87
- Text(version("mcp"), style="dim white", no_wrap=True),
88
- )
89
- # Create panel with logo and information using Group
90
- panel_content = Group(logo_text, "", info_table)
91
-
92
- # Use server name in title if provided
93
- title = "FastMCP 2.0"
94
- if server.name != "FastMCP":
95
- title += f" - {server.name}"
96
-
97
- panel = Panel(
98
- panel_content,
99
- title=title,
100
- title_align="left",
101
- border_style="dim",
102
- padding=(2, 10),
103
- expand=False,
104
- )
105
-
106
- console.print(panel)