feat: MCP 클라이언트 통합 및 TextToSqlController MCP 엔드포인트 추가

- IMcpService 인터페이스 및 McpClient/McpService 구현 추가
  - McpClient: Python MCP 서버(localhost:5001)와 JSON-RPC over HTTP 통신
  - McpService: McpClient 위임 래퍼, IMcpService 구현
  - [JsonPropertyName], PropertyNameCaseInsensitive 적용으로 JSON 역직렬화 수정
- TextToSqlController에 MCP 엔드포인트 5개 추가
  - GET  /api/text-to-sql/tools
  - POST /api/text-to-sql/execute-mcp
  - POST /api/text-to-sql/query-history
  - GET  /api/text-to-sql/tags/search
  - GET  /api/text-to-sql/drawings
- HistoryQueryRequestDto 추가 (TextToSqlDtos.cs)
- QueryHistoryWithIntervalAsync 올바른 메서드 호출로 수정 (IExperionDbService)
- Program.cs: McpClient 싱글톤 등록, AddHttpClient 잘못된 등록 수정
- 빌드 에러 0건, 경고 0건

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
windpacer
2026-04-28 01:05:09 +09:00
parent 787d859fb5
commit d8266a2d55
6 changed files with 558 additions and 19 deletions

View File

@@ -3,6 +3,7 @@ using ExperionCrawler.Core.Application.Services;
using ExperionCrawler.Infrastructure.Certificates;
using ExperionCrawler.Infrastructure.Csv;
using ExperionCrawler.Infrastructure.Database;
using ExperionCrawler.Infrastructure.Mcp;
using ExperionCrawler.Infrastructure.OpcUa;
using Microsoft.EntityFrameworkCore;
@@ -61,6 +62,12 @@ builder.Services.AddHostedService(
sp => sp.GetRequiredService<ExperionRealtimeService>());
builder.Services.AddHostedService<ExperionHistoryService>();
// ── MCP Service ───────────────────────────────────────────────────────────────
// Python MCP 서버 (localhost:5001)와 통신
// McpClient: 저수준 HTTP 클라이언트 / McpService: IMcpService 구현 (McpClient 위임)
builder.Services.AddSingleton<McpClient>();
builder.Services.AddSingleton<IMcpService, McpService>();
// ── OPC UA Server BackgroundService ──────────────────────────────────────────
builder.Services.AddSingleton<ExperionOpcServerService>();
builder.Services.AddSingleton<IExperionOpcServerService>(