feat: add optional tools allowlist via MCP_TOOLS_INCLUDED

When MCP_TOOLS_INCLUDED is set to a comma-separated list of tool names,
only those tools are exposed (tools/list and calls); unset or empty
exposes every generated tool. Unknown names are ignored with a startup
warning and the active selection is logged at startup.
This commit is contained in:
2026-10-19 07:24:41 +00:00
parent 6255e71c50
commit 3ec12439b4
4 changed files with 62 additions and 12 deletions
+4
View File
@@ -33,6 +33,10 @@ MCP_HOST=0.0.0.0
MCP_PORT=8000
#MCP_SERVER_NAME=My API
# Comma-separated allowlist of tool names to expose. Unset or empty exposes
# every generated tool; unknown names are ignored with a startup warning.
#MCP_TOOLS_INCLUDED=getPetById,findPetsByStatus
# Timeout in seconds for fetching the spec and calling the API (default: 30).
#HTTP_TIMEOUT=30