You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -776,6 +856,8 @@ class MCPServerStdio(MCPServer):
776
856
sampling_model: models.Model|None
777
857
max_retries: int
778
858
elicitation_callback: ElicitationFnT|None=None
859
+
cache_tools: bool
860
+
cache_resources: bool
779
861
780
862
def__init__(
781
863
self,
@@ -794,6 +876,8 @@ def __init__(
794
876
sampling_model: models.Model|None=None,
795
877
max_retries: int=1,
796
878
elicitation_callback: ElicitationFnT|None=None,
879
+
cache_tools: bool=True,
880
+
cache_resources: bool=True,
797
881
id: str|None=None,
798
882
):
799
883
"""Build a new MCP server.
@@ -813,6 +897,10 @@ def __init__(
813
897
sampling_model: The model to use for sampling.
814
898
max_retries: The maximum number of times to retry a tool call.
815
899
elicitation_callback: Callback function to handle elicitation requests from the server.
900
+
cache_tools: Whether to cache the list of tools.
901
+
See [`MCPServer.cache_tools`][pydantic_ai.mcp.MCPServer.cache_tools].
902
+
cache_resources: Whether to cache the list of resources.
903
+
See [`MCPServer.cache_resources`][pydantic_ai.mcp.MCPServer.cache_resources].
816
904
id: An optional unique ID for the MCP server. An MCP server needs to have an ID in order to be used in a durable execution environment like Temporal, in which case the ID will be used to identify the server's activities within the workflow.
817
905
"""
818
906
self.command=command
@@ -831,6 +919,8 @@ def __init__(
831
919
sampling_model,
832
920
max_retries,
833
921
elicitation_callback,
922
+
cache_tools,
923
+
cache_resources,
834
924
id=id,
835
925
)
836
926
@@ -930,6 +1020,8 @@ class _MCPServerHTTP(MCPServer):
930
1020
sampling_model: models.Model|None
931
1021
max_retries: int
932
1022
elicitation_callback: ElicitationFnT|None=None
1023
+
cache_tools: bool
1024
+
cache_resources: bool
933
1025
934
1026
def__init__(
935
1027
self,
@@ -948,6 +1040,8 @@ def __init__(
948
1040
sampling_model: models.Model|None=None,
949
1041
max_retries: int=1,
950
1042
elicitation_callback: ElicitationFnT|None=None,
1043
+
cache_tools: bool=True,
1044
+
cache_resources: bool=True,
951
1045
**_deprecated_kwargs: Any,
952
1046
):
953
1047
"""Build a new MCP server.
@@ -967,6 +1061,10 @@ def __init__(
967
1061
sampling_model: The model to use for sampling.
968
1062
max_retries: The maximum number of times to retry a tool call.
969
1063
elicitation_callback: Callback function to handle elicitation requests from the server.
1064
+
cache_tools: Whether to cache the list of tools.
1065
+
See [`MCPServer.cache_tools`][pydantic_ai.mcp.MCPServer.cache_tools].
1066
+
cache_resources: Whether to cache the list of resources.
1067
+
See [`MCPServer.cache_resources`][pydantic_ai.mcp.MCPServer.cache_resources].
0 commit comments