mcp

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package mcp exposes memini over the Model Context Protocol. It is a thin adapter over the same service.Service the REST API uses, served over stdio and Streamable HTTP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPHandler

func HTTPHandler(svc *service.Service, nsHeader, defaultNS, apiKey string) http.Handler

HTTPHandler returns an http.Handler serving MCP over Streamable HTTP. The tenant namespace is taken from nsHeader when present, else defaultNS; tool calls may still override it per-call. An invalid header value is rejected with 400 (matching the REST API) rather than silently falling back to the default tenant. When apiKey is non-empty, requests must present it as a bearer token — required for any remote (non-localhost) deployment.

func NewServer

func NewServer(svc *service.Service, defaultNS string) *mcpsdk.Server

NewServer builds an MCP server exposing memini's memory tools. defaultNS is used whenever a tool call omits the namespace argument.

func RunStdio

func RunStdio(ctx context.Context, svc *service.Service, defaultNS string) error

RunStdio serves the MCP server over stdio, blocking until ctx is cancelled or the client disconnects. Used by `memini mcp` for local agent integrations.

Types

This section is empty.

Jump to

Keyboard shortcuts

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