fastmcp 2.3.5__py3-none-any.whl → 2.4.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.
@@ -71,7 +71,7 @@ def _run_server(mcp_server: FastMCP, transport: Literal["sse"], port: int) -> No
71
71
 
72
72
  @contextmanager
73
73
  def run_server_in_process(
74
- server_fn: Callable[[str, int], None], *args
74
+ server_fn: Callable[..., None], *args
75
75
  ) -> Generator[str, None, None]:
76
76
  """
77
77
  Context manager that runs a Starlette app in a separate process and returns the
@@ -109,7 +109,11 @@ def run_server_in_process(
109
109
 
110
110
  yield f"http://{host}:{port}"
111
111
 
112
- proc.kill()
113
- proc.join(timeout=2)
112
+ proc.terminate()
113
+ proc.join(timeout=5)
114
114
  if proc.is_alive():
115
- raise RuntimeError("Server process failed to terminate")
115
+ # If it's still alive, then force kill it
116
+ proc.kill()
117
+ proc.join(timeout=2)
118
+ if proc.is_alive():
119
+ raise RuntimeError("Server process failed to terminate even after kill")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastmcp
3
- Version: 2.3.5
3
+ Version: 2.4.0
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
@@ -282,6 +282,29 @@ async def main():
282
282
  # ... use the client
283
283
  ```
284
284
 
285
+ FastMCP also supports connecting to multiple servers through a single unified client using the standard MCP configuration format:
286
+
287
+ ```python
288
+ from fastmcp import Client
289
+
290
+ # Standard MCP configuration with multiple servers
291
+ config = {
292
+ "mcpServers": {
293
+ "weather": {"url": "https://weather-api.example.com/mcp"},
294
+ "assistant": {"command": "python", "args": ["./assistant_server.py"]}
295
+ }
296
+ }
297
+
298
+ # Create a client that connects to all servers
299
+ client = Client(config)
300
+
301
+ async def main():
302
+ async with client:
303
+ # Access tools and resources with server prefixes
304
+ forecast = await client.call_tool("weather_get_forecast", {"city": "London"})
305
+ answer = await client.call_tool("assistant_answer_question", {"query": "What is MCP?"})
306
+ ```
307
+
285
308
  Learn more in the [**Client Documentation**](https://gofastmcp.com/clients/client) and [**Transports Documentation**](https://gofastmcp.com/clients/transports).
286
309
 
287
310
  ## Advanced Features
@@ -1,19 +1,19 @@
1
1
  fastmcp/__init__.py,sha256=yTAqLZORsPqbr7AE0ayw6zIYBeMlxQlI-3HE2WqbvHk,435
2
2
  fastmcp/exceptions.py,sha256=YvaKqOT3w0boXF9ylIoaSIzW9XiQ1qLFG1LZq6B60H8,680
3
3
  fastmcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- fastmcp/settings.py,sha256=Slo7sRSbXblgmTQcRSee6ns6CsW2yW-TvBY--kAhJqg,3856
4
+ fastmcp/settings.py,sha256=fOiB_zFZqqVxp3hlTTsndnlUZV3fmQUcqrSRtC4Zr9Q,4371
5
5
  fastmcp/cli/__init__.py,sha256=Ii284TNoG5lxTP40ETMGhHEq3lQZWxu9m9JuU57kUpQ,87
6
6
  fastmcp/cli/claude.py,sha256=IAlcZ4qZKBBj09jZUMEx7EANZE_IR3vcu7zOBJmMOuU,4567
7
7
  fastmcp/cli/cli.py,sha256=eRZ4tpne7dj_rhjREwiNRN5i9A1T8-ptxg1lYaHfS5o,12401
8
8
  fastmcp/cli/run.py,sha256=o7Ge6JZKXYwlY2vYdMNoVX8agBchAaeU_73iPndojIM,5351
9
9
  fastmcp/client/__init__.py,sha256=Ri8GFHolIKOZnXaMzIc3VpkLcEqAmOoYGCKgmSk6NnE,550
10
10
  fastmcp/client/base.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- fastmcp/client/client.py,sha256=qUbL3sbZOzSOTyKo7inKX6XbZaZQtEYBR8e7pHfBdhQ,19675
12
- fastmcp/client/logging.py,sha256=GbI2_BIQgITR1YmqDzHnEJ4s3vFu_oe4Mva22N0RXO4,542
11
+ fastmcp/client/client.py,sha256=Pvy1Wkdo4lRqKppvWL9LW7OYL2tEBdPF1v8TPzYTcYQ,20080
12
+ fastmcp/client/logging.py,sha256=hOPRailZUp89RUck6V4HPaWVZinVrNY8HD4hD0dd-fE,822
13
13
  fastmcp/client/progress.py,sha256=WjLLDbUKMsx8DK-fqO7AGsXb83ak-6BMrLvzzznGmcI,1043
14
14
  fastmcp/client/roots.py,sha256=IxI_bHwHTmg6c2H-s1av1ZgrRnNDieHtYwdGFbzXT5c,2471
15
15
  fastmcp/client/sampling.py,sha256=UlDHxnd6k_HoU8RA3ob0g8-e6haJBc9u27N_v291QoI,1698
16
- fastmcp/client/transports.py,sha256=w2ELDN9UO3c1yC3Vuzq0WI9syLUc20u389-XMwUoX5Y,19320
16
+ fastmcp/client/transports.py,sha256=0GTu_W9vnT5_JPQ49gmUZsRKOP19RzCKUSiIE0F4Pek,23031
17
17
  fastmcp/contrib/README.md,sha256=rKknYSI1T192UvSszqwwDlQ2eYQpxywrNTLoj177SYU,878
18
18
  fastmcp/contrib/bulk_tool_caller/README.md,sha256=5aUUY1TSFKtz1pvTLSDqkUCkGkuqMfMZNsLeaNqEgAc,1960
19
19
  fastmcp/contrib/bulk_tool_caller/__init__.py,sha256=xvGSSaUXTQrc31erBoi1Gh7BikgOliETDiYVTP3rLxY,75
@@ -36,10 +36,10 @@ fastmcp/resources/types.py,sha256=5fUFvzRlekNjtfihtq8S-fT0alKoNfclzrugqeM5JRE,63
36
36
  fastmcp/server/__init__.py,sha256=bMD4aQD4yJqLz7-mudoNsyeV8UgQfRAg3PRwPvwTEds,119
37
37
  fastmcp/server/context.py,sha256=obOTozUq6xwe2oNn6VQ6F4mwWGEonF5A0emi7jo1J8k,8231
38
38
  fastmcp/server/dependencies.py,sha256=1utkxFsV37HZcWBwI69JyngVN2ppGO_PEgxUlUHHy_Q,742
39
- fastmcp/server/http.py,sha256=q0oATZ7TBN11DqFT_AoyH5gvgAvz4COXDlf73t3rcb4,11317
40
- fastmcp/server/openapi.py,sha256=_7U0XtPk4wCkGOBfYx3J3ujA9iqQtnsc0scA4sCsIT0,24170
39
+ fastmcp/server/http.py,sha256=2CpCt4rsck4rxEd5w8ITEWAhRxTdDjuItVb-BPXCXTE,12693
40
+ fastmcp/server/openapi.py,sha256=SrX0sxGdu6Ld8X81MKEdi6UgvWdHZQJateDlPWE6mQg,29978
41
41
  fastmcp/server/proxy.py,sha256=mt3eM6TQWfnZD5XehmTXisskZ4CBbsWyjRPjprlTjBY,9653
42
- fastmcp/server/server.py,sha256=LM5zb6as2DT_lFY1tB4b89rNAbyv-tQiU2xNeDC8f4E,46933
42
+ fastmcp/server/server.py,sha256=cRms1-r0mN6qVSIjRzHkjt7MIMBiOer61VYmtIgHORc,54686
43
43
  fastmcp/tools/__init__.py,sha256=ocw-SFTtN6vQ8fgnlF8iNAOflRmh79xS1xdO0Bc3QPE,96
44
44
  fastmcp/tools/tool.py,sha256=k7awnrPoId_1XJHFce7X3mAEgBsJyr2v5kuuxXrE5Ww,7602
45
45
  fastmcp/tools/tool_manager.py,sha256=v4Ur-JXDPXUxHqHJxA52IIcZfSiCBOnoFFLOmmJR1A8,4157
@@ -49,11 +49,12 @@ fastmcp/utilities/decorators.py,sha256=AjhjsetQZF4YOPV5MTZmIxO21iFp_4fDIS3O2_KNC
49
49
  fastmcp/utilities/exceptions.py,sha256=Aax9K0larjzrrgJBS6o_PQwoIrvBvVwck2suZvgafXE,1359
50
50
  fastmcp/utilities/json_schema.py,sha256=m65XU9lPq7pCxJ9vvCeGRl0HOFr6ArezvYpMBR6-gAg,3777
51
51
  fastmcp/utilities/logging.py,sha256=n4P7P-aFDCuUFz8O-ykzUOj2sXl789HtWI_pX3ynGaY,1234
52
- fastmcp/utilities/openapi.py,sha256=V3hANT6KcD_Bloq9uHDVkVJRcGaZIq8GH5ZZ7bKVmXY,56943
53
- fastmcp/utilities/tests.py,sha256=mAV2EjDeCbm9V9NsVIUjcmzf93MgDjfj8kMvHpf4vgo,3224
52
+ fastmcp/utilities/mcp_config.py,sha256=fZKlZt45CTyVShvHP5xId_anhLSsUesXi802GuZY6Jo,2127
53
+ fastmcp/utilities/openapi.py,sha256=QQos4vP59HQ8vPDTKftWOIVv_zmW30mNxYSXVU7JUbY,38441
54
+ fastmcp/utilities/tests.py,sha256=teyHcl3j7WGfYJ6m42VuQYB_IVpGvPdFqIpC-UxsN78,3369
54
55
  fastmcp/utilities/types.py,sha256=6CcqAQ1QqCO2HGSFlPS6FO5JRWnacjCcO2-EhyEnZV0,4400
55
- fastmcp-2.3.5.dist-info/METADATA,sha256=G6eYJAsY7YIpIq6EOmjP1bihF3evF9Tb5wy9ZncSxRg,15751
56
- fastmcp-2.3.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
57
- fastmcp-2.3.5.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
58
- fastmcp-2.3.5.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
59
- fastmcp-2.3.5.dist-info/RECORD,,
56
+ fastmcp-2.4.0.dist-info/METADATA,sha256=BV9xX1Z3gYYdUJDfpjtZMH8nS_4DdpFM7yShwiGSDJs,16514
57
+ fastmcp-2.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
58
+ fastmcp-2.4.0.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
59
+ fastmcp-2.4.0.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
60
+ fastmcp-2.4.0.dist-info/RECORD,,