2026-02-16 15:25:55 +00:00
|
|
|
package mcp
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2026-02-16 17:24:36 +00:00
|
|
|
"forge.lthn.ai/core/cli/pkg/log"
|
2026-02-16 15:25:55 +00:00
|
|
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// ServeStdio starts the MCP server over stdin/stdout.
|
|
|
|
|
// This is the default transport for CLI integrations.
|
|
|
|
|
func (s *Service) ServeStdio(ctx context.Context) error {
|
|
|
|
|
s.logger.Info("MCP Stdio server starting", "user", log.Username())
|
|
|
|
|
return s.server.Run(ctx, &mcp.StdioTransport{})
|
|
|
|
|
}
|