server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package server implements the MCP (Model Context Protocol) server for Cortex.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name             string
	Version          string
	AllowedNamespace string // Empty means all namespaces allowed
}

Config holds configuration for the MCP server.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the MCP server for Cortex.

func New

func New(
	cfg *Config,
	conversationEngine *conversation.Engine,
	knowledgeEngine *knowledge.Engine,
	contextEngine *ctxengine.Engine,
	entityEngine *entity.Engine,
) *Server

New creates a new MCP server with all Cortex tools registered.

func (*Server) SSEServer

func (s *Server) SSEServer() *server.SSEServer

SSEServer returns the underlying SSE server for custom HTTP integration. This allows embedding the SSE endpoints in an existing HTTP server.

func (*Server) ServeSSE

func (s *Server) ServeSSE(addr string) error

ServeSSE starts the MCP server using Server-Sent Events transport. The server listens on the specified address (e.g., ":9810").

func (*Server) ServeStdio

func (s *Server) ServeStdio() error

ServeStdio starts the MCP server using stdio transport.

Jump to

Keyboard shortcuts

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