BAND

io.github.ktgeek由 GitHub 帳號 ktgeek 發布v1.0.0更新於 Oct 27, 2026

List bands and read, post, and comment on BAND posts through the BAND Open API.

已驗證STDIO僅桌面效率與工作流溝通與協作

概覽

AI 產生的概覽

透過 BAND Open API 讓助理列出 Band、讀取與發布貼文並管理留言。

可以做什麼
  • 列出已加入的 Band,並查詢使用者在某個 Band 的發文、留言與刪除權限
  • 讀取 Band 的近期貼文,依 key 取得單篇貼文,支援游標分頁
  • 向 Band 發布文字貼文,可選擇是否推播通知成員
  • 讀取貼文留言,可依最舊或最新排序,支援游標分頁
  • 為貼文新增留言,並永久刪除貼文或留言
  • 回報伺服器狀態以及存取權杖是否已設定
適用情境
適合需要讓助理在 BAND 社群中工作的情境:查看自己加入了哪些 Band、草擬並發布貼文、追蹤留言討論,或清理透過此應用程式發布的貼文與留言。
執行需求
以 Ruby gem(需 Ruby 4.0 或更新版本)或 Docker 映像形式在本機透過 stdio 執行。需要 BAND 開發者網站註冊應用程式後取得的存取權杖,透過 BAND_ACCESS_TOKEN 環境變數或設定檔提供。需要連線至 BAND API 的網路。桌面用戶端需使用絕對啟動路徑。
安裝前請注意
需要 BAND 存取權杖,伺服器會以 bearer 標頭送往 BAND;寫入用戶端設定檔會把密鑰留在該檔案中。發布貼文與留言對所有 Band 成員可見,並可能推播通知。刪除貼文與留言為永久性且無法復原。刪除權限不檢查作者身分,刪除他人內容可能失敗。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 BAND,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

ruby-band-mcp-server

An MCP server for the BAND Open API, written in Ruby on the official mcp gem and served over stdio.

Tools

ToolWhat it does
pingReports that the server is up and whether BAND_ACCESS_TOKEN is configured (never its value).
list_bandsLists the bands you have joined, with the band_key the other tools need.
create_postPublishes a text post to a band. Members are push-notified only if do_push is true.
get_postFetches one post by band_key and post_key, e.g. to confirm a create_post landed.
list_postsLists a band's recent posts, newest-modified first, paged with an after cursor.
check_permissionsReports which of posting, commenting and contents_deletion the user has in a band.
remove_postPermanently deletes a post by band_key and post_key. It cannot be undone.
list_commentsLists a post's comments, oldest first unless newest_first, paged with after.
create_commentAdds a comment to a post. BAND does not return its key; find it with list_comments.
remove_commentPermanently deletes a comment by comment_key. It cannot be undone.

A typical flow is list_bands to find the band, create_post to publish, then get_post with the returned post_key to confirm. create_post is marked as not read-only, so MCP clients such as Claude Desktop can ask before running it.

To browse what is already in a band, use list_posts. BAND picks the page size (20 posts); when the result's next_after is not null, pass it back as after to get the next page.

To read the discussion on a post, use list_comments with the post's band_key and post_key. Comments come oldest first; set newest_first to reverse that. BAND chose a page size of 20 when tested. Pass next_after back as after exactly as returned: it remembers the order, so a page after the first needs no newest_first.

To join in, use create_comment. BAND confirms the comment without saying what its key is, so call list_comments afterwards to confirm it landed and to get its comment_key.

To take a post down, use remove_post; it is marked destructive, so clients can ask before running it. Run check_permissions with contents_deletion first. BAND's docs say that permission does not check authorship, so removing someone else's post can still fail. remove_comment works the same way on a comment_key from list_comments, and BAND's docs add that it can only remove comments made through this app.

Requirements

Ruby 4.0 or newer.

Install

sh
gem install band-mcp-server

This puts a band-mcp-server executable on your PATH. To run it without installing, RubyGems can fetch and run it on demand (the gem and executable share a name, but gem exec needs the gem named explicitly):

sh
gem exec -g band-mcp-server band-mcp-server

Docker

If you would rather not manage a Ruby 4.0 install, a multi-architecture (amd64 and arm64) image of each release is published to ghcr.io/ktgeek/band-mcp-server. The server speaks MCP over stdio, so run it with -i, and pass the token through the environment (the image has no config file):

sh
export BAND_ACCESS_TOKEN=your-tokendocker run -i --rm -e BAND_ACCESS_TOKEN ghcr.io/ktgeek/band-mcp-server

Tags are the release version (for example 1.0.0) and latest. Register it with Claude Code:

sh
claude mcp add band -e BAND_ACCESS_TOKEN=your-token -- \  docker run -i --rm -e BAND_ACCESS_TOKEN ghcr.io/ktgeek/band-mcp-server

Getting a BAND access token

Register an app on the BAND developer site and get an access token for it; the API guide covers the details. The server only consumes the token and sends it to BAND as an Authorization: Bearer header. It does not run any OAuth flow itself.

Configuring the token

Put the token in ~/.config/band-mcp-server/config (or $XDG_CONFIG_HOME/band-mcp-server/config if you set that):

sh
mkdir -p ~/.config/band-mcp-serverecho 'BAND_ACCESS_TOKEN=your-token' > ~/.config/band-mcp-server/configchmod 600 ~/.config/band-mcp-server/config

A value already set in the environment (for example through the MCP client's env setting) takes precedence over the file.

Running

Register it with Claude Code:

sh
claude mcp add band -- band-mcp-server

The server speaks MCP over stdio, so it is normally launched by a client rather than run by hand.

Claude Desktop

Claude Desktop starts servers with a minimal environment, so a version manager such as chruby is not active and the installed executable's #!/usr/bin/env ruby finds the wrong Ruby (the system Ruby, if any). With chruby, launch the server through chruby-exec, which selects the Ruby and its GEM_HOME for you.

chruby-exec does that by running the command in a login shell ($SHELL -l -c), so two things must hold. chruby has to be loaded by a startup file that a non-interactive login shell reads (for zsh, ~/.zprofile or ~/.zshenv, not only ~/.zshrc). And those startup files must not print anything to stdout: it would land in front of the protocol stream and Desktop could not parse the handshake.

  1. Find where chruby-exec is installed with which chruby-exec. That depends on how you installed chruby, and the path has to be absolute because Desktop's PATH is minimal.

  2. Open Settings → Developer → Edit Config (on macOS this is ~/Library/Application Support/Claude/claude_desktop_config.json) and add a band entry to mcpServers:

    json
    {  "mcpServers": {    "band": {      "command": "/path/to/chruby-exec",      "args": ["ruby-4", "--", "band-mcp-server"]    }  }}

    chruby matches ruby-4 against the installed Rubies by name, so it picks a 4.x Ruby; use a fuller name such as ruby-4.0.5 to pin one. Run gem install band-mcp-server under that same Ruby.

    Keep the token in the config file described above; it is loaded by absolute path, so the working directory does not matter. Setting BAND_ACCESS_TOKEN in an env map instead also works and takes precedence, but puts the secret in Desktop's config file.

    Without chruby, use the absolute path of the installed executable (which band-mcp-server) as command. If that Ruby is not the first ruby on Desktop's minimal PATH, use the absolute path of a Ruby 4.0 or newer as command instead, put the executable in args, and set GEM_HOME to the directory holding the installed gems (gem env gemdir prints it):

    json
    {  "mcpServers": {    "band": {      "command": "/path/to/ruby",      "args": ["/path/to/band-mcp-server"],      "env": { "GEM_HOME": "/path/to/gem/dir" }    }  }}

    With Docker, none of the above applies: Desktop only needs the absolute path of docker (which docker), and the token goes in an env map, which puts the secret in Desktop's config file:

    json
    {  "mcpServers": {    "band": {      "command": "/path/to/docker",      "args": ["run", "-i", "--rm", "-e", "BAND_ACCESS_TOKEN", "ghcr.io/ktgeek/band-mcp-server"],      "env": { "BAND_ACCESS_TOKEN": "your-token" }    }  }}

    To keep the secret out of that file, write BAND_ACCESS_TOKEN=your-token to a file only you can read, remove the env map and the "-e", "BAND_ACCESS_TOKEN" pair, and add "--env-file", "/path/to/that/file" before the image name in args.

  3. Quit Claude Desktop completely (Cmd-Q) and reopen it. The band tools appear in the tools menu of a new chat.

Then ask Claude to run ping, which reports whether the token is set without showing it, and try "Which bands am I in?" to confirm the connection. Desktop asks before it runs a tool unless you have set that tool to always allow. Keep the prompt on for create_post and create_comment: they publish to every member of the band. Read the band and the wording in the request before approving. For create_post, members are push-notified only if the request sets do_push. Keep the prompt on for remove_post and remove_comment too: what they delete is gone for every member and cannot be restored, so check the keys before approving.

To check the launch command outside Desktop, run it with a bare environment. A JSON initialize response means the server starts under that Ruby with its gems; it does not check the token, which ping does:

sh
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"check","version":"0"}}}' |  env -i HOME="$HOME" PATH=/usr/bin:/bin "$(which chruby-exec)" ruby-4 -- band-mcp-server

If the tools do not show up, read ~/Library/Logs/Claude/mcp-server-band.log:

Symptom in the log or tool resultCause
spawn … ENOENTcommand is not an absolute path to an existing chruby-exec (or Ruby).
chruby: unknown Ruby: …No installed Ruby matches the name in args; compare with the output of chruby.
Could not find dotenv-…, mcp-… (gems missing)gem install was run under a different Ruby; run it under the one in args.
requires Ruby version >= 4.0The chosen Ruby is older than 4.0; point args (or command) at a 4.x Ruby.
BAND_ACCESS_TOKEN is not setNo config file with the token, and no BAND_ACCESS_TOKEN in an env map.
command not found: chrubychruby is only loaded in ~/.zshrc; load it in ~/.zprofile or ~/.zshenv.
Desktop cannot parse the server's outputA shell startup file prints to stdout; chruby-exec runs a login shell.
BAND API error 10401BAND's "Unauthorized" code: the token is missing, invalid or expired.

Development

From a checkout, use Bundler instead of the installed gem. A .env in the checkout root takes priority over the user config file, and bin/band-mcp-server (which sets up Bundler itself) replaces band-mcp-server:

sh
chruby ruby-4.0.5   # or any manager that reads .ruby-versionbundle installcp .env.example .env    # then set BAND_ACCESS_TOKENclaude mcp add band -- /path/to/ruby-band-mcp-server/bin/band-mcp-server
sh
bundle exec rake    # rubocop, rbs drift check, steep, rspecbundle exec rake -T # every task, including audit

lib/ is typed with rbs-inline annotations and checked by Steep; regenerate sig/generated/ with bundle exec rake rbs:generate after changing them. See AGENTS.md for conventions and architecture.

main is protected: changes land through a pull request with green CI.

License

GPL-3.0. See LICENSE.

來源:README.md,提交 cea155f

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:該軟體包類型無法在沙箱中執行。

版本歷史

1
  1. v1.0.0最新Oct 26, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分