mcpserver

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package mcpserver는 engram 을 MCP 서버로 노출하는 뼈대를 담는다. SDK 어댑터 역할만 한다. 도구 등록과 결과 구조는 커맨드 계층이 맡는다. 도구 결과는 CLI 의 --json 출력 구조체를 그대로 쓰는데 그 구조체들이 cli 패키지 안에 있으므로 이 패키지가 cli 를 알면 순환이 생긴다. 그래서 나누었다(ADR 0043).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, s *mcp.Server) (*mcp.ClientSession, func(), error)

Connect는 서버에 붙은 클라이언트 세션을 돌려준다. 테스트가 실제 프로토콜 왕복으로 도구를 확인하는 데 쓴다. in-memory 전송을 쓰므로 프로세스 밖으로 나가지 않는다. 반환된 정리 함수로 세션과 서버 연결을 닫는다.

func New

func New(name, version string) *mcp.Server

New는 engram MCP 서버를 만든다. 도구 등록은 호출자가 한다. stdout 은 프로토콜 전용이므로 어떤 옵션도 stdout 으로 로그를 보내지 않는다. 진단이 필요한 호출자는 stderr 로 낸다.

func RunStdio

func RunStdio(ctx context.Context, s *mcp.Server) error

RunStdio는 stdio 전송으로 서버를 돌린다. HTTP 전송은 두지 않는다.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL