Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"webhooks": "extras/webhooks",
}

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

netbox = None

@mcp.tool()
Expand Down