1414__all__ = "run_mcp_server" , "DenoEnv" , "prepare_deno_env" , "async_prepare_deno_env"
1515
1616logger = logging .getLogger (__name__ )
17- LoggingLevel = Literal [
18- "debug" , "info" , "notice" , "warning" , "error" , "critical" , "alert" , "emergency"
19- ]
20- Mode = Literal ["stdio" , "streamable_http" , "example" ]
17+ LoggingLevel = Literal ['debug' , 'info' , 'notice' , 'warning' , 'error' , 'critical' , 'alert' , 'emergency' ]
18+ Mode = Literal ['stdio' , 'streamable_http' , 'streamable_http_stateless' , 'example' ]
2119LogHandler = Callable [[LoggingLevel , str ], None ]
2220
2321
@@ -37,6 +35,7 @@ def run_mcp_server(
3735 Args:
3836 mode: The mode to run the server in.
3937 http_port: The port to run the server on if mode is `streamable_http`.
38+ http_host: The host to run the server on if mode is `streamable_http`.
4039 dependencies: The dependencies to install.
4140 return_mode: The mode to return tool results in.
4241 deps_log_handler: Optional function to receive logs emitted while installing dependencies.
@@ -86,7 +85,7 @@ def prepare_deno_env(
8685 http_port : int | None = None ,
8786 http_host : str | None = None ,
8887 dependencies : list [str ] | None = None ,
89- return_mode : Literal [" json" , " xml" ] = " xml" ,
88+ return_mode : Literal [' json' , ' xml' ] = ' xml' ,
9089 deps_log_handler : LogHandler | None = None ,
9190 allow_networking : bool = True ,
9291) -> Iterator [DenoEnv ]:
@@ -99,6 +98,7 @@ def prepare_deno_env(
9998 Args:
10099 mode: The mode to run the server in.
101100 http_port: The port to run the server on if mode is `streamable_http`.
101+ http_host: The host to run the server on if mode is `streamable_http`.
102102 dependencies: The dependencies to install.
103103 return_mode: The mode to return tool results in.
104104 deps_log_handler: Optional function to receive logs emitted while installing dependencies.
@@ -155,7 +155,7 @@ async def async_prepare_deno_env(
155155 http_port : int | None = None ,
156156 http_host : str | None = None ,
157157 dependencies : list [str ] | None = None ,
158- return_mode : Literal [" json" , " xml" ] = " xml" ,
158+ return_mode : Literal [' json' , ' xml' ] = ' xml' ,
159159 deps_log_handler : LogHandler | None = None ,
160160 allow_networking : bool = True ,
161161) -> AsyncIterator [DenoEnv ]:
@@ -197,7 +197,7 @@ def _deno_run_args(
197197 http_port : int | None = None ,
198198 http_host : str | None = None ,
199199 dependencies : list [str ] | None = None ,
200- return_mode : Literal [" json" , " xml" ] = " xml" ,
200+ return_mode : Literal [' json' , ' xml' ] = ' xml' ,
201201 allow_networking : bool = True ,
202202) -> list [str ]:
203203 args = ["run" ]
@@ -227,6 +227,4 @@ def _deno_run_args(
227227
228228
229229async def _asyncify (func : Callable [P , T ], * args : P .args , ** kwargs : P .kwargs ) -> T :
230- return await asyncio .get_event_loop ().run_in_executor (
231- None , partial (func , * args , ** kwargs )
232- )
230+ return await asyncio .get_event_loop ().run_in_executor (None , partial (func , * args , ** kwargs ))
0 commit comments