AI Skill Hub 推荐使用:agent-layer 是一款优质的MCP工具。AI 综合评分 7.1 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。
agent-layer 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
agent-layer 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/conn-castle/agent-layer
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"agent-layer": {
"command": "npx",
"args": ["-y", "agent-layer"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 agent-layer 执行以下任务... Claude: [自动调用 agent-layer MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"agent-layer": {
"command": "npx",
"args": ["-y", "agent-layer"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
<picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/conn-castle/agent-layer-web/main/static/img/branding/logo-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/conn-castle/agent-layer-web/main/static/img/branding/logo.svg"> <img src="https://raw.githubusercontent.com/conn-castle/agent-layer-web/main/static/img/branding/logo.svg" alt="Agent Layer logo" width="120"> </picture>
Some MCP servers require a specific runtime or launcher to be installed locally. Agent Layer does not install these dependencies; it only runs the command you configure.
Examples: - Node-based servers often use npx in the command field (requires Node.js + npm). - Python/uv-based servers often use uvx in the command field (requires uv/uvx on your PATH).
If a server fails to start with “No such file or directory,” verify the command exists and is on your PATH, or set command to the full path of the executable.
Install once per machine; choose one:
Run al wizard any time to interactively configure the most important settings:
.agent-layer/.env)Non-interactive profile mode is also available:
```bash
Initialize a repo (run from any subdirectory):
cd /path/to/repo
al init
Then run an agent:
al antigravity
Optional health check:
al doctor
Notes: - al init prompts to run al wizard after seeding files. Use al init --no-wizard to skip; non-interactive shells skip automatically. - al init is intended to be run once per repo. If the repo is already initialized, use al upgrade plan and al upgrade to refresh template-managed files. - By default al init first walks up for an ancestor .agent-layer/, then for an ancestor .git. To install a separate Agent Layer in a subfolder of an existing repo (for example a sub-project that needs its own .agent-layer/), pass al init --here to target the current directory. - al upgrade is the recommended path. For CI-safe non-interactive apply, use al upgrade --yes --apply-managed-updates. Add --apply-memory-updates and/or --apply-deletions only when you explicitly want those categories. - al upgrade automatically creates a managed-file snapshot and rolls changes back if an upgrade step fails. Snapshots are written under .agent-layer/state/upgrade-snapshots/. - Agent Layer does not install clients. Install the target client CLI and ensure it is on your PATH (Antigravity agy, Claude Code CLI, Codex, Copilot CLI, VS Code, etc.).
---
al wizard --profile /path/to/profile.toml
.agent-layer/config.toml (main configuration; human-editable)al.version (repo pin; required)instructions/ (numbered *.md fragments; lexicographic order)skills/ (workflow markdown; one skill source per command, as <name>/SKILL.md directories)commands.allow (approved shell commands; line-based)gitignore.block (managed .gitignore block template; customize here).gitignore (ignores repo-local launchers, template copies, and backups inside .agent-layer/).env (tokens/secrets; gitignored)Repo-local launchers and template copies live under .agent-layer/ and are ignored by .agent-layer/.gitignore.
You can edit all configuration files by hand. al wizard updates config.toml (approvals, agents/models, MCP servers, warnings) and .agent-layer/.env (secrets); it does not touch instructions, skills, or commands.allow.
Edit this file directly or use al wizard to update it. This is the only structured config file.
Example:
```toml [approvals]
url = "https://example.com/mcp" headers = { Authorization = "Bearer ${AL_EXAMPLE_TOKEN}" }
[[mcp.servers]] id = "local-mcp" enabled = false transport = "stdio" command = "my-mcp-server" args = ["--flag", "value"] env = { MY_TOKEN = "${AL_MY_TOKEN}" }
[warnings]
noise_mode = "default" instruction_token_threshold = 10000 mcp_server_threshold = 15 mcp_tools_total_threshold = 60 mcp_server_tools_threshold = 25 mcp_schema_tokens_total_threshold = 30000 mcp_schema_tokens_server_threshold = 20000
Agent-specific passthrough keys in `agents.codex.agent_specific` or `agents.claude.agent_specific` override Agent Layer-managed keys when they collide. Agent Layer emits a warning on every sync if you override managed keys. Codex project trust is managed automatically for the current absolute repo root.
#### Built-in placeholders
Agent Layer provides a built-in `${AL_REPO_ROOT}` placeholder for file paths in MCP server configs.
It expands to the absolute repo root during `al sync` and `al doctor`, and it does **not** need to be in `.env`.
Paths that start with `${AL_REPO_ROOT}` or `~` are expanded and normalized; other relative paths are passed through as-is.
Example:
toml [[mcp.servers]] id = "filesystem" enabled = false transport = "stdio" command = "npx" args = ["-y", "@modelcontextprotocol/server-filesystem", "${AL_REPO_ROOT}/."] ```
Some default MCP servers exclude VS Code via the clients field:
You can override these exclusions by editing clients in your config.toml.
http_transport)For HTTP MCP servers, http_transport controls how al doctor connects:
sse (default)streamableOmit http_transport to default to sse.
[warnings])Warning thresholds are optional. When a threshold is omitted, its warning is disabled. Values must be positive integers (zero/negative are rejected by config validation). al sync uses instruction_token_threshold and, when version_update_on_sync = true, warns if a newer Agent Layer release is available. al doctor evaluates all configured MCP warning thresholds.
Set version_update_on_sync = true to opt in to update warnings during al sync and al <client>; omit it or set it to false to keep update warnings limited to al init, al doctor, and al wizard. Set noise_mode = "default" to keep all warnings (recommended), noise_mode = "reduce" to hide only suppressible non-critical warnings, or noise_mode = "quiet" to suppress agent-layer informational output. Errors still print, client output is unaffected, and al doctor always prints warnings regardless of noise mode.
Use al <client> --quiet (or -q) for one-off quiet runs; the flag always wins over config.
approvals.mode)These modes control whether the agent is allowed to run shell commands and/or MCP tools without prompting. Edit them to match your team's preferences; al wizard can update approvals.mode.
all: auto-approve both shell commands and MCP tool calls (where supported)mcp: auto-approve only MCP tool calls; shell commands still require approval (or are restricted)commands: auto-approve only shell commands; MCP tool calls still require approvalnone: approve nothing automaticallyyolo: skip all permission prompts where the client supports it (sends --dangerously-skip-permissions to Claude, approval_policy=never + sandbox_mode=danger-full-access + web_search=live to Codex, --yolo to Copilot CLI, chat.tools.global.autoApprove to VS Code); intended for sandboxed/ephemeral environmentsClient notes: - Some clients do not support all approval types; Agent Layer generates the closest supported behavior per client.
Codex may still deny or override these settings if its requirements.toml disallows them.
API tokens and other secrets live in .agent-layer/.env (always gitignored).
Important: Only environment variables that start with the AL_ prefix are sourced from .env (others are ignored). This convention avoids conflicts with your shell environment and ensures Agent Layer's variables don't override existing environment variables when VS Code terminals inherit the process environment.
Example keys: - AL_CONTEXT7_API_KEY - AL_TAVILY_API_KEY - AL_GITHUB_PERSONAL_ACCESS_TOKEN (only when using the optional GitHub MCP server)
Your existing process environment takes precedence. .agent-layer/.env fills missing keys only, and empty values in .agent-layer/.env are ignored (so template entries cannot override real tokens). This behavior is consistent whether launching via al commands or repo-local launchers like open-vscode.app, open-vscode.sh, or open-vscode.command.
[mcp]
Common usage:
al antigravity
al claude
al codex
al copilot
al vscode
If MCP servers that use npx are failing in VS Code, your GUI environment may not see a user-directory Node install. Install Node via Homebrew (brew install node) so VS Code can find node and npx, and avoid per-user installs that only exist in shell profiles.
Some VS Code extensions (for example Peacock) write settings through the VS Code configuration API in a way that can land inside the Agent Layer-managed block in .vscode/settings.json.
If that happens, Agent Layer will replace that managed block on the next al sync, and those extension-written settings will be removed.
Fix: 1. Manually edit .vscode/settings.json and move extension-owned settings outside the managed marker block (// >>> agent-layer to // <<< agent-layer). 2. If the managed block is currently the last block in the file, add a user-owned tail anchor key after it:
{
// >>> agent-layer
// ... Agent Layer managed settings ...
// <<< agent-layer
"__settingsTailAnchor": 0
}
This keeps a stable non-managed tail position for extension writes.
---
al vscode is the single command for launching VS Code with both Codex and Claude extension support. It is enabled when either [agents.vscode] or [agents.claude_vscode] is set to enabled = true in config.toml.
[agents.vscode] is enabled, CODEX_HOME is set for the Codex extension.[agents.claude_vscode] is enabled, Claude files (.mcp.json, .claude/settings.json) are generated. YOLO mode sets claudeCode.allowDangerouslySkipPermissions in .vscode/settings.json.[agents.claude] local_config_dir = true is set, al claude sets CLAUDE_CONFIG_DIR for per-repo settings and caches isolation. For al vscode, CLAUDE_CONFIG_DIR is set only when both local_config_dir = true and [agents.claude_vscode] is enabled; otherwise al vscode clears only stale repo-local values and preserves user-defined non-repo values. This is opt-in; when disabled (the default), Claude uses your global ~/.claude/ configuration. For al claude only, a user-set CLAUDE_CONFIG_DIR pointing outside the repo is preserved even when local_config_dir is disabled. Note: auth credentials are stored globally in Claude Code's OS credential store (macOS Keychain service "Claude Code-credentials"; Linux libsecret/gnome-keyring) regardless of this setting (upstream limitation).--no-sync to skip sync before opening VS Code.The Codex VS Code extension reads CODEX_HOME and the Claude extension reads CLAUDE_CONFIG_DIR from the VS Code process environment at startup.
Agent Layer provides repo-specific launchers in .agent-layer/ that set CODEX_HOME (and CLAUDE_CONFIG_DIR when both local_config_dir and agents.claude_vscode are enabled) correctly for this repo:
Launchers: - macOS: open-vscode.app (recommended; VS Code in /Applications or ~/Applications) or open-vscode.command (uses code CLI) - Linux: open-vscode.desktop or open-vscode.sh (uses code CLI; shows a dialog if missing)
These launchers invoke al vscode, so the al CLI must be available on your PATH. al vscode also runs launch preflight checks and fails fast with guidance when code is missing on PATH or .vscode/settings.json has a managed-block marker conflict.
If you use the CLI-based launchers, install the code command from inside VS Code: - macOS: Cmd+Shift+P -> "Shell Command: Install 'code' command in PATH" - Linux: Ctrl+Shift+P -> "Shell Command: Install 'code' command in PATH"
Note: Codex authentication is per repo because each repo uses its own CODEX_HOME. When you open VS Code with a different repo, you will need to reauthenticate with Codex. If local_config_dir = true is enabled under [agents.claude], Claude settings and caches are isolated per repo (via CLAUDE_CONFIG_DIR). Known upstream limitation: Claude Code currently stores auth credentials in the OS credential store (macOS Keychain service "Claude Code-credentials"; Linux libsecret/gnome-keyring) regardless of CLAUDE_CONFIG_DIR, so authentication is always shared globally until this is fixed upstream.
For contributor-level implementation details, see docs/architecture/vscode-launch.md.
---
agent_specific.permissions.deny = ["AskUserQuestion"]
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,agent-layer 是一款质量良好的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | agent-layer |
| 原始描述 | 开源MCP工具:A tool for unifying instructions, skills, and MCP servers for various coding age。⭐7 · Go |
| Topics | mcpagentagentic-aiclaudecodexgeminigo |
| GitHub | https://github.com/conn-castle/agent-layer |
| License | MIT |
| 语言 | Go |
收录时间:2026-05-22 · 更新时间:2026-05-22 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端