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.4.0.tar.gz (480.1 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.4.0-py3-none-any.whl (154.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: merco-0.4.0.tar.gz
  • Upload date:
  • Size: 480.1 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.4.0.tar.gz
Algorithm Hash digest
SHA256 aa2e0db91032871dfb980840511481d596bd7b2fffa5d665cbfc4fdf74d7edb3
MD5 c3316288340a9ad9a9e6411dce11521f
BLAKE2b-256 3679c71300357a76770ebae2d93b38f15a1980fd57a9c8a686381824cb7ae463

See more details on using hashes here.

File details

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

File metadata

  • Download URL: merco-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 154.5 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa03ea1b94b69ae50b61d23409bf0c9db3c1e74409a39533e95dab1275aa1fec
MD5 5b28be256282456a861ea6984701b7a0
BLAKE2b-256 61a587a10f8e4b47ec651d9e4160bbc06e95a2e9ae7a3df2656861d7588e9926

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