mcp

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mcp implements the Model Context Protocol server for Engram.

This exposes memory tools via MCP stdio transport so ANY agent (OpenCode, Claude Code, Cursor, Windsurf, etc.) can use Engram's persistent memory just by adding it as an MCP server.

Tool profiles allow agents to load only the tools they need:

engram mcp                    → all 14 tools (default)
engram mcp --tools=agent      → 11 tools agents actually use (per skill files)
engram mcp --tools=admin      → 3 tools for TUI/CLI (delete, stats, timeline)
engram mcp --tools=agent,admin → combine profiles
engram mcp --tools=mem_save,mem_search → individual tool names

Index

Constants

This section is empty.

Variables

View Source
var ProfileAdmin = map[string]bool{
	"mem_delete":   true,
	"mem_stats":    true,
	"mem_timeline": true,
}

ProfileAdmin contains tools for TUI, dashboards, and manual curation that are NOT referenced in any agent skill or memory protocol.

View Source
var ProfileAgent = map[string]bool{
	"mem_save":              true,
	"mem_search":            true,
	"mem_context":           true,
	"mem_session_summary":   true,
	"mem_session_start":     true,
	"mem_session_end":       true,
	"mem_get_observation":   true,
	"mem_suggest_topic_key": true,
	"mem_capture_passive":   true,
	"mem_save_prompt":       true,
	"mem_update":            true,
}

ProfileAgent contains the tool names that AI agents need. Sourced from actual skill files and memory protocol instructions across all 4 supported agents (Claude Code, OpenCode, Gemini CLI, Codex).

View Source
var Profiles = map[string]map[string]bool{
	"agent": ProfileAgent,
	"admin": ProfileAdmin,
}

Profiles maps profile names to their tool sets.

Functions

func NewServer

func NewServer(s *store.Store) *server.MCPServer

NewServer creates an MCP server with ALL tools registered (backwards compatible).

func NewServerWithTools

func NewServerWithTools(s *store.Store, allowlist map[string]bool) *server.MCPServer

NewServerWithTools creates an MCP server registering only the tools in the allowlist. If allowlist is nil, all tools are registered.

func ResolveTools

func ResolveTools(input string) map[string]bool

ResolveTools takes a comma-separated string of profile names and/or individual tool names and returns the set of tool names to register. An empty input means "all" — every tool is registered.

Types

This section is empty.

Jump to

Keyboard shortcuts

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