Show HN: 让编码代理通过 1 个 YAML 文件获得 lint/测试/格式化权限

1作者: scosman10 个月前
我为自己构建的一个有趣的小项目。为你的开发命令(lint、格式化、测试等)创建一个 YAML 文件,然后通过 MCP 将这些命令暴露给编码代理。<p>有点像 package.json 的脚本,但适用于代理运行时,并且命令通过 MCP 调用。<p>1. 简单设置:只需一个 YAML 文件即可为你的编码代理创建一个自定义 MCP 服务器。将 YAML 文件添加到你的仓库中,与你的团队共享。<p>2. 工具发现:编码代理知道哪些开发工具可用以及它们所需的确切参数。不再需要猜测 CLI 字符串。<p>3. 提高安全性:限制代理可以运行的命令。验证代理生成的参数(例如,确保文件路径位于项目中,而不是 `~/.ssh/id_rsa`)。<p>3. 适用于任何 MCP 可用的地方:Cursor、Windsurf、Cline 等<p>4. 速度:使用 MCP 可以解锁并行执行,生成命令所需的 token 更少,并消除在需要迭代的命令中出现的错误。<p>5. 更多功能:去除 ANSI 代码/控制字符,加载 .env 文件,定义所需的密钥而无需签入,支持退出代码/stdout/stderr 等<p><a href="https://github.com/scosman/hooks_mcp" rel="nofollow">https://github.com/scosman/hooks_mcp</a>
查看原文
Fun little project I built for myself. Create a YAML file for your dev-commands (lint, format, tests, etc), then expose those to coding agents via MCP.<p>Kinda like package.json scripts, but for agent runtimes, and commands are invoked via MCP.<p>1. Simple setup: one YAML file is all it takes to create a custom MCP server for your coding agents. Add the YAML to your repo to share with your team.<p>2. Tool discovery: coding agents know which dev-tools are available and the exact arguments they require. No more guessing CLI strings.<p>3. Improved security: limit which commands agents can run. Validate the arguments agents generate (e.g. ensure a file path is inside the project, not `~&#x2F;.ssh&#x2F;id_rsa`).<p>3. Works anywhere MCP works: Cursor, Windsurf, Cline, etc<p>4. Speed: using MCP unlocks parallel execution, requires fewer tokens for generating commands, and eliminates errors in commands requiring iteration.<p>5. And more: strip ANSI codes&#x2F;control characters, .env file loading, define required secrets without checking them in, supports exit codes&#x2F;stdout&#x2F;stderr, etc<p><a href="https:&#x2F;&#x2F;github.com&#x2F;scosman&#x2F;hooks_mcp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;scosman&#x2F;hooks_mcp</a>