Pit Officer

io.github.openpitkit由 GitHub 账号 openpitkit 发布v0.1.0更新于 Oct 30, 2026

Pre-trade risk limits for AI trading agents: every order is checked before it reaches your broker.

已验证STDIO仅桌面金融安全与监控

概览

AI 生成的概览

Pit Officer 是一个本地交易前置风控网关,每笔订单在到达券商前都会按你设定的限额检查,AI 代理可通过 MCP 使用。

可以做什么
  • 在网页面板中管理交易账户、风控限额和券商连接
  • 订单经 OpenPit 风控引擎审核后才通过交易连接发出
  • 以本地 stdio MCP 服务器运行,供交易软件或 AI 代理调用同一套检查
  • 单个二进制同时提供面板、REST API 和 HTTP MCP,另有健康检查子命令
  • 在面板中备份和恢复本地数据库
适用场景
当 AI 代理或交易工具需要向券商下单,但必须先受交易前风控限额约束,并希望这些限额在本地发送前强制执行时使用。
运行要求
在桌面本地运行。文档给出的方式是 Docker 容器,监听 127.0.0.1:8787 并挂载持久数据卷;从源码构建需要 C 工具链、Go、Node 和 npm。券商连接与账户在面板中配置。未声明任何环境变量或请求头。
安装前请注意
它会连接券商并可能发出真实订单,限额配置错误或代理权限过大都可能造成资金损失。面板与 API 暴露在本地端口,README 指向配置参考以了解授权模型。升级前务必备份数据库,edge 版本的数据视为可丢弃。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Pit Officer

[CI] [Release] [License]

Website: officer.openpit.dev

Pit Officer lets you manage trading accounts, set risk limits, connect to brokers, and send orders from a web panel. The OpenPit risk engine checks each order before Officer sends it through a trading connection. You can also use Officer from trading software or AI agents.

Run

Watch the video guide or follow the steps below. The quickstart covers stopping, ports and troubleshooting.

Install Docker, then run:

sh
docker run -d --name pit-officer --restart unless-stopped -p 127.0.0.1:8787:8787 -v pit-officer-data:/data ghcr.io/openpitkit/officer:latest

Open http://127.0.0.1:8787. latest is the newest release; your data stays in the pit-officer-data volume. Back up before every upgrade, and regularly, from Service > Database > Database backup > Export in the panel.

To upgrade an installed Officer, see Upgrade Officer.

edge is the current development build, for quick tests only. Its data is disposable. Stop the release container first, then use the same volume:

sh
docker stop pit-officerdocker run -d --name pit-officer-edge --restart unless-stopped -p 127.0.0.1:8787:8787 -v pit-officer-data:/data ghcr.io/openpitkit/officer:edge

On its first start, the panel asks whether to copy the release data or start empty. It never changes the release database. See Trying the development build.

Build

Prerequisites: a C toolchain, which the OpenPit Go binding requires through cgo; Go; and Node and npm for the dashboard bundle. Tool versions are pinned in .github/ci-versions.env; just ensure-node installs the pinned Node into .tmp/node.

From the repository root, build the dashboard before the binary so Go embeds the compiled assets:

bash
npm --prefix web cinpm --prefix web run buildCGO_ENABLED=1 go build -ldflags "-X go.openpit.dev/officer/framework/backend.buildCommit=$(git rev-parse HEAD)" -o pit-officer ./cmd/pit-officer

On Windows with PowerShell, set CGO_ENABLED=1 in your shell, build with go build -ldflags "-X go.openpit.dev/officer/framework/backend.buildCommit=$(git rev-parse HEAD)" -o pit-officer.exe ./cmd/pit-officer, and run ./pit-officer.exe.

Run from source

A locally built binary behaves like edge: its first serve asks which database to use, and it never changes the release database. Make that choice before running mcp.

Pit Officer is a single binary with four subcommands: serve, mcp, dashboard, healthcheck. After building it, run from the repository root:

bash
./pit-officer serve       # serve the dashboard, REST API, and HTTP MCP./pit-officer dashboard   # in another terminal, open the running instance./pit-officer mcp         # alternatively, run a local stdio MCP server

The subcommands, environment variables, flags, and authorization model are in the configuration reference. See the API notes for REST and MCP integration.

Local container build

To build and run a local container image with the settings in docker-compose.yml:

bash
. ./.github/ci-versions.envdocker build --build-arg GO_VERSION="$CI_GO" --build-arg OFFICER_COMMIT="$(git rev-parse HEAD)" -t pit-officer:local .docker compose up

Optional Just shortcuts

Just provides a quicker alternative to the manual steps above. The recipes also require Python 3; the full check additionally uses golangci-lint and Semgrep, as described in the development notes.

bash
just frontend-ci-install  # npm ci in web/ from the committed lockfilejust build                # build the SPA, then the pit-officer binaryjust run-serve            # build and servejust dashboard            # open the running instance in the browserjust run-mcp              # build and run a local stdio MCP serverjust docker-build         # build the pit-officer:local container imagejust check                # format checks, linters, Semgrep, tests, frontend bundles

Composing your own Officer from the importable packages, building against a local Pit checkout, and the debug variants are covered in the development notes.

License

Apache License 2.0. See LICENSE.

来源:README.md,提交 633b0b9

工具

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

版本历史

1
  1. v0.1.0最新Oct 29, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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