fastmcp 2.10.2__py3-none-any.whl → 2.10.3__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.
@@ -1,13 +1,20 @@
1
1
  fastmcp/__init__.py,sha256=5ChT4kg3srdFl0-9dZekGqpzCESlpc6ohrfPbWf1aTo,1300
2
2
  fastmcp/exceptions.py,sha256=-krEavxwddQau6T7MESCR4VjKNLfP9KHJrU1p3y72FU,744
3
+ fastmcp/mcp_config.py,sha256=hOF_NO7F9LbrbmRTj99TVSqHIul4sExNpf1T1HRLpzo,9606
3
4
  fastmcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
5
  fastmcp/settings.py,sha256=Ta0TKA75xda9sNkIOpPVIEEk4W9jf_2gwcmO26uDQpg,8946
5
6
  fastmcp/cli/__init__.py,sha256=Ii284TNoG5lxTP40ETMGhHEq3lQZWxu9m9JuU57kUpQ,87
6
7
  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
8
+ fastmcp/cli/cli.py,sha256=mr8uKvFINEs4eh-v3vSOmncFCaUS4G0CCk8YVBh_jfk,12679
9
+ fastmcp/cli/run.py,sha256=h2WjJtrmhHQN1kM8CYa5i177hBuHoPsbycSMiOr_8uw,6696
10
+ fastmcp/cli/install/__init__.py,sha256=afaNANIhivfKi4QhJdYUP56Q2XZ4da4dUbDq9HAMJqo,701
11
+ fastmcp/cli/install/claude_code.py,sha256=eH6Pdre-FtzGuEatWYIFVTNtEEjHb7m-bgX4ARIFG2g,5384
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
9
16
  fastmcp/client/__init__.py,sha256=kd2hhSuD8rZuF87c9zlPJP_icJ-Rx3exyNoK0EzfOtE,617
10
- fastmcp/client/client.py,sha256=8Sx7NxnnF5IMv9E-J0MXjTI_TfhlM3j0mD1Rh-LXQJI,29213
17
+ fastmcp/client/client.py,sha256=GniETS28L8B-ahzztU2ZLI_XSCcEib-miGzE2ZnG4Xc,34054
11
18
  fastmcp/client/elicitation.py,sha256=Jf9yqna8R7r1hqedXAyh9a2-QNVzbCSKUDZhkFHqHqg,2403
12
19
  fastmcp/client/logging.py,sha256=7GJ-BLFW16_IOJPlGTNEWPP0P-yqqRpmsLdiKrlVsw8,757
13
20
  fastmcp/client/messages.py,sha256=NIPjt-5js_DkI5BD4OVdTf6pz-nGjc2dtbgt-vAY234,4329
@@ -15,7 +22,7 @@ fastmcp/client/oauth_callback.py,sha256=ODAnVX-ettL82RuI5KpfkKf8iDtYMDue3Tnab5sj
15
22
  fastmcp/client/progress.py,sha256=WjLLDbUKMsx8DK-fqO7AGsXb83ak-6BMrLvzzznGmcI,1043
16
23
  fastmcp/client/roots.py,sha256=IxI_bHwHTmg6c2H-s1av1ZgrRnNDieHtYwdGFbzXT5c,2471
17
24
  fastmcp/client/sampling.py,sha256=Q8PzYCERa1W3xGGI9I9QOhhDM-M4i3P5lESb0cp2iI8,1595
18
- fastmcp/client/transports.py,sha256=DNzvZGbe5q_rvk1C0bifejk7Gh561h-QTGGlyqwiSxM,33813
25
+ fastmcp/client/transports.py,sha256=AIQ0ni3lI0MoewgPNlkLHvym1iEnc8vCa513lHKCIqA,33803
19
26
  fastmcp/client/auth/__init__.py,sha256=4DNsfp4iaQeBcpds0JDdMn6Mmfud44stWLsret0sVKY,91
20
27
  fastmcp/client/auth/bearer.py,sha256=MFEFqcH6u_V86msYiOsEFKN5ks1V9BnBNiPsPLHUTqo,399
21
28
  fastmcp/client/auth/oauth.py,sha256=pSyuI0FlRK1qkBA6mvq-bxKzl2B-pMCvPPzIByTJBEo,11745
@@ -34,12 +41,12 @@ fastmcp/contrib/mcp_mixin/__init__.py,sha256=aw9IQ1ssNjCgws4ZNt8bkdpossAAGVAwwjB
34
41
  fastmcp/contrib/mcp_mixin/example.py,sha256=GnunkXmtG5hLLTUsM8aW5ZURU52Z8vI4tNLl-fK7Dg0,1228
35
42
  fastmcp/contrib/mcp_mixin/mcp_mixin.py,sha256=sUSJ2o0sTsb061MyPN2xuYP0oI4W6YVQXupY3nnjD50,8687
36
43
  fastmcp/prompts/__init__.py,sha256=An8uMBUh9Hrb7qqcn_5_Hent7IOeSh7EA2IUVsIrtHc,179
37
- fastmcp/prompts/prompt.py,sha256=ee7DT32pw0H0k0ON8a63Eu0kQ3G1zMGlWXIFRDV8p7E,13925
44
+ fastmcp/prompts/prompt.py,sha256=Ux_FT8GTnejvjDWEgf5nSAIwbhV-9otgCJm-EqnzxvY,13861
38
45
  fastmcp/prompts/prompt_manager.py,sha256=Pt9cg_c9FR2EA0ITIHJT5Utihkd383JzhqhT-y2VnKo,7677
39
46
  fastmcp/resources/__init__.py,sha256=y1iAuqx-GIrS1NqIYzKezIDiYyjNEzzHD35epHpMnXE,463
40
- fastmcp/resources/resource.py,sha256=fN_ck9fgFG_ciHV9reXDNe-dWzqEZ7XV4p3U7z-yf4k,6050
47
+ fastmcp/resources/resource.py,sha256=GGCUHUQe4ALrVJc-Ng1uz8-mtQSg_vuVA71H_qJkko0,6031
41
48
  fastmcp/resources/resource_manager.py,sha256=zjhso9ZP0EK_beTpUz_amqJ7XSABqU8mqPSk-JturOE,19777
42
- fastmcp/resources/template.py,sha256=rYEfwNWVJZnlTp6uSKbGNL0OlaUqOoKRjmg4hesLXVU,10346
49
+ fastmcp/resources/template.py,sha256=mYsw3xPWRq1AgOVFkG_A1otY3NXYw5oUJnVzMC1Qy80,10346
43
50
  fastmcp/resources/types.py,sha256=SiYNLnpXT-mHgNUrzqKUvXYUsY-V3gwJIrYdJfFwDDo,4868
44
51
  fastmcp/server/__init__.py,sha256=bMD4aQD4yJqLz7-mudoNsyeV8UgQfRAg3PRwPvwTEds,119
45
52
  fastmcp/server/context.py,sha256=OFkdgT53NkN_VYwwHjdR2C_28CWtPsFln36X0QLM23g,20258
@@ -47,9 +54,9 @@ fastmcp/server/dependencies.py,sha256=iKJdz1XsVJcrfHo_reXj9ZSldw-HeAwsp9S6lAgfGA
47
54
  fastmcp/server/elicitation.py,sha256=jZIHjV4NjhYbT-w8pBArwd0vNzP8OYwzmsnWDdk6Bd0,6136
48
55
  fastmcp/server/http.py,sha256=d0Jij4HVTaAohluRXArSniXLb1HcHP3ytbe-mMHg6nE,11678
49
56
  fastmcp/server/low_level.py,sha256=LNmc_nU_wx-fRG8OEHdLPKopZpovcrWlyAxJzKss3TA,1239
50
- fastmcp/server/openapi.py,sha256=ALIbl0r2T1cvbSeFwz6HpIzut2akdngAtKDdWGyIWHs,36221
51
- fastmcp/server/proxy.py,sha256=NNyxtbOCJeKM-zRoaPCkVk26c7LHViHXNFfy95aXnAM,19591
52
- fastmcp/server/server.py,sha256=KM1-dfwIoRiTYSLI5IvZ1Zy1imAkS3ILZ1QeRCgLNvY,81153
57
+ fastmcp/server/openapi.py,sha256=YoARNzEZQs6MfnGfl5-V9kULCDp1LluJL2yeH9m62Os,37595
58
+ fastmcp/server/proxy.py,sha256=YxlU4lNPGb5rk4oyUySYiOMz3GIAywrQP1rMcVYSih4,21689
59
+ fastmcp/server/server.py,sha256=Zk77BcHyr0lSwf2LmNOQXiDJNFeQKkZ_p20dg81P0IU,82383
53
60
  fastmcp/server/auth/__init__.py,sha256=doHCLwOIElvH1NrTdpeP9JKfnNf3MDYPSpQfdsQ-uI0,84
54
61
  fastmcp/server/auth/auth.py,sha256=A00OKxglEMrGMMIiMbc6UmpGc2VoWDkEVU5g2pIzDIg,2119
55
62
  fastmcp/server/auth/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -63,9 +70,9 @@ fastmcp/server/middleware/middleware.py,sha256=1Zy5KdBCrGzqFIpYZqWlZq9rLK3NDlRiX
63
70
  fastmcp/server/middleware/rate_limiting.py,sha256=VTrCoQFmWCm0BxwOrNfG21CBFDDOKJT7IiSEjpJgmPA,7921
64
71
  fastmcp/server/middleware/timing.py,sha256=lL_xc-ErLD5lplfvd5-HIyWEbZhgNBYkcQ74KFXAMkA,5591
65
72
  fastmcp/tools/__init__.py,sha256=vzqb-Y7Kf0d5T0aOsld-O-FA8kD7-4uFExChewFHEzY,201
66
- fastmcp/tools/tool.py,sha256=DsoF0QNTl4i_w0FqqmdbK_1poZtfj1j6mv5kuf8zH1Y,17524
73
+ fastmcp/tools/tool.py,sha256=fW-xZQCLN2qSZrlAo2eQ1aEFa-VN5jYEHx5H936-_50,17466
67
74
  fastmcp/tools/tool_manager.py,sha256=Sm_tOO-SY0m7tEN_dofP-tvBnC2HroPRKLU6sp8gnUw,7739
68
- fastmcp/tools/tool_transform.py,sha256=YY2DZdJZ6fEGtgEP1Djrc49F8rAEyx6fgRGEyIGaxPE,32601
75
+ fastmcp/tools/tool_transform.py,sha256=nGvxxKsyfp3gYl_nkYFHlnb8Fc4Jtw6t7WL291S4Vh4,32558
69
76
  fastmcp/utilities/__init__.py,sha256=-imJ8S-rXmbXMWeDamldP-dHDqAPg_wwmPVz-LNX14E,31
70
77
  fastmcp/utilities/cache.py,sha256=aV3oZ-ZhMgLSM9iAotlUlEy5jFvGXrVo0Y5Bj4PBtqY,707
71
78
  fastmcp/utilities/cli.py,sha256=n3HA8IXg7hKaizuM3SRCW65UMXlqjUDf5USRSuscTdY,3287
@@ -73,15 +80,14 @@ fastmcp/utilities/components.py,sha256=WIxNVZ7YxCLpdIm_pbTYeP0lAxikvgptVYhIL0LVm
73
80
  fastmcp/utilities/exceptions.py,sha256=7Z9j5IzM5rT27BC1Mcn8tkS-bjqCYqMKwb2MMTaxJYU,1350
74
81
  fastmcp/utilities/http.py,sha256=1ns1ymBS-WSxbZjGP6JYjSO52Wa_ls4j4WbnXiupoa4,245
75
82
  fastmcp/utilities/inspect.py,sha256=XNA0dfYM5G-FVbJaVJO8loSUUCNypyLA-QjqTOneJyU,10833
76
- fastmcp/utilities/json_schema.py,sha256=K0QH5UazBD_tweBi-TguWYjUu5Lgp9wcM-wT42Fet5w,5022
83
+ fastmcp/utilities/json_schema.py,sha256=8qyb3qOvk1gc3p63uP6LGyKdOANkNdD9YA32OiBxyNw,5495
77
84
  fastmcp/utilities/json_schema_type.py,sha256=Sml03nJGOnUfxCGrHWRMwZMultV0X5JThMepUnHIUiA,22377
78
85
  fastmcp/utilities/logging.py,sha256=1y7oNmy8WrR0NsfNVw1LPoKu92OFdmzIO65syOKi_BI,1388
79
- fastmcp/utilities/mcp_config.py,sha256=uGmkepcNpS_7HEuaK3465OcwcmebHGyvUddOjLfw1jY,3075
80
- fastmcp/utilities/openapi.py,sha256=neeaXwwn1OWdUp0Gawhx4SJHLfV78gXU5OMMTFGeD24,45235
86
+ fastmcp/utilities/openapi.py,sha256=YWDFjT9ng4xi_kzNCoeBCgwnlep14IQ7PnCSQt_lVyU,48528
81
87
  fastmcp/utilities/tests.py,sha256=kZH8HQAC702a5vNJb4K0tO1ll9CZADWQ_P-5ERWSvSA,4242
82
88
  fastmcp/utilities/types.py,sha256=c6HPvHCpkq8EXh0hWjaUlj9aCZklmxzAQHCXZy7llNo,10636
83
- fastmcp-2.10.2.dist-info/METADATA,sha256=zvfV88PXJiHci0YJfQIrgPsaOvDaVsMVHUIHB6mtgCU,17796
84
- fastmcp-2.10.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
85
- fastmcp-2.10.2.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
86
- fastmcp-2.10.2.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
87
- fastmcp-2.10.2.dist-info/RECORD,,
89
+ fastmcp-2.10.3.dist-info/METADATA,sha256=ZQWYX4dWpwwDXmCBG4EiiXACSF8Xv6qag6WKuqcnY2s,17842
90
+ fastmcp-2.10.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
91
+ fastmcp-2.10.3.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
92
+ fastmcp-2.10.3.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
93
+ fastmcp-2.10.3.dist-info/RECORD,,
@@ -1,103 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import datetime
4
- import re
5
- from typing import TYPE_CHECKING, Annotated, Any, Literal
6
- from urllib.parse import urlparse
7
-
8
- import httpx
9
- from pydantic import AnyUrl, ConfigDict, Field
10
-
11
- from fastmcp.utilities.types import FastMCPBaseModel
12
-
13
- if TYPE_CHECKING:
14
- from fastmcp.client.transports import (
15
- SSETransport,
16
- StdioTransport,
17
- StreamableHttpTransport,
18
- )
19
-
20
-
21
- def infer_transport_type_from_url(
22
- url: str | AnyUrl,
23
- ) -> Literal["http", "sse"]:
24
- """
25
- Infer the appropriate transport type from the given URL.
26
- """
27
- url = str(url)
28
- if not url.startswith("http"):
29
- raise ValueError(f"Invalid URL: {url}")
30
-
31
- parsed_url = urlparse(url)
32
- path = parsed_url.path
33
-
34
- # Match /sse followed by /, ?, &, or end of string
35
- if re.search(r"/sse(/|\?|&|$)", path):
36
- return "sse"
37
- else:
38
- return "http"
39
-
40
-
41
- class StdioMCPServer(FastMCPBaseModel):
42
- command: str
43
- args: list[str] = Field(default_factory=list)
44
- env: dict[str, Any] = Field(default_factory=dict)
45
- cwd: str | None = None
46
- transport: Literal["stdio"] = "stdio"
47
-
48
- def to_transport(self) -> StdioTransport:
49
- from fastmcp.client.transports import StdioTransport
50
-
51
- return StdioTransport(
52
- command=self.command,
53
- args=self.args,
54
- env=self.env,
55
- cwd=self.cwd,
56
- )
57
-
58
-
59
- class RemoteMCPServer(FastMCPBaseModel):
60
- url: str
61
- headers: dict[str, str] = Field(default_factory=dict)
62
- transport: Literal["http", "streamable-http", "sse"] | None = None
63
- auth: Annotated[
64
- str | Literal["oauth"] | httpx.Auth | None,
65
- Field(
66
- description='Either a string representing a Bearer token, the literal "oauth" to use OAuth authentication, or an httpx.Auth instance for custom authentication.',
67
- ),
68
- ] = None
69
- sse_read_timeout: datetime.timedelta | int | float | None = None
70
-
71
- model_config = ConfigDict(arbitrary_types_allowed=True)
72
-
73
- def to_transport(self) -> StreamableHttpTransport | SSETransport:
74
- from fastmcp.client.transports import SSETransport, StreamableHttpTransport
75
-
76
- if self.transport is None:
77
- transport = infer_transport_type_from_url(self.url)
78
- else:
79
- transport = self.transport
80
-
81
- if transport == "sse":
82
- return SSETransport(
83
- self.url,
84
- headers=self.headers,
85
- auth=self.auth,
86
- sse_read_timeout=self.sse_read_timeout,
87
- )
88
- else:
89
- # Both "http" and "streamable-http" map to StreamableHttpTransport
90
- return StreamableHttpTransport(
91
- self.url,
92
- headers=self.headers,
93
- auth=self.auth,
94
- sse_read_timeout=self.sse_read_timeout,
95
- )
96
-
97
-
98
- class MCPConfig(FastMCPBaseModel):
99
- mcpServers: dict[str, StdioMCPServer | RemoteMCPServer]
100
-
101
- @classmethod
102
- def from_dict(cls, config: dict[str, Any]) -> MCPConfig:
103
- return cls(mcpServers=config.get("mcpServers", config))