NutriScan MCP server in Claude Code
Nutrition MCP for Claude Code
Add the NutriScan MCP server to Claude Code and the agent can analyze a meal, fetch a scan and check your credits while it works in your repo. It sees the real result JSON.
The test key is free and returns a sample result. Credit packs start at $49, with no subscription.
export NUTRISCAN_KEY="ns_test_..."
claude mcp add --transport http nutriscan https://platform-api.nutriscan.app/mcp \
--header "Authorization: Bearer $NUTRISCAN_KEY"One command with a free test key. The key stays in your environment.
What can Claude Code do with NutriScan?
It can call the same three endpoints your app will call, from inside a coding session, and use the answers to write and check your code.
Build a meal-logging feature on the real shape
Ask Claude Code to call analyze_meal with your test key, then write the parser, types and the item list from the JSON it got back, with every field name and unit as the API sends them.
Seed test fixtures with real dishes
With a live key, have it scan a few text meals, such as a Philly cheesesteak, a Schweineschnitzel with potato salad and a quiche lorraine with a green salad, and save each result under tests/fixtures. Three scans cost about 200 credits, about $0.20.
Debug a support ticket
Paste a scan id from your logs. Claude Code fetches it with get_scan, free, and compares it with what your app showed.
How do you set it up?
3 steps, and you need nothing but a free test key to start.
Every option in the MCP server docs, including curl.
Get a test key
Sign in at platform.nutriscan.app with your email and a 6-digit code. The test key is free.
Add the server
Export the key and add the server. The shell fills in the key when you run the command. Add
--scope userto use the server in every project.export NUTRISCAN_KEY="ns_test_..." claude mcp add --transport http nutriscan https://platform-api.nutriscan.app/mcp \ --header "Authorization: Bearer $NUTRISCAN_KEY"Or share it with your team
Commit
.mcp.jsonin the project root. It holds no key: each person setsNUTRISCAN_KEYin their own environment, and Claude Code fills it in when it starts.{ "mcpServers": { "nutriscan": { "type": "http", "url": "https://platform-api.nutriscan.app/mcp", "headers": { "Authorization": "Bearer ${NUTRISCAN_KEY}" } } } }
How do you check that it works?
Run /mcp inside a Claude Code session. The list shows nutriscan with its three tools: analyze_meal, get_scan and get_usage.
From the terminal, claude mcp list does the same. Then ask for a scan: a test key always answers with the same sample, grilled chicken with rice and salad at 515 kcal.
Example prompts
Write them as you would to a colleague. The agent picks the tool.
"Call analyze_meal with '2 eggs and a slice of toast' and write a TypeScript type for the result."
The agent calls the tool, reads the JSON and writes the type from it.
"Scan '1 Laugenbrezel mit Butter' in German and save the result as tests/fixtures/brezel.json."
A text scan with language set to de. Use a live key for a real result.
"Fetch scan scn_Q2mX8rT4vK1pLw9eZb3nYh6A and tell me which item has the most sodium."
get_scan is free, so this costs nothing.
Troubleshooting
The error codes are listed on errors.
Every call fails with HTTP 401
The header is missing or empty, usually because NUTRISCAN_KEY was not set when you ran claude mcp add. Export the key, run claude mcp remove nutriscan and add it again. With .mcp.json, set the variable in the shell you start Claude Code from.
Tools are listed but calls return invalid_api_key
The key is wrong or revoked. The server checks it only when a tool runs, so the list still loads. Copy a fresh key from the console.
Calls return insufficient_credits
A live scan needs 20 credits to start. Buy a pack, or switch back to the test key while you build.
What does it cost?
The same credits as the REST API, and nothing for the MCP server itself.
A scan with a live key costs about 65 credits for a typical plate, as in REST. get_scan, get_usage and every test-key call are free. An agent in a loop can spend credits fast, so build with the test key and keep a live key for fixture runs.
Common questions
Every tool argument and error is in the MCP server docs.
Do I need the Claude desktop app to use NutriScan in Claude Code?
No. Claude Code connects to the remote server over HTTP with your API key in a header.
Is my API key stored in the project?
Only if you put it there. claude mcp add saves the server in your own Claude Code settings, and .mcp.json refers to ${NUTRISCAN_KEY} so the committed file holds no key.
Why does every scan return grilled chicken?
You are using a test key. It returns a fixed sample result at no cost. Switch to a live key from the console for real scans.
Give Claude Code a real nutrition API to build against
Sign in with your email, add the server with the test key, and buy credits when you want real scans.
- Test key at sign-up
- Packs from $49
- No subscription
- Credits never expire

