@@ -52,6 +52,7 @@ def run_mcp_server(
5252 return_mode = return_mode ,
5353 deps_log_handler = deps_log_handler ,
5454 allow_networking = allow_networking ,
55+ quiet = not verbose ,
5556 ) as env :
5657 if mode in ('streamable_http' , 'streamable_http_stateless' ):
5758 logger .info ('Running mcp-run-python via %s on port %d...' , mode , http_port )
@@ -82,6 +83,7 @@ def prepare_deno_env(
8283 return_mode : Literal ['json' , 'xml' ] = 'xml' ,
8384 deps_log_handler : LogHandler | None = None ,
8485 allow_networking : bool = True ,
86+ quiet : bool = False ,
8587) -> Iterator [DenoEnv ]:
8688 """Prepare the deno environment for running the mcp-run-python server with Deno.
8789
@@ -97,6 +99,7 @@ def prepare_deno_env(
9799 deps_log_handler: Optional function to receive logs emitted while installing dependencies.
98100 allow_networking: Whether the prepared DenoEnv should allow networking when running code.
99101 Note that we always allow networking during environment initialization to install dependencies.
102+ quiet: Suppresses diagnostic output from Deno when installing dependencies.
100103
101104 Returns:
102105 Yields the deno environment details.
@@ -108,7 +111,7 @@ def prepare_deno_env(
108111 shutil .copytree (src , cwd , ignore = shutil .ignore_patterns ('node_modules' ))
109112 logger .info ('Installing dependencies %s...' , dependencies )
110113
111- args = 'deno' , * _deno_install_args (dependencies )
114+ args = 'deno' , * _deno_install_args (dependencies , quiet = quiet )
112115 p = subprocess .Popen (args , cwd = cwd , stdout = subprocess .PIPE , stderr = subprocess .STDOUT , text = True )
113116 stdout : list [str ] = []
114117 if p .stdout is not None :
@@ -145,6 +148,7 @@ async def async_prepare_deno_env(
145148 return_mode : Literal ['json' , 'xml' ] = 'xml' ,
146149 deps_log_handler : LogHandler | None = None ,
147150 allow_networking : bool = True ,
151+ quiet : bool = False ,
148152) -> AsyncIterator [DenoEnv ]:
149153 """Async variant of `prepare_deno_env`."""
150154 ct = await _asyncify (
@@ -155,16 +159,21 @@ async def async_prepare_deno_env(
155159 return_mode = return_mode ,
156160 deps_log_handler = deps_log_handler ,
157161 allow_networking = allow_networking ,
162+ quiet = quiet ,
158163 )
159164 try :
160165 yield await _asyncify (ct .__enter__ )
161166 finally :
162167 await _asyncify (ct .__exit__ , None , None , None )
163168
164169
165- def _deno_install_args (dependencies : list [str ] | None = None ) -> list [str ]:
170+ def _deno_install_args (dependencies : list [str ] | None = None , quiet : bool = False ) -> list [str ]:
166171 args = [
167- 'run' ,
172+ 'run'
173+ ]
174+ if quiet :
175+ args += ['--quiet' ]
176+ args += [
168177 '--allow-net' ,
169178 '--allow-read=./node_modules' ,
170179 '--allow-write=./node_modules' ,
0 commit comments