
Account Pool
io.github.ankitsxchdeva由 GitHub 账号 ankitsxchdeva 发布v0.1.1更新于 Oct 24, 2026
Exclusive, crash-safe leases on a pool of test accounts for parallel agent QA runs.
概览
本地 MCP 服务器,将测试账号以独占租约分配给并行的智能体会话,避免两个会话使用同一账号。
- 可以做什么
- 从指定账号池租用账号,返回账号、其凭据和租约令牌,在释放或过期前独占使用。归还已租用账号(幂等),或在任务耗时较长时续租作为心跳。查看账号池状态,了解哪些账号已租出、哪些空闲,且不暴露凭据值。通过共享的 SQLite 文件协调互不相关的会话,租约到期后自动回收。
- 适用场景
- 适合多个智能体会话并行运行 QA 或浏览器测试、每个会话都需登录测试账号,且账号冲突会破坏状态或测试结果的场景。也适合需要通过随附 CLI 使用同一套租约协调的脚本和人工操作。
- 运行要求
- 通过 stdio 在本地运行,通常用 npx 从 npm 包 account-pool-mcp 启动,需要 Node.js。需要一个定义账号池和账号的 JSON 文件(APM_ACCOUNTS_FILE),以及所有需协调会话共享的 SQLite 路径(APM_DB_PATH)。可选的 APM_DEFAULT_TTL_SECONDS 和 APM_LEASE_WAIT_MS 用于调整租约时长和等待时间。所有会话必须共享同一文件系统。
安装
在 SourceWeft 中
- 打开 控制台中的 Account Pool,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
account-pool-mcp
[npm version] [npm downloads] [CI] [license] [Model Context Protocol] [Glama score]
An MCP server that hands out test accounts to agent sessions one at a time, so two sessions never end up logged into the same account.
The problem
When you run several agent sessions at once — say a few Claude sessions each driving their own Playwright browser — they all need to log in, and left alone they'll grab the same test account and step on each other. Two sessions on one account corrupt each other's state and your test results become meaningless. Picking a random account doesn't really help either: with 10 accounts and 5 sessions, a collision is already more likely than not.
The fix is to lease accounts. A session checks one out, uses it, and returns it. While it's checked out, no one else can be handed it.
How it works
The server keeps a pool of accounts in a small SQLite database and gives them out one at a time.
Allocation happens inside a BEGIN IMMEDIATE transaction, so even if several sessions ask at the
exact same moment, they can't be handed the same account. Each lease has a TTL, so if a session
crashes without returning its account, it gets reclaimed automatically — there's nothing to clean up.
All of this happens in the background. The agent just asks for an account when it needs one; the broker decides which one it gets and guarantees no one else has it. There's no shared parent process — unrelated sessions coordinate purely through the database file.
Tools
lease_account(pool, holder?)— check out an account. Returns the account, its credentials, and alease_token. Hold it until you're done.release_account(lease_token)— give it back. Idempotent.renew_lease(lease_token)— extend the lease if your work runs long (a heartbeat).pool_status(pool?)— what's leased vs. free. Never returns credential values.
There's also a small account-pool CLI (lease / release / renew / status) over the same
database, for scripts and humans.
Setup
Want to see it first? bash examples/demo.sh runs a 60-second, no-install walkthrough — two sessions
lease different accounts, a third is correctly refused, and the pool recovers on release.
It's on npm, so there's nothing to clone or build.
Register it with your MCP client (e.g. .mcp.json) — npx fetches and caches it on first launch:
Then define your pools in accounts.json (an id and a credentials blob per account):
Want the CLI too? Run it ad-hoc with npx account-pool status, or install it on your PATH:
Point every session's APM_DB_PATH at the same file — that shared file is how they coordinate.
A credential value can be { "env": "VAR_NAME" } instead of a literal, so real secrets stay in the
environment and out of the accounts file.
Making your agent reach for it automatically
The server ships agent instructions in the MCP handshake — clients like Claude Code, Cursor, and
Windsurf inject them into context, so the agent knows to call lease_account before logging in
without being told each time. The tool descriptions reinforce it (lease is exclusive; you must
release).
For the most reliable pickup, also add a line to your project's own rules file
(CLAUDE.md, .cursor/rules/, .windsurfrules) so the agent's instructions and the server's
instructions agree:
Security
These are test accounts, not a secrets vault. Credential values are never logged or returned by
pool_status — a redacting logger masks them, and all logs go to stderr so they can't corrupt the
MCP stream. Keep accounts.json and *.db out of git (only the .example files are committed). The
stdio server trusts whoever runs it locally, so don't point it at production credentials.
Limitations
Single host for now: coordination is through one SQLite file, so all sessions have to share a filesystem. The storage layer is isolated behind one module, so a Postgres or Redis backend could swap in later for multi-host coordination without changing the tools.
来源:README.md,提交 7587b83
工具
0版本历史
1- v0.1.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分