Baton

dev.dudko由 dudko.dev 发布v0.2.0更新于 Oct 25, 2026

Local MCP server for Baton: edit git-native API requests, collections, environments and scripts.

发布方自己的服务:PDF to Markdown

已验证STDIO仅桌面文件与存储开发者工具

概览

AI 生成的概览

Baton 的本地 MCP 服务器:Baton 是 git 原生的 API 客户端,助手可读取和编辑工作区中的请求、集合、环境与脚本。

可以做什么
  • 查看工作区:集合、环境、定时任务、请求的方法、URL 与标签,以及应用是否已连接。
  • 读写请求:获取解析后或原始 YAML,新建或更新、移动或重命名、删除请求。
  • 管理集合与环境:创建或替换集合和文件夹,列出并写入环境变量与密钥名称。
  • 编辑脚本:读写前置请求、测试和共享库脚本。
  • 执行请求与集合,并管理已保存的响应示例和本地 mock 服务。
  • 仅应用模式:查看桌面应用中打开的内容,并在其中打开某个请求。
适用场景
当你的 API 请求、集合和环境以 YAML 文件形式存放在 Baton 工作区,并希望助手在 git 审查下起草、整理或补充文档时适用。应用模式适合希望编辑以草稿形式提交、发送通过桌面应用及其密钥执行的团队。
运行要求
通过 npm 包 @dudko.dev/baton-mcp 以 stdio 在本地运行,需要 Node.js 24 或更高版本。工作区文件夹必须包含 baton.yaml,默认使用当前目录,否则需传入 --workspace。未声明任何认证或环境变量。可选参数:--allow-run 允许在文件模式下执行请求,--agent 指定应用横幅中显示的助手名称。
安装前请注意
文件模式下助手会直接写入工作区的 YAML 文件,改动应经 git 审查;除非加上 --allow-run,否则不会执行请求。应用模式下,向生产环境发送请求和删除操作都需你在应用中确认。密钥值保存在操作系统安全存储或 Vault 中,服务器只处理名称和引用,但响应内容仍会发送给模型,其中正文会被截断、认证类请求头会被遮蔽。服务器不会执行 git 提交。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Baton,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Baton — MCP setup

Let your AI assistant work in a Baton workspace. Baton is a git-native API client (a Postman alternative): requests, collections and environments are plain YAML files in a repository you own. The MCP server runs locally with one configuration and two modes, picked at start:

  • File mode — the Baton app is not open on the workspace: an edit is a write to the YAML file, the same bytes the app would write, and goes through git review like any other change.

  • App mode — the desktop app is open on the workspace: an edit lands as a draft on the request's tab for you to accept or discard, a send runs through the app with the app's secrets, a send into a production environment or a delete waits for your confirmation, and the assistant sees which request and environment you have open.

  • Server: baton

  • Transport: stdio (local process)

  • Package: @dudko.dev/baton-mcp — Node.js 24+

  • Auth: none — it runs locally with your user's permissions; secrets never pass through it.

What you can do

In file mode the assistant can read and write the workspace but not send requests unless you add --allow-run. In app mode every send goes through the app, on your screen.

ToolWhat it does
workspace_infoCollections, environments, schedules, load issues, and whether the app is connected.
list_requestsRequests with method, URL and tags — optionally under one collection.
get_requestA parsed request, its raw YAML, and where its auth comes from — secrets appear as references only.
upsert_requestWrite a request as deterministic YAML (file mode) or propose it as a draft in the app.
move_requestMove or rename a request, keeping its id and its scripts.
delete_requestDelete a request; in app mode, after you confirm.
upsert_collectionCreate or replace a collection or folder: variables, auth, order.
list_environmentsVariables and secret names, with each secret's source.
upsert_environmentWrite an environment (secret names only; a secret may map to Vault).
get_script / upsert_scriptRead and write pre-request, test and shared library scripts.
run_request / run_collectionExecute a request or every request under a collection — file mode needs --allow-run; app mode sends through the app.
list_examples / save_exampleA request's saved responses, and save the last response as one.
list_mocks / start_mock / stop_mockStand a mock up from mocks/<name>.yaml on 127.0.0.1, answering from the examples.
app_state / select_requestApp mode only: what is open in the app, and open a request there.

In app mode the resources baton://app/state and baton://app/selection are subscribable, so the assistant learns of a click, an accepted draft or a finished send as it happens.


Install in Claude Code (plugin)

/plugin marketplace add dudko-dev/baton-mcp-setup/plugin install baton@baton/reload-plugins

The plugin starts the server in the current project directory, so open Claude Code in your Baton workspace (the folder with baton.yaml). Open the Baton app on the same workspace to get app mode. To point the server elsewhere, or to let the assistant execute requests in file mode, add it by hand instead (below) with --workspace <dir> and/or --allow-run. In the app, Settings → Agents writes a .mcp.json into the workspace for you.

Prefer not to use the marketplace? Add the server directly:

claude mcp add baton -- npx -y @dudko.dev/baton-mcp --workspace /path/to/workspace

Connect from other clients

Claude Desktop

claude_desktop_config.json (Settings → Developer → Edit Config):

json
{  "mcpServers": {    "baton": {      "command": "npx",      "args": [        "-y",        "@dudko.dev/baton-mcp"      ]    }  }}

Cursor

~/.cursor/mcp.json or .cursor/mcp.json:

json
{  "mcpServers": {    "baton": {      "command": "npx",      "args": [        "-y",        "@dudko.dev/baton-mcp"      ]    }  }}

VS Code (GitHub Copilot / MCP) and other clients

json
{  "servers": {    "baton": {      "type": "stdio",      "command": "npx",      "args": [        "-y",        "@dudko.dev/baton-mcp"      ]    }  }}

Safety

  • In file mode, running requests is off by default. Add --allow-run to the args only when you want the assistant to fire requests — editing files should never silently send traffic.
  • In app mode, you stay in the loop. Edits arrive as drafts you accept or discard; a send into a production environment and every delete wait for your confirmation in the app.
  • Secrets stay out of the workspace. The server reads and writes secret names and {{secret:name}} references only; the values live in the OS secure store or in Vault, and a plaintext value where a reference belongs is refused. Responses are masked by value, bodies truncated, and Authorization, Cookie, Set-Cookie and X-API-Key replaced by name.
  • The server never touches git. Commits stay yours.
FlagMeaning
--workspace <dir>The workspace root — the folder holding baton.yaml (default: current directory).
--allow-runLet the agent execute requests in file mode. Off by default; app-mode sends go through the app.
--agent <name>What the app calls this agent on its banners and confirmations.

Troubleshooting

  • "not a Baton workspace" / the client says "Connection closed" — the server exits at start when the folder has no baton.yaml. Open Claude Code in your workspace, or add the server by hand with --workspace /path/to/workspace.
  • run_request refuses — the server is in file mode: add --allow-run, or open the Baton app on the workspace and restart the server for app mode.
  • Edits are written straight to files although the app is open — the mode is decided when the server starts. Restart the MCP server in your client after opening the app on that workspace.
  • npm warn EBADENGINE … required: { node: '>=24' }, then nothing — the server needs Node.js 24+; node --version in the shell your client starts.

Support

来源:README.md,提交 58e37b6

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

2
  1. v0.2.0最新Oct 25, 2026
  2. v0.1.3Sep 26, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。

其他 Dudko 集成