Skip to main content

FineRx MCP server

Give an AI assistant live access to FineRx drug-price data — the same catalog, package, price-comparison, and nearest-pharmacy data shown on the FineRx website — and the free FineRx discount card, through the Model Context Protocol.

finerx-mcp is a thin client over the FineRx public REST API (/api/public/v1). It has no direct database access and inherits the public API's authentication and rate limits, so it adds zero extra attack surface.

Tools

Tool What it does
search_drugs(query, limit=10) Find drugs by name/alias → candidates with slugs + from-prices
get_drug(slug, locale?, channel?) A drug's stats + strength/form variants + savingsCard
compare_prices(ndc, quantity, locale?, channel?) Offer matrix (chain × savings program × price × observation date) + savingsCard
find_nearby_pharmacies(zip, chains?, limit=3) Nearest store locations per chain around a ZIP
get_dataset_info() Dataset coverage, freshness, and attribution/disclaimer terms
get_savings_card(locale?, channel?, drug?) The free discount card: codes, how to use it, ways to save it — plus an image of the card
email_savings_card(email, consent, locale?) Email the card to an address the person gave, after they said yes
get_prescription_options(locale?, drug?) What to do when there is no prescription yet, or the brand costs too much

Every result embeds a one-line disclaimer and, wherever a price appears, an observedAt date. No tool ever returns hidden vendors or an operator reference price.

The server also ships instructions (served to the client as system-level guidance: quote the observation date, offer the card whenever you quote a price, never say guaranteed/best/cheapest, never give medical advice), two resources — finerx://card (the card as markdown) and finerx://how-it-works — and two prompts, price_and_card(drug) and prescription_help(drug?).

Handing over the card

The card is the free LowerMyRx discount card FineRx distributes. It is not insurance, needs no signup, and is credited at the pharmacy counter by the group code — so an assistant can hand it over completely, with no click-through:

  • get_savings_card returns the three counter codes, what the card is and is not, the steps to use it, the sentence to say to the pharmacist, an optional observed price with its date, an FAQ and the legal lines — and a PNG of the card as an image content block, so a chat client can show something the person saves to their phone. The PNG is fetched once per process and cached in memory; if that fetch fails the tool still returns the card text, and imageUrl is in the JSON either way for clients that cannot render images.
  • email_savings_card sends one card-only message. It refuses without consent=true and never calls the API in that case — the assistant has to ask for the address and an explicit yes first. The result masks the address (j***@example.com); FineRx does not store it. 503 means email delivery is off (offer the image or the link instead), 429 means the abuse cap was hit.
  • compare_prices / get_drug carry the same card object as savingsCard, so the card is present in the same turn as the price. Say "lowest" only when savingsCard.price.isLowest is true; otherwise repeat the provided note.
  • Every URL the tools return carries src=<channel> (default mcp), so the assistant that sent someone is visible in FineRx's own analytics — nothing about the person is.

Prerequisites

Configuration

The server reads two environment variables:

Variable Required Default Notes
FINERX_API_KEY yes — Your frx_live_... key
FINERX_API_BASE no https://finerxfinder.com/api/public/v1 Point at another host for local testing
FINERX_CARD_IMAGE_URL no https://www.finerxfinder.com/card.png PNG get_savings_card returns, when the API response names no delivery.imageUrl
FINERX_MCP_TRANSPORT no stdio streamable-http for the remote endpoint
FINERX_MCP_HOST / FINERX_MCP_PORT no 127.0.0.1 / 8000 Bind address for the HTTP transport
FINERX_MCP_STATELESS no 1 (on) 0 restores per-session HTTP transports (see below)

Install & run

Run directly with uvx (no manual install needed):

FINERX_API_KEY=frx_live_xxxxxxxx uvx finerx-mcp

The server speaks MCP over stdio by default.

Remote (HTTP) mode

The same tools can be served over Streamable HTTP — the transport that connector catalogs (ChatGPT Apps, Claude connectors, Gemini, Grok) consume, so a user adds FineRx by URL with no local install. Set the transport (and, for a hosted deployment, the bind host/port):

FINERX_API_KEY=frx_live_xxxx \
FINERX_MCP_TRANSPORT=streamable-http \
FINERX_MCP_HOST=0.0.0.0 FINERX_MCP_PORT=9000 \
uvx finerx-mcp
# → endpoint at http://<host>:9000/mcp

Defaults stay stdio, so existing Claude Desktop/Code/Cursor configs are unaffected. The HTTP endpoint calls the same public REST API with the server's FINERX_API_KEY, so hosting it exposes no data beyond the already-public API.

HTTP mode is stateless by default. Keyless one-shot connector calls — a catalog probe, a single tool call from a chat — open a Streamable-HTTP session and never DELETE it, so in session mode the transport map only grows (measured on the hosted endpoint: 3568 sessions over 7 days, ~25 MB of swap a day, until the container restarts). Stateless mode builds a transport per request and drops it. It is safe here because no tool keeps per-session state: every call is a fresh request against the public API, and the card-image cache is process-level, not per-session. Set FINERX_MCP_STATELESS=0 if you need SSE resumability; stdio ignores the setting entirely.

Claude Desktop

Add to your claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "finerx": {
      "command": "uvx",
      "args": ["finerx-mcp"],
      "env": {
        "FINERX_API_KEY": "frx_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}

Restart Claude Desktop; the FineRx tools appear in the tools menu.

Claude Code

claude mcp add finerx --env FINERX_API_KEY=frx_live_xxxx -- uvx finerx-mcp

Or add it to .mcp.json in your project:

{
  "mcpServers": {
    "finerx": {
      "command": "uvx",
      "args": ["finerx-mcp"],
      "env": { "FINERX_API_KEY": "frx_live_xxxxxxxx" }
    }
  }
}

Local development

Run against a local FineRx stack (e.g. the dev proxy on :8080):

export FINERX_API_KEY=frx_live_...        # a key you created via the CLI
export FINERX_API_BASE=http://localhost:8080/api/public/v1
uv run --project packages/finerx-mcp finerx-mcp

A smoke test that drives one tool call end-to-end lives at scripts/smoke_mcp.py in the FineRx repo.

Run the unit tests (HTTP is stubbed — no key, no network):

uv run --project packages/finerx-mcp --with pytest --with pytest-asyncio \
    pytest packages/finerx-mcp/tests -q

Terms

Data is provided under the FineRx public API terms: attribution required ("Prices via FineRx"), prices are observed estimates (not guaranteed or insured prices) and may be out of date, and nothing here is medical advice. Pharmacy location coordinates are © OpenStreetMap contributors (ODbL).

Metadata

Release files for finerx-mcp 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for finerx-mcp 1.3.0
File Size Uploaded
finerx_mcp-1.3.0.tar.gz 18.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for finerx-mcp 1.3.0
File Interpreter ABI Platform
finerx_mcp-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.7 kB

Release files / finerx_mcp-1.3.0.tar.gz

Download URL finerx_mcp-1.3.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
56ff053ecd2447519e00b1f3eb7792ef79e466a98009ea4d860c6ce965f6c55e
BLAKE2b-256 checksum
How to use checksums
481aa8bf6f26c2b52d00faa13b912a4605d7709910908f152bbece5d96fba7a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / finerx_mcp-1.3.0-py3-none-any.whl

Download URL finerx_mcp-1.3.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05d60d37e150b95527ee0db4fe6a94b2798a0db9f230f3413df03838df82406c
BLAKE2b-256 checksum
How to use checksums
2f811d67095c40d1cd0fc781db4f8dc94f2c5a242e315bd665ee1368852a6455
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page