Documentation
¶
Index ¶
Constants ¶
const ( CtxKeyTokenType = "mcp.token.type" CtxKeyWorkerID = "mcp.token.worker_id" CtxKeyScopes = "mcp.token.scopes" )
const ( ClearReasonActiveTasks = "active_tasks" ClearReasonMultipleWorkers = "multiple_workers" )
const CtxScopesKey ctxKey = CtxKeyScopes
Mirrors CtxKeyScopes from auth middleware; see CtxWorkerIDKey comment above.
const CtxWorkerIDKey ctxKey = CtxKeyWorkerID
Uses the same string value as CtxKeyWorkerID (auth middleware on gin.Context) so the two stay in sync without a hard import dependency between packages. Exported so tests can construct contexts that simulate worker calls.
Variables ¶
This section is empty.
Functions ¶
func JWTAuthMiddleware ¶ added in v0.0.16
func JWTAuthMiddleware(secret string) gin.HandlerFunc
JWTAuthMiddleware validates the MCP JWT and writes claims to gin.Context. Reads the token from X-API-Key header or api_key query param. Returns 401 on missing, invalid, or expired token.
func RequireBeeOrWorker ¶ added in v0.0.16
func RequireBeeOrWorker() gin.HandlerFunc
RequireBeeOrWorker accepts tokens of either type.
Types ¶
type ActiveTaskSummary ¶ added in v0.0.22
type ExecutionStopper ¶
ExecutionStopper can kill a running worker process by execution ID.
type LinkedWorkerSummary ¶ added in v0.0.22
type MCPServer ¶
type MCPServer struct {
// contains filtered or unexported fields
}
MCPServer dispatches tool calls.
func NewBeeServer ¶ added in v0.0.10
func NewBeeServer( ws *store.WorkerStore, mgr *worker.Manager, ts *store.TaskStore, ms *store.MessageStore, oms *store.OutboundMessageStore, senders map[string]platform.PlatformSenderAdapter, execStopper ExecutionStopper, sessionClearer SessionClearer, es *store.ExecutionStore, constraintStore *store.ConstraintStore, sessionStore *store.SessionStore, ds *store.DepartmentStore, ) *MCPServer
NewBeeServer creates a Bee MCP Server with all tools.
func (*MCPServer) HandleCall ¶ added in v0.0.16
Tool errors are returned as 200 {"error": "..."} to match the RPC-over-HTTP convention.
type SessionClearer ¶
type SessionClearer interface {
ClearSession(sessionKey string)
}
SessionClearer clears dispatcher queues and session contexts for a session.