Skip to main content

AI-driven self-improving development platform

Project description

🧠 merco — Mercury Code

Mer(cury) + Co(de) = 默客 — 默默写代码的 AI 伙伴

一个轻量、高效、可落地的 Python 智能开发助手,运行在你的终端里。


✨ 特性亮点

功能 说明
🤖 Agent 循环 用户输入 → LLM → 工具调用 → 循环,完整链路持久化
🖥️ 流式输出 thinking/content 双面板实时显示,推理过程一目了然
🛡️ 安全守卫 敏感命令执行前确认,30+ 条默认规则,可自定义
💾 Session 记忆 SQLite WAL 持久化,自动恢复,/sessions 切换历史
🔌 插件系统 可扩展的插件架构,内置 Skill/Scheduler/MCP 等插件
📊 可观察性 /report 显示 token 统计、LLM 延迟、工具分布

🚀 快速开始

# 安装
pip install merco
# 或
uv tool install merco

# 交互式配置(首次运行引导)
merco setup

# 启动
merco

也支持手动配置:~/.config/merco/config.json 或项目目录 ./merco.json


📁 项目结构

merco/
├── agents/        # Agent 抽象 + 子 Agent
├── cli/          # REPL 命令行界面
├── context/      # 上下文管道 + 处理器
├── core/         # Agent 核心循环 + LLM + 配置
├── hooks/        # 生命周期事件
├── memory/       # Session 持久化 + 记忆召回
├── mcp/          # MCP 协议客户端
├── observability/ # 可观察性(统计/报告)
├── plugins/      # 插件系统 + 内置插件
├── sandbox/      # 安全守卫 + 快照
├── scheduler/    # 定时任务调度
├── skills/       # Skill 加载/注册/检索
├── tools/        # 工具集(Bash/文件/Web)
└── web/          # Web API(可选)

🗂️ REPL 命令

/new       新会话
/sessions  历史会话列表 + 切换
/report    会话统计报告
/model     当前模型
/context   上下文用量
/tools     可用工具
/skills    已加载技能
/help      帮助
/exit      退出

⚙️ 配置示例

{
  "model": "claude-sonnet-4-20250514",
  "stream_thinking": true,
  "stream_content": true,
  "stream_render_interval": 0.3,
  "tool_guard_enabled": true
}

🏗️ 架构状态

模块 状态 说明
core/ 🟢 Agent 循环 + LLM + 配置
tools/ 🟢 Bash + 文件读写 + Web Fetch
skills/ 🟢 加载/注册/检索 + 自动注入
sandbox/ 🟢 ToolGuard + Diff 预览
observability/ 🟢 hooks 驱动 Observer
hooks/ 🟢 Agent 生命周期事件
plugins/ 🟢 插件管理器 + 内置插件
scheduler/ 🟢 Cron 定时任务
memory/ 🟡 Session 持久化,召回增强中
context/ 🟡 上下文压缩管道
agents/ 🟡 Agent Profile + 子 Agent
web/ 🔴 FastAPI 占位(未激活)

📖 项目文档

详细进展、架构决策、经验教训见 docs/project-vision/

📄 许可证

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

merco-0.5.0.tar.gz (729.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

merco-0.5.0-py3-none-any.whl (158.7 kB view details)

Uploaded Python 3

File details

Details for the file merco-0.5.0.tar.gz.

File metadata

  • Download URL: merco-0.5.0.tar.gz
  • Upload date:
  • Size: 729.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for merco-0.5.0.tar.gz
Algorithm Hash digest
SHA256 54add30b416b9fbc072809e7b7211276f4762d7c46b2e3540d6951ddaa231073
MD5 ac19e054beae4039fa51f08e4ad7957f
BLAKE2b-256 7f42ba640fb5cb72a25b79642081f965b81c10ad25f1e7189f3b89f47d6aced3

See more details on using hashes here.

File details

Details for the file merco-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: merco-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 158.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for merco-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5217a8edc431ba3f75fc4fa3aede7f516bfa4374a78844e1683f14e495e6793d
MD5 078e316686745e20370961bf1e370055
BLAKE2b-256 4a7697f33ff870f310b258fe453aaeb7ccbcadb69de8d34f0caa524eab607905

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page