Connect your AI assistant to Mdexa
Mdexa is a medical database your AI assistant can query for you. You need a free account.
Live now: BRFSS, NHANES, NHIS, PLACES and more. Read rows, run counts, search codebooks, with official text in every answer.
What you need
An AI assistant on your computer, such as Claude Code or Codex.
This guide uses Claude Code: one pasted line connects it.
An email address, or a Google, Microsoft or GitHub account.
Sign up, free
Enter your email and a password, then the 6-digit code we email you.
Or continue with Google, Microsoft or GitHub.
A free account gets 50 calls a month.
Create a key
In the console, open Keys and press Create key, then Create key again in the window that opens.
Copy the key right away: it is shown only once.
Connect Claude Code
Still in that window, press Set up a client with it: the Claude Code line there already holds your key.
Copy that line, open a terminal, paste it and press Enter.
To open a terminal: Terminal on a Mac, PowerShell on Windows.
claude mcp add --transport http mdexa https://mcp.mdexa.com/mcp --header "Authorization: Bearer YOUR_KEY"Closed that window? Copy the line above instead and put your key where it says YOUR_KEY.
Using Codex or another assistant? Setup guide
Check it works
In the same terminal, type
claudeand press Enter, then ask:Use Mdexa to count the rows in the NHANES file DEMO_J.
When Claude Code asks to use Mdexa, allow it.
Then open the console: the number under Calls this month has gone up.
If it does not work
- Claude Code does not show Mdexa: start it from a terminal in the same folder where you pasted the line.
- Wrong key: run
claude mcp remove mdexa, then paste the line again with the right key. - Lost the key: revoke it under Keys and create a new one.
- Out of calls this month: the count starts again next month.
Keep it safe
- Treat your key like a password: never post it or share a screenshot of it.
- If it may have leaked, revoke it under Keys.
- Mdexa needs no patient information: never paste anything that could identify a patient.