fix: Playground UI에서 전달하는 X-Agent-Id 헤더를 Tenant ID로 인식하도록 McpRouterController 수정

This commit is contained in:
jade
2026-07-15 15:45:26 +09:00
parent 3131440171
commit d87af0cc82

View File

@@ -62,8 +62,11 @@ public class McpRouterController {
@PostMapping("/tools/call")
public ResponseEntity<?> callTool(@RequestBody Map<String, Object> payload,
@RequestHeader(value = "X-Agent-Id", required = false) String agentId,
@RequestHeader(value = "X-Tenant-Id", required = false, defaultValue = "system") String tenantId) {
String effectiveTenantId = (agentId != null && !agentId.trim().isEmpty()) ? agentId : tenantId;
try {
log.info("[Admin UI -> MCP Gateway] 동적 툴 실행 요청 수신: {}", objectMapper.writeValueAsString(payload));
} catch (Exception ex) {
@@ -71,7 +74,7 @@ public class McpRouterController {
}
try {
Object result = executeService.execute(payload, tenantId);
Object result = executeService.execute(payload, effectiveTenantId);
io.shinhanlife.axhub.biz.mcp.adapter.dto.JsonRpcResponse response = new io.shinhanlife.axhub.biz.mcp.adapter.dto.JsonRpcResponse();
response.setJsonrpc("2.0");