Skip to main content
Glama
tx-medicaid-rates

tx-medicaid-rates

by pipeworx-io
README.md
# @pipeworx/tx-medicaid-rates

Texas Medicaid FQHC (federally qualified health center) and rural health clinic (RHC) reimbursement rates, per clinic location: the per-visit encounter rate, the date it took effect, the clinic's address, and for FQHCs the prior rate and whether it just changed. From the Texas Health and Human Services Commission (HHSC), Provider Finance Department.

Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 2020+ live data sources. This is an independent, unofficial integration — not affiliated with, endorsed by, or published by the upstream provider.

## Tools

- `tx_clinic_rates(program?, provider?, npi?, tpi?, zip?, city?, county?, changed_only?, limit?)` — per-location rates. Filter by clinic name fragment, 10-digit NPI, 9-digit Texas Provider Identifier (TPI), zip, city, county (FQHC only) or program. `changed_only` returns FQHC locations whose rate changed in the latest update. An unmatched filter returns the nearest clinic names or the valid county names, never a bare empty.
- `tx_rate_summary(program?, group_by?)` — what each publication is, how many locations and NPIs it lists, min/median/max/mean per-visit rate, optionally grouped by county (FQHC only), city or rate effective date.

## Auth

Keyless.

## Data sources

- Texas Health and Human Services Commission, Provider Finance Department, FQHC and RHC reimbursement rate tables — the monthly rate tables HHSC publishes for each program. Public, no account.

Things worth knowing:

- **Rates are per clinic location (TPI and NPI), per visit, not per procedure code.** HHSC's general fee-for-service schedules by procedure code are a different publication and are not in this pack. The state's rate-table workbooks for the 2028-29 biennium report fiscal impacts by service and exclude FQHC rates ("based on reported costs and then increased each year based on the Medicare Economic Index"), so they are not a substitute.
- FQHC rows carry `prior_rate`, `prior_rate_effective`, `current_rate`, `current_rate_effective` and `rate_changed_in_latest_update`. A few new locations have no prior rate (`prior_rate: null`). RHC rows carry the current rate and its effective date only.
- County is published for FQHC rows only.
- **Some RHC names are unreadable in the source.** A long clinic name or street address wraps inside its cell and HHSC's table prints the wrapped lines on top of each other. For those rows (81 of 357 served RHC rows in the 2026-11-01 table) `name`, `street_address` and `city` are `null` and `text_unreadable_in_source` is `true`; where the words are legible but run together they are kept in `listing_text`. TPI, NPI, zip, rate and date are unaffected, so look such a clinic up by `npi`, `tpi` or `zip`.
- **Organisations only.** HHSC's tables include a few rural clinics enrolled under a sole practitioner's own name ("<FIRST> <LAST> MD PA"). Any row whose name reads as a person is left out when the table is stored and counted in `individual_rows_dropped` (7 in the 2026-11-01 table, all RHC; the FQHC table had none). A practice named after its doctor stays when the name also carries a clinic or facility ("<DOCTOR> MD PA-<SITE> FAMILY CLINIC"), and rows whose name is unreadable in the source are never judged, since they expose no name. The rule is in `src/individuals.ts`; when in doubt a row is kept.
- Names are the legal entity, a hyphen, then the site name, as HHSC prints them. Identifiers (TPI, NPI, zip) are strings; TPIs keep their leading zeros.
- Fee-for-service rates only: managed-care plans may pay under their own contracts.
- Every response carries `data_as_of` (the "effective on or before" date of the newest table), `captured_at` and the source.

## Stored data and refresh

HHSC publishes these as a monthly table with no query interface, so the newest table of each program is read by `scripts/bake-index.mjs` into `src/tx-rates-data.ts` (about 950 rows, 380 KB), registered in `workers/gateway/src/pack-baked-indexes.json`; the deploy uploads it to KV and the gateway injects it on the first call into this pack, so nothing is evaluated at module scope. Refresh with `node mcps/tx-medicaid-rates/scripts/bake-index.mjs` (needs poppler's `pdftotext` on PATH): it reads each program page, takes the newest listed table, and rewrites the module in place. It drops person-named rows (`src/individuals.ts`; `scripts/refilter-individuals.mjs` re-applies the rule to the stored rows without re-reading the PDFs). It refuses a table that changes layout, drops below its row floor, repeats a TPI, or carries a non-positive rate. HHSC posts a new table each month, so the stored copy is a month-old snapshot at worst; `data_as_of` says which.

## Quick Start

Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):

```json
{
  "mcpServers": {
    "tx-medicaid-rates": {
      "url": "https://gateway.pipeworx.io/tx-medicaid-rates/mcp"
    }
  }
}
```

### What this endpoint actually serves

`tools/list` at `https://gateway.pipeworx.io/tx-medicaid-rates/mcp` returns the tools in the table
above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
`discover_tools`, `search_within`, `remember`/`recall` and the rest of the
gateway-wide set. So the tool count you see is larger than this table: a
single-pack endpoint currently lists roughly 30 shared tools alongside the
pack's own. The connection's `initialize` response states its exact scope, and
is the authoritative answer for a given day.

This is deliberate, not multiplexing by accident. The meta-tools are what let a
scoped connection answer a question this pack does not cover — via
`ask_pipeworx`, which routes across the whole catalog — without you adding a
second MCP server. There is currently no way to mount a pack endpoint without
them; if the extra schemas cost you more context than the routing is worth,
connect to the full gateway once rather than to several pack endpoints.

Or connect to the full Pipeworx gateway to get every pack's tools listed
directly, instead of just this one's:

```json
{
  "mcpServers": {
    "pipeworx": {
      "url": "https://gateway.pipeworx.io/mcp"
    }
  }
}
```

Both URLs reach the same gateway and the same 2020+ data sources. The
only difference is which pack's tools are listed **directly**; `ask_pipeworx`
reaches all of them from either one.

## No MCP client? Call it over HTTP

```bash
curl -X POST https://gateway.pipeworx.io/v1/tools/tx_clinic_rates \
  -H 'Content-Type: application/json' \
  -d '{"program":"FQHC","provider":"Atascosa Health Center","limit":3}'
```

No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/tx_clinic_rates`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.

## Run it from npm

`@pipeworx/mcp-tx-medicaid-rates` is a local stdio bridge to the Pipeworx gateway: your MCP client
starts it with `npx`, and it forwards every call to the same
`https://gateway.pipeworx.io/tx-medicaid-rates/mcp` endpoint shown above. It needs network access;
there is no offline mode.

```json
{
  "mcpServers": {
    "tx-medicaid-rates": {
      "command": "npx",
      "args": ["-y", "@pipeworx/mcp-tx-medicaid-rates"]
    }
  }
}
```

Without a key it calls anonymously, capped at 50 calls a day. A free account
raises that to 200 a day: get a key at https://pipeworx.io/signup and add
`"env": { "PIPEWORX_API_KEY": "<your key>" }` to the server entry.
The key is sent as a Bearer token, the same way a hosted connection sends it,
so calls are metered and billed exactly as they are there.

It lists **only** this pack's tools by default. Set `PIPEWORX_META_TOOLS=1` to
also list `ask_pipeworx` and the other gateway-wide tools.

Behind an HTTPS proxy: Node's built-in `fetch` does not read `HTTPS_PROXY` by
default. Newer Node releases honour it when `NODE_USE_ENV_PROXY=1` is set; check
your Node version's documentation.

## Using with ask_pipeworx

Instead of calling tools directly, you can ask questions in plain English —
this works on the pack endpoint above as well as on the full gateway:

```
ask_pipeworx({ question: "your question about Tx Medicaid Rates data" })
```

The gateway picks the right tool and fills the arguments automatically.

## More

- [Docs and guides](https://pipeworx.io/docs)
- [pipeworx.io](https://pipeworx.io)

## License

MIT