Ranch

bot.ranch由 ranch.bot 发布v0.2.0更新于 Oct 24, 2026

Read and write cattle and sheep records with farm-scoped, revocable access.

概览

AI 生成的概览

让助手通过本地 stdio 服务器读取和写入某个 Ranch.Bot 牧场的牛只与羊只记录。

可以做什么
这是一个本地 MCP 服务器,把助手连接到 Ranch.Bot 账户,并且一次只暴露一个牧场。工具包括 list_my_farms、list_animals、lookup_animal_by_eid、set_default_farm,以及针对动物、分组、记录和标识符的写入操作。产犊使用先预览后确认的流程(preview_birth_event、confirm_birth_event),牧场还可以通过工作流模板工具配置带版本的 record_birth 模板。文档还提到导出和混合来源核对。
适用场景
当生产者希望助手汇总某个牧场的存栏情况、录入或更新牲畜记录、确认产犊,或把历年的产羔电子表格、笔记、消息和 PDF 与某个牧场核对时,适合使用。它仅限桌面端,面向日常牧场记录工作,而不是通用的数据访问。
运行要求
需要 Node.js 22 或更高版本、一个 Ranch.Bot 账户以及对某个牧场的访问权限。安装 npm 包 @ranchbot/mcp-server 并运行 ranchbot-mcp login,在浏览器中批准打印出的代码;不需要 API 密钥。MCP 客户端需配置为通过 stdio 运行本地 ranchbot-mcp 命令。
安装前请注意
写入会直接以该服务器的权限保存,不经过应用确认界面和变更历史,因此每次修改前都应先审阅。角色和权限范围同时生效:删除动物、分组、记录或标识符需要 Owner 权限,确认产犊需要 write:records、write:animals 和 write:groups。已保存的产犊记录无法通过这些工具更正。请勿把密码和令牌文件放进助手消息中。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Ranch.Bot MCP Server

Read and write cattle and sheep records through a local MCP server on your own computer. It uses your Ranch.Bot account over the stdio transport and exposes one farm at a time. Hosted connections are not public yet. ChatGPT access is a private pilot. Ranch.Bot’s Claude connector is in review; you can still connect it privately as a custom connector.

Requirements: Node.js 22 or newer, a Ranch.Bot account, and access to a farm.

Install and sign in

These commands install this source package's version (0.2.0). For the recommended public release, use the pinned command on MCP setup, the source of truth for setup; release status and promotion rules live in MAINTAINING.md. Stop older CLI and MCP processes before upgrading; never remove their active lock files.

bash
npm install -g @ranchbot/[email protected]ranchbot-mcp --versionranchbot-mcp login

Open the printed URL, sign in, and explicitly approve the displayed code and requested access in your browser. No API key is needed. If login expires, run ranchbot-mcp login again; sign out with ranchbot-mcp logout. See Troubleshooting for access-denied and session problems, and keep passwords and token files out of assistant messages.

Configure a local stdio client

Point an MCP client at the installed command with no arguments:

json
{  "mcpServers": {    "ranchbot": { "command": "ranchbot-mcp", "args": [] }  }}

If the client cannot find the command, use its absolute executable path. Restart the client after changing configuration. ranchbot-mcp --help and ranchbot-mcp --version work without authentication. Any MCP client that can run a local stdio server works; this is not a certification of any named client.

First successful read

Ask the client to call these tools in order:

  1. list_my_farms with {}. Choose the intended farm ID. If more than one farm is plausible and the producer did not name one, ask instead of guessing.
  2. list_animals with {"farm_id":"<farm_id>"}, replacing the placeholder with that ID.

An empty list is a successful read. Pass farm_id explicitly on every scoped call; setting a default with set_default_farm is optional. If access is denied, check the account and farm membership; missing authentication means terminal login, then retry. Tool calls never start browser approval. A different account clears the process's default farm.

list_animals accepts query, match_mode (exact default, or partial) and identifier_type; exact matches saved identifiers and the current profile name, partial is literal substring discovery over profile names and NAME/MANAGEMENT_TAG identifiers. list_records accepts animal_id, group_id, include_group_context and explicit inclusive/exclusive applied_from/applied_before RFC3339 bounds; the first three and the bounds activate bounded history mode. Scoped credentials need the matching extra read scope for a target filter.

A useful read-only task: "Summarize the selected farm's current inventory." Read the complete relevant population, follow each operation's pagination (skip/take) and returned total, and report incomplete retrieval rather than presenting a first page as the whole answer.

Writing farm data

Ordinary writes save directly under your server permissions, without the app confirmation screen or its Change History. Before any mutation, present the operation, farm, resolved targets, exact values, and consequences and get explicit approval. Read the result back afterwards. If the outcome is uncertain, reconcile with reads before proposing another write.

Roles and scopes both apply: Readers can read, including the safe lookup_animal_by_eid; Editors or Owners can create and update and confirm a birth; deleting animals, groups, records, or identifiers needs Owner access. Birth confirmation also needs the write:records, write:animals, and write:groups scopes. A missing scope and a missing role are separate problems.

Direct births use preview_birth_event → approval → confirm_birth_event. Saved amendments and entered-in-error use preview_workflow with operation: "amend_birth", the record revision and a reason, then exact approval and commit_workflow, when exposed by the connected release. Never re-record a birth as a correction; if capability is missing, stop and contact support. Read the birth events reference before handling births.

Farms can configure a versioned record_birth template that drives the shared preview_workflow → approval → commit_workflow flow. The list_workflow_templates, get_workflow_template, create_workflow_template, publish_workflow_template_version, update_workflow_template_state, and set_default_workflow_template tools manage that configuration (Owner writes with write:farms). After upgrading from a login that lacks write:farms, run ranchbot-mcp login and approve a fresh authorization. Refresh preserves the existing grant; it cannot add scopes. A new grant does not elevate your farm role. Commit requires the exact preview_hash read back from a fresh preview; a stale hash is rejected. Templates change labels, visibility, defaults, and custom observations only — the meaning and review controls of core birth fields do not change. See the workflow guide for the run and configuration steps.

Agent skill

The package ships the public Agent Skill bundle at skills/ranchbot (SKILL.md plus references/). It is optional guidance, not a capability or a security boundary; installation details are in the MCP reference.

Task references

Jobs for an external assistant

A producer can authorize a local assistant to reconcile years of lambing spreadsheets, iPhone notes, messages, and livestock PDFs against one farm, produce custom reports, or compare farm history with an authorized lender or AgriStability snapshot for the same population and date. Totals are aggregate evidence, not individual animals or proof of current group membership; this is livestock reconciliation, not financial advice. Follow the mixed-source reconciliation recipe and the workflow pagination rules; MCP does not persist the coverage ledger.

Package guides

  • Workflows — find an animal, save an ordinary record, and preview and confirm a birth, with inputs, pagination, and recovery.
  • Architecture — the request path and which component enforces each guarantee.
  • Troubleshooting — login, farm selection, lock, and access problems.
  • Development — credential-free checks, the authenticated development server, and packaging.
  • Contributing — how changes reach this exported repository and where to send feedback.
  • Security — how to report a vulnerability privately.

Maintainer instructions

See MAINTAINING.md for development, admin login, local installations, EID migration, authentication troubleshooting, and detailed credential-lock recovery. For shell commands, use CLI setup. For everyday record entry, use SMS and web setup. Support: [email protected].

License

MIT. See LICENSE.

来源:README.md,提交 2849853

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

6
  1. v0.2.0最新Oct 20, 2026
  2. v0.1.6Oct 9, 2026
  3. v0.1.5Oct 7, 2026
  4. v0.1.4Oct 5, 2026
  5. v0.1.2Oct 2, 2026
  6. v0.1.0Sep 17, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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