Token导航 LogoToken导航TokenDH.com
aMCP (Tao12345666333) logo
开发工具stdio官方级别未说明来源级核验

aMCP (Tao12345666333)

MCP Server

AMCP是一个支持内置工具和MCP服务器集成的编码代理CLI,适用于开发效率和IDE集成。

工具数

8

提示词数

0

GitHub Stars

22

资源数

0
开发工具PythonClaude命令行工具Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

tao12345666333

提供方

tao12345666333

最后核验

2026/5/17 20:19

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uvx amcp-agent init

详细介绍

AMCP

](https://badge.fury.io/py/amcp-agent) ![CI](https://github.com/tao12345666333/amcp/actions) ![Python 3.11+](https://www.python.org/downloads/) ![License: Apache-2.0](https://opensource.org/licenses/Apache-2.0)

一个乐高风格的编码代理CLI,内置工具(grep、读取文件、bash执行)和MCP服务器集成,用于扩展功能(网络搜索等)。

十、: https://x.com/zhangjintao9020/status/1995170132973466018?s=20

特性

  • 内置工具:read_file、grep、bash、think、todo、apply_patch、write_file
  • MCP集成:连接到任何MCP服务器以扩展功能
  • 对话历史:跨运行的持续会话
  • 灵活的配置:基于YAML的代理规范
  • 工具调用:自动工具选择和执行
  • ACP支持:IDE集成的完整代理客户端协议支持(Zed等)
  • AGENTS.md支持:从自动加载项目特定规则 AGENTS.md 文件
  • 智能上下文压缩:具有动态阈值的智能上下文管理
  • 多代理系统:具有内置代理类型(编码器、资源管理器、规划器)的主/子代理架构
  • 事件总线:用于代理通信和可扩展性的发布/订阅系统
  • 挂钩系统:用于工具验证、日志记录和自定义行为的可扩展挂钩

安装

使用uvx快速运行(无需安装)

# Initialize config first (API keys, model settings)
uvx amcp-agent init

# Run the agent
uvx amcp-agent

# Run as ACP server (for IDE integration)
uvx amcp-agent acp serve

来自PyPI

# Install from PyPI
pip install amcp-agent

# Or with uv (requires virtual environment or --system flag)
uv pip install amcp-agent              # in a virtual environment
uv pip install --system amcp-agent     # global install without venv

# With Anthropic Claude support
pip install amcp-agent[anthropic]

来源(开发)

# Clone the repository
git clone https://github.com/tao12345666333/amcp.git
cd amcp

# using uv (recommended)
uv venv && source .venv/bin/activate
uv pip install -e .

# or with pip
python -m venv .venv && source .venv/bin/activate
pip install -e .

用法

# Initialize config
amcp init

# Agent with tool calling (default command)
amcp  # interactive mode with conversation history
amcp --once "create a hello.py file with a hello function"  # single message
amcp --list  # list available agent specifications
amcp --agent path/to/agent.yaml  # use custom agent spec
amcp --session my-session  # use specific session ID
amcp --clear  # clear conversation history

# MCP server management
amcp mcp tools --server exa
amcp mcp call --server exa --tool web_search_exa --args '{"query":"rust async"}'

# Run as ACP agent (for IDE integration)
amcp acp serve

ACP(代理客户端协议)支持

AMCP完全支持 代理客户端协议 用于与Zed等IDE集成。

特性

  • 会话管理:创建、加载和列出会话
  • 会话模式:切换 ask, architect,以及 code 模式

- ask:更改前请求许可 - architect:未实施的设计和规划 - code:实施的完整工具访问权限

  • Slash命令: /clear, /plan, /search, /help
  • 代理计划:复杂任务的可视化执行计划
  • 权限请求:用户对敏感操作的批准
  • 客户能力:使用客户端的文件系统和终端(如果可用)

以ACP代理身份运行

# Start the ACP agent server (stdio transport)
amcp acp serve

Zed集成

添加到Zed设置(~/.config/zed/settings.json):

{
  "agent": {
    "profiles": {
      "amcp": {
        "name": "AMCP",
        "provider": {
          "type": "acp",
          "command": "amcp",
          "args": ["acp", "serve"]
        }
      }
    },
    "default_profile": "amcp"
  }
}

内置工具

  • read_file:使用两种模式读取文本文件:

- *切片模式* (默认):读取特定行范围 - *缩进模式*:智能读取锚线周围的代码块,自动捕获周围的上下文(函数、类)

  • 全局正则表达式打印:使用ripgrep在文件中搜索模式
  • bash:执行bash命令进行文件操作和系统任务
  • 思考:内部推理和规划
  • 待办:管理待办事项列表,以跟踪复杂操作期间的任务
  • 应用程序_补丁:将基于差异的补丁应用于文件(建议编辑,请参阅 docs/apply-patch.md)
  • write_file:将内容写入文件(用于创建新的小文件)
  • 任务:生成用于并行任务执行的子代理

配置

CLI从以下位置加载MCP服务器 ~/.config/amcp/config.toml. 生成启动器配置:

amcp init

示例(与OpenAI兼容的API):

[servers.exa]
url = "https://mcp.exa.ai/mcp"

[servers.custom]
command = "npx"
args = ["-y", "@some/mcp-server"]
env.API_KEY = "your-key"

[chat]
api_type = "openai"  # "openai" (default) or "anthropic"
base_url = "https://api.openai.com/v1"
model = "gpt-4o"
api_key = "your-api-key"
mcp_tools_enabled = true
write_tool_enabled = true  # Enable/disable built-in write_file tool

示例(OpenAI响应API):

[chat]
api_type = "openai_responses"
model = "gpt-4o"
api_key = "your-api-key"

示例(人物克劳德):

[chat]
api_type = "anthropic"
model = "claude-sonnet-4-20250514"
api_key = "your-anthropic-api-key"  # or set ANTHROPIC_API_KEY env var

要使用Anthropic,请安装: pip install amcp-agent[anthropic]

挂钩系统

AMCP提供了一个灵活的钩子系统来扩展和定制代理行为。挂钩可以:

  • 执行前验证和修改工具输入
  • 执行后处理工具输出
  • 阻止危险作业
  • 记录和审计代理活动

快速示例

创建 .amcp/hooks.toml 在您的项目中:

[hooks.PreToolUse]
[[hooks.PreToolUse.handlers]]
matcher = "write_file|apply_patch"
type = "python"
script = "./scripts/validate-writes.py"
timeout = 30

[[hooks.PostToolUse.handlers]]
matcher = "*"
type = "command"
command = "echo 'Tool executed' >> /tmp/tool_log.txt"

docs/hooks.md 获取完整文档。

发展

设置开发环境

# Clone the repository
git clone https://github.com/tao12345666333/amcp.git
cd AMCP

# Install with development dependencies
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

运行测试

# Run all tests
make test

# Run with coverage
make test-cov

# Run specific test
pytest tests/test_tools.py -v

代码质量

# Lint code
make lint

# Format code
make format

# Type check
make type-check

贡献.md 详细的开发指南。

备注

  • rg (ripgrep)必须安装在grep工具的PATH上。
  • MCP服务器必须单独安装并可运行(stdio传输)。

许可证

阿帕奇-2.0

目录标签

目录标签

开发工具PythonClaude命令行工具编码代理本地部署CLI工具IDE集成开发效率多代理系统

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

8

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosession部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP