freshcrate
Home > MCP Servers > memo-code

memo-code

A lightweight coding agent that runs in your terminal.

Description

A lightweight coding agent that runs in your terminal.

README

Memo Code logo

Memo Code

A lightweight coding agent for terminal and web workflows.

Website · Documentation · 中文文档

Test Coverage npm version

Memo Code demo


🌱 Origin

Memo started with a simple question: What does the simplest Agent look like?

In the second half of 2024, while writing my tech blog post Agent = LLM + TOOL, I began thinking about the essence of Agents — nothing more than LLM + Tool loops. But when I actually started implementing it, I discovered that behind every seemingly simple feature lies a mountain of engineering details:

  • Best practices for system prompts
  • Tool design and security boundaries
  • Multi-model switching and compatibility
  • Context management (especially long-session compaction strategies)
  • Tricky TUI interactions
  • Multi-workspace support for Web version
  • npm package distribution and hot-reloading
  • ...

This project grew from a small demo into an indispensable "productivity assistant" in my daily development — it helps me update documentation, manage GitHub Issues, debug projects... While I still use Claude Code and Codex CLI as my primary development tools, Memo quietly handles the tedious tasks in the background.

This is a personal project built from scratch. All architectural designs and technical decisions are independent explorations and trade-offs. If you're interested in the engineering implementation of Agents, I hope Memo can give you some reference.


✨ Features

Feature Description
Terminal + Web Dual Mode Smooth TUI in terminal, Web Console with multi-workspace and concurrent real-time sessions (up to 20)
Smart Context Management Auto-compact long session context, configurable threshold, millisecond-level token estimation
Skills System Skills integration, auto-discover SKILL.md, activate by scenario
Deep MCP Integration Local/remote MCP servers, OAuth login, runtime dynamic switching
Enterprise-Grade Security Tool approval system (auto-approve/manual-approve), supports once/session/deny modes
OpenAI Compatible Works with any OpenAI-compatible API, flexible multi-Provider configuration

🚀 Quick Start

1. Install

npm install -g @memo-code/memo
# or pnpm / yarn / bun

2. Configure API Key

export OPENAI_API_KEY=your_key
# or configure other compatible APIs

3. Run

memo

First run will guide you through Provider/Model setup and save config to ~/.memo/config.toml.


📖 Usage Modes

Mode Command Scenario
Interactive memo Default, full TUI experience
One-shot memo --once "prompt" Run once and exit
Resume Session memo --prev Load latest session for current directory
Web Console memo web --host 127.0.0.1 --port 5494 --open Browser-based operation

🏗️ Architecture

memo-code/
├── packages/
│   ├── core/          # Core logic: Session state machine, Config handling
│   ├── tools/         # Tool routing, MCP Client management, built-in tools (exec_command, read_text_file, apply_patch...)
│   ├── tui/           # Terminal runtime: CLI entry, interactive TUI
│   ├── web-ui/        # Web frontend: React components
│   └── web-server/    # Web backend: session management, API adapter
└── docs/              # Technical documentation

Technical Highlights:

  • Architecture: Clean Core / Tools / TUI separation, state-machine driven session management
  • Testing: Core + Tools coverage > 70%, complete unit + integration tests
  • Protocol: Native MCP (Model Context Protocol) support, can integrate any MCP tool server
  • Token Estimation: Real-time context monitoring based on tiktoken, configurable auto-compaction strategy
  • Distribution: npm package with pre-built Web assets, hot-reloading without perception

🔧 Built-in Tools

  • exec_command / write_stdin - Execute Shell commands
  • apply_patch - Structured patch editing (*** Begin Patch/*** End Patch)
  • read_text_file / read_media_file / read_files / write_file / edit_file / list_directory / search_files - Filesystem read/write/search
  • webfetch - Paged web fetching with markdown extraction and policy guards
  • MCP resource access - list_mcp_resources, read_mcp_resource
  • update_plan - Structured task progress management
  • get_memory - Persistent memory reading

⚙️ Config Example

current_provider = "openai_compatible"
auto_compact_threshold_percent = 80

[[providers.openai_compatible]]
name = "openai_compatible"
env_api_key = "OPENAI_API_KEY"
model = "gpt-4.1-mini"
base_url = "https://api.openai.com/v1"

# MCP Server
[mcp_servers.github]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]

# Skills
active_skills = ["./skills/doc-writing/SKILL.md"]

🛠️ Development

# Install dependencies
pnpm install

# Run locally
pnpm start

# Build for distribution
pnpm run build

# Test
pnpm test              # all tests
pnpm run test:coverage # coverage report (threshold ≥70%)

# Format
pnpm run format        # write
pnpm run format:check  # CI check

Contributors

Contributors

📄 License

MIT License

Release History

VersionChangesUrgencyDate
v0.8.56## 更新说明 - 重构 webfetch 工具:支持分页抓取、HTML 提取为 Markdown、robots 策略校验、私网/本地地址防护。 - 新增可配置项:User-Agent、robots 开关、超时、最大响应体、私网拦截开关。 - 完整补充 webfetch 测试与文档,并更新构建 external 配置以确保 CI 构建稳定。Low2/26/2026
v0.8.50**Full Changelog**: https://github.com/minorcell/memo-code/compare/v0.8.10...v0.8.50Low2/23/2026
v0.8.10## What's Changed - Added context length display to web-ui - Added a message queue mode to support editing and modifying queue messages **Full Changelog**: https://github.com/minorcell/memo-code/compare/v0.8.9...v0.8.10Low2/18/2026
v0.8.9**Full Changelog**: https://github.com/minorcell/memo-code/compare/v0.8.8...v0.8.9Low2/18/2026
v0.8.5## What's Changed * chore: auto tag and public release by @minorcell in https://github.com/minorcell/memo-code/pull/179 * feat: add `-once` and `-prev` args for memo cli by @minorcell in https://github.com/minorcell/memo-code/pull/180 * feat: support mcp server auth by @minorcell in https://github.com/minorcell/memo-code/pull/182 * feat: added context compression mechanism by @minorcell in https://github.com/minorcell/memo-code/pull/186 * test: expand runtime coverage for compaction and defaultsLow2/16/2026
v0.8.0## What's new in Memo Code v0.8.0 - Full support for Skills! Memo is now compatible with Skills from other Agents, meaning you no longer need to maintain separate Skills documentation specifically for Memo. - Support for GitHub Pull Request Review! Yes, Memo can now review your GitHub PRs and comment directly on them. - More detailed model configuration. To support more models, Memo's configuration file now supports additional parameters. ## What's Changed * docs by @minorcell in https:Low2/14/2026
v0.7.3## What's Changed * fix: tui by @minorcell in https://github.com/minorcell/memo-code/pull/153 * fix: normalize pasted CRLF in composer input by @minorcell in https://github.com/minorcell/memo-code/pull/154 * chore: sync dev into main by @minorcell in https://github.com/minorcell/memo-code/pull/156 * feat(tools): cache mcp resource calls with ttl and dedupe by @minorcell in https://github.com/minorcell/memo-code/pull/157 * feat: mcp cache by @minorcell in https://github.com/minorcell/memo-cLow2/13/2026
v0.7.2## What's Changed * fix: resolve issues #135-#146 and harden tools/core by @minorcell in https://github.com/minorcell/memo-code/pull/149 **Full Changelog**: https://github.com/minorcell/memo-code/compare/v0.7.0...v0.7.2Low2/12/2026
v0.7.0## Summary This release focuses on reliability and operator clarity across the TUI and tool stack. The most important change is a simplification of `apply_patch` from diff-style parsing to deterministic direct string replacement. We also shipped multiple interaction fixes in the TUI path and tightened behavior/docs alignment to reduce runtime surprises. ## Highlights - Feature: `apply_patch` now uses direct string replacement with single-edit and batch-edit modes. - Improvement: TUI rendering pLow2/11/2026
v0.6.55## memo-cli v0.6.55 This release focuses on runtime safety, tool-call reliability, and startup experience. ### Highlights - Security hardening for shell execution in tool runtime: - Added dangerous command interception for destructive patterns (for example `rm -rf /`, `rm -rf ~`, raw disk overwrite/format operations). - Returns a structured system response instead of executing high-risk commands. - Startup system prompt improvement: - When an `AGENTS.md` file exists at the launch root, Low2/10/2026
v0.6.32## Summary This release finalizes a full TUI package migration and streamlines the repository layout around a dedicated `packages/tui` module. It also improves approval/tool status maintainability by replacing scattered hardcoded values with centralized constants and typed status flow. Documentation, web docs, and CI references were synchronized so contributors can follow the new structure consistently. ## Highlights - Feature: Migrated legacy CLI/TUI implementation into `packages/tui` and updaLow2/10/2026
v0.6.3## What's Changed * ci: add deploy web ci by @minorcell in https://github.com/minorcell/memo-cli/pull/88 * ci: fix web pages deploy install by @minorcell in https://github.com/minorcell/memo-cli/pull/89 * fix(web): restore logo and favicon path on pages by @minorcell in https://github.com/minorcell/memo-cli/pull/90 * fix(web): support custom domain asset paths by @minorcell in https://github.com/minorcell/memo-cli/pull/91 * chore: add issue governance automation and templates by @minorcell Low2/7/2026
v0.6.0## Summary memo-cli v0.6.0 focuses on stronger editing workflows and safer runtime guardrails. This release adds batch edit support and context length controls while tightening sandbox, approval, and tool-execution protections. It also improves session/tool integration and developer documentation for release automation. Users should see better reliability, safer defaults, and a smoother CLI/tooling experience. ## Highlights - Feature: Added batch edit support in the edit tool to improve multi-cLow2/6/2026
v0.5.15## What's Changed * feat: support cli to manage MCP configuration by @minorcell in https://github.com/minorcell/memo-cli/pull/69 **Full Changelog**: https://github.com/minorcell/memo-cli/compare/v0.4.5...v0.5.15Low2/5/2026
v0.4.5## 🚀 What's New in v0.4.5 ### 🆕 新特性 * **版本更新机制**:新增自动检测与更新提示,确保你始终运行在最新版本。 * **工具审批功能**:引入工具执行前的授权流程,提升了 AI 调用本地工具的安全性和可控性。 ### 🛠️ 修复与优化 * **交互体验**:修复了输入框在特定操作下的交互异常问题,输入更流畅。 * **渲染性能**:针对 CLI 界面在高频输出时的闪烁问题进行了深度优化,视觉体验更稳定。 * **结果展示**:优化了部分工具返回结果过长的问题,通过截断或精简逻辑提升了阅读效率。 **Full Changelog**: [https://github.com/minorcell/memo-cli/compare/v0.3.0...v0.4.5](https://github.com/minorcell/memo-cli/compare/v0.3.0...v0.4.5)Low2/4/2026
v0.2.1## What's Changed * feat: 新增new命令 by @minorcell in https://github.com/minorcell/memo-cli/pull/45 * refactor: unify tool routing by @minorcell in https://github.com/minorcell/memo-cli/pull/46 * refactor: rewrite the system prompts and modify the implementation by @minorcell in https://github.com/minorcell/memo-cli/pull/51 * docs by @minorcell in https://github.com/minorcell/memo-cli/pull/52 * refactor: 替换所有Bun API为NODE by @minorcell in https://github.com/minorcell/memo-cli/pull/53 * ci: 重构cLow2/2/2026
v0.1## What's Changed * refactor: switch from node api to bun api by @minorcell in https://github.com/minorcell/memo-cli/pull/1 * docs: add en file by @minorcell in https://github.com/minorcell/memo-cli/pull/2 * build: engineering configuration by @minorcell in https://github.com/minorcell/memo-cli/pull/3 * docs: renamed`AGENTS.md` to `CLAUDE.md` makes the agent file more universal. by @minorcell in https://github.com/minorcell/memo-cli/pull/4 * feat: supports multi-turn conversations, history Low1/30/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

DesktopCommanderMCPThis is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilitiesv0.2.38
@baseplate-dev/plugin-aiAI agent integration plugin for Baseplate — generates AGENTS.md, CLAUDE.md, .mcp.json, and .agents/ configuration files0.6.8
@senso-ai/shipablesCLI for installing, managing, and publishing AI agent skills from the Shipables registry0.1.2
loaditout-mcp-serverMCP server for discovering and installing AI agent skills from Loaditout0.2.4
neverinfamous-agent-skillsFoundational AI agent metacognitive skills and workflows for the Adamic ecosystem.1.1.2