Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

docs(proxy): point mcp_server test references at tests/unit/proxy (#44055)

yuneng-jiangc030191be665
diff --git a/litellm/proxy/_experimental/mcp_server/AGENTS.md b/litellm/proxy/_experimental/mcp_server/AGENTS.md
index d9e0bfa3589..626646c4c5c 100644
--- a/litellm/proxy/_experimental/mcp_server/AGENTS.md
+++ b/litellm/proxy/_experimental/mcp_server/AGENTS.md
@@ -89,14 +89,19 @@ module materially harder to understand.
## Tests
-Mirror this package under `tests/test_litellm/proxy/_experimental/mcp_server/`.
+Mirror this package under `tests/unit/proxy/_experimental/mcp_server/`.
For regressions, extend the existing mapped test file instead of creating a new
one. Use subdirectories that match the implementation path, such as
-`auth/test_token_exchange.py` for `auth/token_exchange.py` and
+`auth/test_token_endpoint_auth.py` for `auth/token_endpoint_auth.py` and
`guardrail_translation/test_mcp_guardrail_handler.py` for
`guardrail_translation/handler.py`.
Use `tests/mcp_tests/` only when extending an existing broader MCP integration
scenario that already lives there. Route, auth, tool listing, tool execution,
OAuth, sampling, elicitation, DB, and dashboard-session changes should have
-focused coverage in the mirrored `tests/test_litellm/...` path first.
+focused coverage in the mirrored `tests/unit/proxy/...` path first.
+
+The environment-backed constants in `utils.py` (`LITELLM_MCP_SERVER_NAME`,
+`LITELLM_MCP_SERVER_DESCRIPTION`, `MCP_TOOL_PREFIX_SEPARATOR`) are read once at
+import time. Tests that override those variables must reload the module, as
+`test_mcp_server_identity_env.py` does, or they assert against stale values.
diff --git a/litellm/proxy/_experimental/mcp_server/utils.py b/litellm/proxy/_experimental/mcp_server/utils.py
index 7411dc5c4f0..7c9d75457b5 100644
--- a/litellm/proxy/_experimental/mcp_server/utils.py
+++ b/litellm/proxy/_experimental/mcp_server/utils.py
@@ -40,14 +40,6 @@ class McpServerPayloadLike(Protocol):
def tool_name_to_display_name(self) -> Mapping[str, str] | None: ...
-# Constants
-#
-# NOTE: The environment-backed values below are read once, when this module is
-# first imported, and cached for the lifetime of the process. Changing the
-# corresponding environment variables after import has no effect unless the
-# module is reloaded (e.g. ``importlib.reload``). Tests that override these
-# variables must reload this module — see
-# ``tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server_identity_env.py``.
LITELLM_MCP_SERVER_NAME: Final = os.environ.get("LITELLM_MCP_SERVER_NAME", "litellm-mcp-server")
LITELLM_MCP_SERVER_VERSION: Final = "1.0.0"
LITELLM_MCP_SERVER_DESCRIPTION: Final = os.environ.get("LITELLM_MCP_SERVER_DESCRIPTION", "MCP Server for LiteLLM")