Metadata-Version: 2.4
Name: nutriref-mcp
Version: 0.2.3
Summary: MCP server for NutriRef — pay-per-call USDA nutrition for AI agents (x402 + USDC on Base).
Author: Derek Hefley
License: MIT
Project-URL: Homepage, https://nutriref.xyz
Project-URL: Repository, https://github.com/Younghef/nutriref-api
Project-URL: Issues, https://github.com/Younghef/nutriref-api/issues
Keywords: mcp,nutrition,usda,x402,agents,food,fooddata-central
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: mcp>=1.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: eth-account>=0.13.0
Requires-Dist: x402[evm]>=2.10.0

# nutriref-mcp

MCP server for **[NutriRef](https://nutriref.xyz)** — pay-per-call USDA FoodData Central nutrition for AI agents, gated by [x402](https://www.x402.org/) micropayments in USDC on Base. No signup, no API keys.

It exposes four tools:

| Tool | What it does | Price |
|---|---|---|
| `nutrition_search` | Find foods by name, get `fdc_id` + macros | $0.001 |
| `nutrition_detail` | Full per-100g profile (13 nutrients) for one food | $0.002 |
| `nutrition_compare` | Compare 2–5 foods with per-nutrient winners | $0.003 |
| `nutrition_recipe` | Scale and sum nutrition across weighted ingredients | $0.005 |

## Install

```bash
pip install nutriref-mcp
```

Or run without installing:

```bash
uvx nutriref-mcp
```

## Configure your MCP client

Add this to your client config (Claude Desktop's `claude_desktop_config.json`, Claude Code's MCP settings, etc.):

```json
{
  "mcpServers": {
    "nutriref": {
      "command": "nutriref-mcp",
      "env": {
        "PAYER_PRIVATE_KEY": "0x...your-funded-wallet-key...",
        "NUTRIREF_BASE_URL": "https://nutriref.xyz"
      }
    }
  }
}
```

`PAYER_PRIVATE_KEY` is the private key of a Base mainnet wallet holding USDC — the wallet pays for each tool call. Use a dedicated wallet funded only with what you're willing to spend. `NUTRIREF_BASE_URL` is optional and defaults to `https://nutriref.xyz`.

## License

MIT
