
Backwork
io.github.tylergibbs1v2.1.1更新於 Oct 1, 2026
Medicare and commercial payer policies, prior auth, claim risk, and medical codes from Backwork.
概覽
讓助理透過 Backwork API 查詢 Medicare 與商業保險支付方政策、醫療編碼、事前授權、理賠風險及藥品給付目錄證據。
- 功能
- Backwork 提供八個工作流程層級的工具:給付範圍查詢(整合編碼細節、政策證據、事前授權與理賠風險)、政策研究與條件檢索、理賠驗證、事前授權研究、跨商業 PBM 的藥品給付目錄研究、法遵審查、Webhook 管理以及 API 健康檢查。回應包含來源網址、發布機關、擷取時間與生效日期等溯源欄位,方便引用。工具支援 markdown 或 json 的 response_format。
- 適用情境
- 當助理需要回答 Medicare 或商業支付方的給付範圍、編碼、事前授權或理賠拒付風險問題,或檢索藥品給付目錄證據時使用。適合醫療收入週期與法遵工作流程,而非一般網路檢索。
- 執行需求
- 可使用搭配瀏覽器 OAuth 的託管遠端端點,或本地 npm 套件 @backwork/mcp(以 npx 執行),後者需要 Node.js 18 或更新版本,並在 BACKWORK_API_KEY 中提供 Backwork API 金鑰。bwk_test_ 金鑰僅適用於沙箱,需設定 BACKWORK_API_BASE。呼叫會消耗組織的請求額度。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Backwork,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"backwork-mcp": {
"type": "http",
"url": "https://backworkhealth.com/mcp"
}
}
}README
Backwork MCP Server
Official Model Context Protocol (MCP) server for the Backwork API. It gives AI assistants controlled access to Medicare and payer medical policies, medical code intelligence, prior authorization checks, claim validation, compliance review, drug formulary evidence, and webhook operations.
There are two ways to connect:
The hosted endpoint only accepts OAuth. Do not send a Backwork API key as a bearer token to https://backworkhealth.com/mcp. The OAuth grant is read-only (backwork:mcp read), so the hosted server offers only read actions: no webhook management and no compliance acknowledgements. Use local stdio with a write-scoped live key for those.
Calls draw on your organization's request credits, like any other /api/v1 call. A bwk_test_ key works only on the sandbox (https://backworkhealth.com/api/sandbox/v1), which covers policy search, code lookup, prior-auth check and coverage evaluation; to use it, set BACKWORK_API_BASE to that URL.
Claude Code
Add --scope user to make it available in every project. Then run claude, open /mcp, select backwork, and finish the browser login and Backwork consent screen. Check it with claude mcp get backwork.
If OAuth discovery needs to be pinned explicitly, add the same server as JSON:
Local stdio:
Claude Desktop
Hosted remote: open Settings > Connectors > Add custom connector, name it Backwork, and enter https://backworkhealth.com/mcp. Claude Desktop runs the OAuth login when you connect.
Local stdio: add this to claude_desktop_config.json (Settings > Developer > Edit Config) and restart Claude Desktop:
Cursor
Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project). Cursor opens the OAuth login the first time it connects:
Local stdio:
VS Code
Or add it to .vscode/mcp.json in a workspace. VS Code asks you to sign in when the server starts:
Local stdio, with the key prompted for once and stored by VS Code:
Codex
Other MCP Clients
Clients that run local commands can use the stdio config shown for Claude Desktop. Clients that support remote URLs with OAuth can use https://backworkhealth.com/mcp directly.
For clients that support only remote URLs with static headers, deploy a private self-hosted server in API-key or dual-auth mode (see Self-Hosting) and send the key as a bearer header:
Self-Hosting
Run a Streamable HTTP server:
Defaults:
HTTP mode requires Authorization: Bearer per request. By default this bearer is a Backwork API key. For hosted remote MCP deployments, enable OAuth protected-resource discovery so Claude-compatible clients can authenticate users through your authorization server:
The server publishes OAuth Protected Resource Metadata at /.well-known/oauth-protected-resource and includes that URL in WWW-Authenticate challenges. If your Backwork API accepts OAuth access tokens directly, no extra mapping is needed; the MCP server forwards the OAuth bearer downstream. If your authorization server exposes a Backwork API key in token introspection, set BACKWORK_MCP_OAUTH_INTROSPECTION_URL and BACKWORK_MCP_OAUTH_API_KEY_CLAIM to validate the access token and map it to the downstream Backwork credential.
For a private single-tenant deployment where the server environment supplies the key, set:
Only use BACKWORK_MCP_ALLOW_ENV_KEY=true on loopback or private-network deployments protected by network access control. Public deployments should require a bearer token per request, set BACKWORK_MCP_ALLOWED_HOSTS/BACKWORK_MCP_PUBLIC_HOST, and set BACKWORK_MCP_ALLOWED_ORIGINS only to exact browser origins that may connect.
Vercel Hosting
This repo can deploy as an API-only Vercel project. The production project uses:
The Vercel functions expose:
The Backwork web app that issues OAuth tokens must also be configured:
Production OAuth discovery fails closed unless BACKWORK_OAUTH_SIGNING_SECRET is at least 32 characters and Redis or Vercel KV is configured for one-time consent and authorization-code storage.
Health check:
Local Development
Useful commands:
Requires Node.js 18 or newer.
Available Tools
Tool names use the backwork_ prefix for discoverability when this server is installed alongside other MCP servers. The default surface is intentionally workflow-level rather than a 1:1 API wrapper, so agents see fewer choices and common tasks require fewer tool calls.
All tools include title, description, inputSchema, outputSchema, and MCP annotations. Successful calls return readable text plus structuredContent with message, and when available, raw Backwork API data and meta. Tool-level failures return isError: true. For tools that combine read and write actions, annotations are conservative at the tool level.
Sources and currency
When the Backwork API response cites policy documents, structuredContent.provenance carries what an agent needs to cite them, and the text output ends with a short --- Sources --- block:
Values are copied from the API response (source_url, effective_date, last_verified_at, the policy type, and the payer). A value the API did not return is null. The shape matches the provenance block on Backwork agent tool results, which is passed through unchanged.
Production availability
Which actions a server offers depends on two things:
- Availability. The Backwork OpenAPI document can mark an operation
x-backwork-availability: unavailable-in-production. Against the production API (https://backworkhealth.com) the server withholds those actions. None is marked today: production serves every/api/v1operation these tools call to an organization's live key. - Access. Operations that need
writescope (x-backwork-required-scopes) are withheld from a read-only OAuth grant. On the hosted server this hidesbackwork_webhook_managementand theacknowledgeandbulk_acknowledgeactions ofbackwork_compliance_review. A Backwork API key is offered every action, and the API enforces the key's own scopes.
A tool with no offered action is hidden. A partly offered tool drops the withheld actions from its action input and names them in its description. A server pointed at another Backwork deployment with BACKWORK_API_BASE ignores availability markers, and BACKWORK_MCP_EXPOSE_UNAVAILABLE_TOOLS=true does the same against production. Neither lifts the write-scope rule.
Response Format
Every tool accepts:
Use "markdown" for readable output or "json" to make the text content mirror the returned structuredContent.
Example Prompts
Testing and Evaluations
Run the build and MCP metadata smoke test:
The smoke test starts the built stdio server with a dummy key, verifies the 8 workflow tools, checks titles, schemas, annotations, output schemas, response_format, and verifies local validation failures are reported with isError: true. The test/ suite covers production availability, the hosted server's OAuth-only, read-only tool set, provenance, description quality and a lexical tool-selection check (no model calls), and the registry manifest.
API contract
Every Backwork endpoint this server calls is listed in src/api-operations.ts, with the request fields it sends and the response fields it reads. Tools can only call the API through that catalog. Each entry also mirrors the operation's availability marker and required scope. npm test checks the catalog against the vendored openapi/backwork-openapi.json, and asks the server's own exposure rule which tool actions it would offer on production, for a read-only OAuth grant and for an API key. An action offered for an operation that production does not serve, marks unavailable, or (for the OAuth grant) guards with write scope fails.
CI runs npm run contract:live, which runs the same checks against https://backworkhealth.com/openapi.json and fails when the vendored copy differs from it anywhere except descriptions, summaries and examples.
When the Backwork API changes, refresh the vendored copy and review the diff:
The evals/ directory includes a tool-discoverability evaluation and a read-only data evaluation built from fixed source-backed policy/code records. Refresh the read-only answers intentionally when Backwork source data is updated.
MCP Registry
server.json describes this server for the official MCP registry as io.github.tylergibbs1/backwork-mcp: the hosted Streamable HTTP remote at https://backworkhealth.com/mcp (OAuth, discovered from the protected-resource metadata) and the @backwork/mcp npm package over stdio. package.json carries the matching mcpName that the registry uses to verify npm ownership. npm test validates server.json against the registry schema and checks that its versions match package.json.
Release
Releases publish @backwork/mcp to npm with Trusted Publishing (GitHub OIDC, no npm token) and then publish server.json to the MCP registry.
npm version minor(orpatch/major). Theversionscript copies the new version intoserver.jsonandSERVER_VERSIONinsrc/index.ts.- Merge that change to
main. - Push a matching tag from
main, for examplegit tag v2.1.0 && git push origin v2.1.0.
The Release workflow then:
- Fails unless the tag equals
v+ thepackage.jsonversion. - Runs
npm ci,npm test(build, smoke tests, unit tests, OpenAPI contract), andnpm pack --dry-run. - Publishes to npm with provenance, in the
npmenvironment. A version already on npm is skipped, so a failed run can be re-run. - Waits for the version to appear on npm, then runs
mcp-publisher login github-oidcandmcp-publisher publish.
One-time npm setup: on npmjs.com, open @backwork/mcp > Settings > Trusted publishing, choose GitHub Actions, and enter user tylergibbs1, repository backwork-mcp, workflow release.yml, environment npm.
Environment Variables
Troubleshooting
Missing API Key
For stdio, set BACKWORK_API_KEY in the MCP client configuration. For HTTP API-key mode, send Authorization: Bearer <key>. For HTTP OAuth mode, configure BACKWORK_MCP_OAUTH_AUTHORIZATION_SERVERS and send Authorization: Bearer <access_token>.
401 From HTTP MCP
The remote server did not receive a bearer token. Configure your MCP client to authenticate with OAuth or send an Authorization header. OAuth-enabled deployments include resource_metadata in the WWW-Authenticate header to point clients at /.well-known/oauth-protected-resource.
Claude Code OAuth
If Claude Code does not open the browser, run /mcp, select backwork, and choose the authenticate action. If it gives you a URL instead of opening a browser, copy that URL into your browser.
If the browser redirect back to Claude Code fails after consent, copy the full callback URL from the browser address bar and paste it into the Claude Code prompt.
This server does not hold OAuth tokens. It validates each request's access token by introspection and forwards it (or the mapped API key) to the Backwork API. Refreshing an expired access token is the MCP client's job: when introspection reports a token inactive, the server answers 401 with error="invalid_token", and the client can use its refresh token with the Backwork authorization server.
If Claude Code keeps using an old token, open /mcp, select backwork, clear authentication, then authenticate again. You can also remove and re-add the server with:
If discovery returns 503, the Backwork web app is intentionally refusing to advertise OAuth because production signing or Redis/KV state storage is missing.
If tool calls authenticate but fail with invalid_token or invalid_target, check that BACKWORK_MCP_RESOURCE, BACKWORK_MCP_OAUTH_RESOURCE, and BACKWORK_MCP_OAUTH_EXPECTED_AUDIENCE all use:
Rate Limits
Wait for the reset window or use a higher-capacity API plan.
Support
- Documentation: https://backworkhealth.com/docs
- Issues: https://github.com/tylergibbs1/backwork-mcp/issues
- Email: [email protected]
License
MIT. See LICENSE.
來源:README.md,提交 8fa4b75
工具
0版本歷史
1- v2.1.1最新Oct 1, 2026

