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 整合