Fix: MCP list_mcp_tools + config Routes auf Bearer-Auth umstellen
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
This commit is contained in:
@@ -44,9 +44,12 @@ async def _get_mcp_context(
|
|||||||
|
|
||||||
@router.get("/tools", response_model=McpToolListResponse)
|
@router.get("/tools", response_model=McpToolListResponse)
|
||||||
async def list_mcp_tools(
|
async def list_mcp_tools(
|
||||||
current_user: dict[str, Any] = Depends(require_permission("mcp:read")),
|
current_user: dict[str, Any] = Depends(get_current_user_or_bearer),
|
||||||
) -> McpToolListResponse:
|
) -> McpToolListResponse:
|
||||||
"""List all available MCP tools with their schemas."""
|
"""List all available MCP tools with their schemas.
|
||||||
|
|
||||||
|
Accepts session cookie OR Bearer token.
|
||||||
|
"""
|
||||||
return McpToolListResponse(
|
return McpToolListResponse(
|
||||||
tools=TOOL_DEFINITIONS,
|
tools=TOOL_DEFINITIONS,
|
||||||
count=len(TOOL_DEFINITIONS),
|
count=len(TOOL_DEFINITIONS),
|
||||||
@@ -132,9 +135,12 @@ async def execute_mcp_tool(
|
|||||||
|
|
||||||
@router.get("/config", response_model=McpServerConfig)
|
@router.get("/config", response_model=McpServerConfig)
|
||||||
async def get_mcp_config(
|
async def get_mcp_config(
|
||||||
current_user: dict[str, Any] = Depends(require_permission("mcp:read")),
|
current_user: dict[str, Any] = Depends(get_current_user_or_bearer),
|
||||||
) -> McpServerConfig:
|
) -> McpServerConfig:
|
||||||
"""Get MCP server configuration for external clients."""
|
"""Get MCP server configuration for external clients.
|
||||||
|
|
||||||
|
Accepts session cookie OR Bearer token.
|
||||||
|
"""
|
||||||
return McpServerConfig(
|
return McpServerConfig(
|
||||||
server_name="LeoCRM",
|
server_name="LeoCRM",
|
||||||
server_version="1.0.0",
|
server_version="1.0.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user