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]

Merge branch 'main' into fix/mcp-rest-auth-ssrf

YutaSaitob9e8b38cd365
diff --cc litellm/proxy/_experimental/mcp_server/rest_endpoints.py
index 92c390f0a64,891b52db7af..4c947b99ba3
--- a/litellm/proxy/_experimental/mcp_server/rest_endpoints.py
+++ b/litellm/proxy/_experimental/mcp_server/rest_endpoints.py
@@@ -328,15 -347,17 +346,16 @@@ if MCP_AVAILABLE
except Exception as e:
verbose_logger.error(f"Error in MCP operation: {e}", exc_info=True)
- stack_trace = traceback.format_exc()
return {
"status": "error",
- "message": f"An internal error has occurred: {str(e)}",
- "stack_trace": stack_trace,
+ "message": "An internal error has occurred while testing the MCP server.",
}
- @router.post("/test/connection")
+ @router.post("/test/connection", dependencies=[Depends(user_api_key_auth)])
async def test_connection(
- request: NewMCPServerRequest,
+ request: Request,
+ new_mcp_server_request: NewMCPServerRequest,
+ user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
):
"""
Test if we can connect to the provided MCP server before adding it