Fix log_level from fastmcp.json treated as transport parameter

Pass log_level from fastmcp.json deployment config as a transport kwarg
to server.run_async(), similar to how host/port are handled. This allows
the HTTP transport to properly configure logging without modifying global
settings.

Co-authored-by: Jeremiah Lowin <jlowin@users.noreply.github.com>
This commit is contained in:
marvin-context-protocol[bot] 2025-09-16 00:07:40 +00:00
commit 35e3e7e3a6
2 changed files with 4 additions and 3 deletions

View file

@ -184,8 +184,8 @@ async def run_command(
kwargs["port"] = port
if path:
kwargs["path"] = path
# Note: log_level is not currently supported by run_async
# TODO: Add log_level support to server.run_async
if log_level:
kwargs["log_level"] = log_level
if not show_banner:
kwargs["show_banner"] = False

View file

@ -403,7 +403,8 @@ class MCPServerConfig(BaseModel):
run_args["port"] = self.deployment.port
if self.deployment.path:
run_args["path"] = self.deployment.path
# Note: log_level not currently supported by run_async
if self.deployment.log_level:
run_args["log_level"] = self.deployment.log_level
# Override with any provided kwargs
run_args.update(kwargs)