MCP Server
Delphi로 Model Context Protocol (MCP) 서버를 구축해 보세요. AI 애플리케이션에 도구, 리소스, 프롬프트를 노출시킬 수 있어요.
Delphi로 Model Context Protocol (MCP) 서버를 구축해 보세요. AI 애플리케이션에 도구, 리소스, 프롬프트를 노출시킬 수 있어요.
MCP를 지원하는 어떤 LLM 클라이언트에도 자체 도구, 프롬프트, 리소스를 노출시킬 수 있어요. sgcWebSockets HTTP 서버 위에서 HTTP 및 HTTP Streamable 전송으로 JSON-RPC 엔드포인트를 호스팅해요.
TsgcWSAPIServer_MCP
Windows, macOS, Linux, iOS, Android
Enterprise (AI 애드온)
HTTP 서버에 연결하고, ServerInfo를 채우고, OnMCPRequest* 핸들러를 연결한 다음, Active := True를 설정하세요.
uses
sgcAI_MCP_Server, sgcAI_MCP_Classes;
var
MCP: TsgcWSAPIServer_MCP;
begin
MCP := TsgcWSAPIServer_MCP.Create(nil);
MCP.MCPOptions.HttpOptions.Port := 8080;
MCP.MCPOptions.ServerInfo.Name := 'sgc-mcp-server';
MCP.MCPOptions.ServerInfo.Title := 'Weather MCP';
MCP.MCPOptions.ServerInfo.Version := '1.0.0';
// Lifecycle + incoming request handlers
MCP.OnMCPInitialize := SrvInitialize;
MCP.OnMCPSessionNew := SrvSessionNew;
MCP.OnMCPRequestTool := SrvCallTool;
MCP.OnMCPRequestPrompt := SrvGetPrompt;
MCP.OnMCPRequestResource := SrvReadResource;
MCP.Active := True;
// Push a notification to every connected session
MCP.SendNotificationToolsListChanged;
end;
5개의 게시된 속성, 9개의 메서드, 12개의 이벤트 — 컴포넌트 참조 문서에서 가져왔어요.
메서드: KeepAlive.
이벤트: OnMCPHTTPRequest, OnMCPHTTPResponse.
게시된 속성: MCPOptions, EndpointOptions, TransportOptions.
게시된 속성: Version.
속성: Server.
메서드: RequestRootsList, RequestSamplingCreateMessage, RequestElicitationCreate.
이 컴포넌트가 구현하는 프로토콜의 공식 출처입니다.