Documentation
¶
Overview ¶
Package mcpserver hosts WeKnora's own MCP server surface: the Streamable HTTP endpoint that external MCP clients (Claude Desktop, Cursor, VS Code Copilot, ...) connect to. Every request is authenticated by middleware.MCPEndpointAuth against a workspace MCPEndpoint row, and the endpoint's tool allowlist and knowledge-base scope decide what the client can see and call.
A single mcp-go server instance is registered with the full tool catalog; per-endpoint visibility is applied through a tool filter (tools/list) and a handler middleware (tools/call), both keyed off the endpoint on the request context. The transport runs stateless so any replica can answer any call.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wires the tool catalog onto an mcp-go server and exposes it as an http.Handler.
func NewServer ¶
func NewServer( kbService interfaces.KnowledgeBaseService, knowledgeService interfaces.KnowledgeService, chunkService interfaces.ChunkService, wikiService interfaces.WikiPageService, sessionService interfaces.SessionService, messageService interfaces.MessageService, agentService interfaces.CustomAgentService, kbShareService interfaces.KBShareService, tenantService interfaces.TenantService, endpointRepo interfaces.MCPEndpointRepository, db *gorm.DB, cfg *config.Config, redisClient *redis.Client, resourceCatalog interfaces.ResourceCatalog, fileService interfaces.FileService, storageResolver interfaces.StorageBackendResolver, ) *Server
NewServer builds the MCP server and its Streamable HTTP transport.