Sugar

v3.4.2Knowledge & Memorystable

Persistent memory for AI coding agents. Cross-session context, global knowledge, and autonomous task execution.

ai-agentsai-codingai-developmentai-memoryautonomous-ai
Share:
77
Stars
0
Downloads
0
Weekly
0/5

What is Sugar?

Sugar is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to persistent memory for ai coding agents. cross-session context, global knowledge, and autonomous task execution.

Persistent memory for AI coding agents. Cross-session context, global knowledge, and autonomous task execution.

This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Persistent memory for AI coding agents. Cross-session contex

Use Cases

Persistent memory for coding agents
Cross-session context management
Global knowledge and task execution
roboticforce

Maintainer

LicenseNOASSERTION
Languagepython
Versionv3.4.2
UpdatedMay 18, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

PIP

pip install sugarai

Manual Installation

pip install sugarai

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Sugar

Sugar is a persistent memory and autonomous task execution MCP server for AI coding agents, designed to solve the context loss problem that occurs between sessions in tools like Claude Code, Aider, and Goose. It maintains both project-level and global knowledge stores (SQLite databases) that agents can read and write across sessions, with optional semantic search for embedding-based memory retrieval. Developers use it to preserve decisions, coding preferences, architecture notes, and in-progress task queues so their AI coding assistant never starts from scratch.

Prerequisites

  • Python 3.11 or higher
  • pipx installed (recommended) or pip for installing the sugarai package
  • A CLI-based AI coding agent: Claude Code, OpenCode, Goose, or Aider
  • Optional: sentence-transformers library for semantic search (installed with the [memory] extra)
1

Install Sugar via pipx

Install Sugar using pipx for an isolated environment. Choose the appropriate extras based on what you need. The [memory] extra adds semantic search with sentence-transformers, and [github] adds GitHub integration.

# Basic install:
pipx install sugarai

# With semantic search (recommended):
pipx install 'sugarai[memory]'

# All features:
pipx install 'sugarai[all]'
2

Initialize Sugar in your project

Run Sugar in your project directory to create the local memory database and config file at .sugar/memory.db and .sugar/config.yaml. Global memories are stored at ~/.sugar/memory.db.

cd /path/to/your/project
sugar init
3

Register the Sugar MCP server with your AI agent

Add the Sugar memory MCP server to your AI coding agent. For Claude Code, use the `claude mcp add` command. For other agents, add it to their respective MCP config.

# For Claude Code:
claude mcp add sugar -- sugar mcp memory

# For manual config (claude_desktop_config.json):
# See examples section
4

Store initial project knowledge

Populate Sugar with your project's key decisions, conventions, and preferences so the agent can recall them in future sessions. Use scope: global for cross-project knowledge.

sugar remember "We use async/await everywhere, never callbacks" --type preference
sugar remember "JWT tokens use RS256 signing" --type decision
sugar remember "Database migrations use Alembic" --type architecture
5

Use Sugar tools from within your AI agent

Once connected, your AI coding agent can call the MCP tools directly: search_memory, store_learning, recall, get_project_context, and list_recent_memories. Ask your agent to recall context at the start of a session.

Sugar Examples

Client configuration

Claude Desktop config for the Sugar MCP memory server.

{
  "mcpServers": {
    "sugar": {
      "command": "sugar",
      "args": ["mcp", "memory"]
    }
  }
}

Prompts to try

Example prompts for an AI coding agent using Sugar memory tools.

- "Recall the project context and summarize what we were working on last session"
- "Search your memory for anything related to authentication in this project"
- "Store this decision: we chose Redis over Memcached for session storage because of pub/sub support"
- "What are my global coding preferences across all projects?"
- "List recent memories from the last week about database schema changes"

Troubleshooting Sugar

'sugar: command not found' after installing with pipx

Run `pipx ensurepath` and restart your terminal to add the pipx bin directory to your PATH. Alternatively, use `pip install sugarai` and ensure your pip bin directory is in PATH.

Semantic search not working or 'sentence-transformers not installed' error

Install Sugar with the memory extra: `pipx install 'sugarai[memory]'` (or `pipx upgrade --include-injected sugarai` then `pipx inject sugarai 'sugarai[memory]'`). Semantic search requires sentence-transformers which has significant download size on first use.

Agent cannot find project memories from previous sessions

Verify Sugar was initialized in the correct directory with `sugar init`. Project memories live in .sugar/memory.db relative to the project root — ensure the agent is started from the same project directory. Use `sugar memories` to list stored memories and confirm they exist.

Frequently Asked Questions about Sugar

What is Sugar?

Sugar is a Model Context Protocol (MCP) server that persistent memory for ai coding agents. cross-session context, global knowledge, and autonomous task execution. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Sugar?

Install via pip with: pip install sugarai. Then configure your AI client to connect to this MCP server.

Which AI clients work with Sugar?

Sugar works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Sugar free to use?

Yes, Sugar is open source and available under the NOASSERTION license. You can use it freely in both personal and commercial projects.

Browse More Knowledge & Memory MCP Servers

Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "sugar": { "command": "pip", "args": ["install", "sugarai"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Sugar?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides