Skip to content

Conversation

mhajder
Copy link
Contributor

@mhajder mhajder commented Aug 3, 2025

That way will be better, we can always manually set the LOG_LEVEL to DEBUG, in the production case the default debug enabled fills up the logs terribly.

}

mcp = FastMCP("NetBox", log_level="DEBUG")
mcp = FastMCP("NetBox", log_level=os.getenv("LOG_LEVEL", "INFO"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it will pay attention to the FASTMCP_LOG_LEVEL environment variable if we just remove the log_level parameter altogether -- (afaict the log_level parameter is deprecated) -- might need to check the version we're using though. https://gofastmcp.com/servers/server#setting-global-configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately FASTMCP_LOG_LEVEL will be not working (just tested). This feature is available in version >=2.0.0 and we have version 1.X.X (currently, in uv.lock mcp[cli] is 1.12.3 and the latest version available is 1.13.1, which also doesn't support that).

Of course we can upgrade from mcp[cli] (v1.X) to FastMCP (v2.X).

I also don't think log_level is deprecated. FASTMCP_LOG_LEVEL is used to set the log level for the entire context, while log_level can only be applied to individual mcp instances to overwrite FASTMCP_LOG_LEVEL.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I see -- yes, I'm looking at version 2.

for deprecation, noticed here https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L159 -- also fairly recent versions only ~3mos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants