Skip to main content

Set up in CLI tools

This guide connects the Nutritionist Pro MCP server to command-line coding agents. Use the AI applications guide instead if you work in a desktop app such as Claude Desktop.

Replace your key

This page uses the production server URL https://mcp.nutritionistpro.com. Wherever you see <MCP_API_KEY>, paste your personal MCP key (it starts with npmcp_). See Get your MCP key if you do not have one yet.

Claude Code​

Claude Code supports remote HTTP MCP servers directly, so no bridge is needed.

Add the server​

Run the claude mcp add command with the HTTP transport and an authorization header:

claude mcp add --transport http nutritionist-pro https://mcp.nutritionistpro.com \
--header "Authorization: Bearer <MCP_API_KEY>"

By default this adds the server to your user configuration so it is available in every project. Add --scope project instead to share it with a repository through a checked-in .mcp.json file. Do not commit real keys: keep <MCP_API_KEY> in an environment variable or local config that is ignored by Git.

Or edit .mcp.json directly​

To share the server with a project, add it to the repository's .mcp.json:

{
"mcpServers": {
"nutritionist-pro": {
"type": "http",
"url": "https://mcp.nutritionistpro.com",
"headers": {
"Authorization": "Bearer <MCP_API_KEY>"
}
}
}
}

Verify​

Start Claude Code and run /mcp. The nutritionist-pro server should be listed as connected. Then ask Claude Code to run the whoami tool to confirm it is authenticated as the right account.

Codex CLI​

The Codex CLI reads MCP servers from ~/.codex/config.toml. The server is remote, so connect through the mcp-remote bridge (which requires Node.js 18+).

Add the server​

Run codex mcp add and pass the bridge command after --:

codex mcp add nutritionist-pro \
--env NP_AUTH="Bearer <MCP_API_KEY>" -- \
npx -y mcp-remote@latest https://mcp.nutritionistpro.com \
--header 'Authorization:${NP_AUTH}'

This writes the mcp_servers.nutritionist-pro table to ~/.codex/config.toml for you.

Or edit config.toml directly​

Instead of the command above, you can edit ~/.codex/config.toml (create it if needed) and add the table yourself:

[mcp_servers.nutritionist-pro]
command = "npx"
args = [
"-y",
"mcp-remote@latest",
"https://mcp.nutritionistpro.com",
"--header",
"Authorization:${NP_AUTH}",
]

[mcp_servers.nutritionist-pro.env]
NP_AUTH = "Bearer <MCP_API_KEY>"

Verify​

Restart the Codex CLI, then list available tools (for example, ask it to run the whoami tool). A successful whoami response confirms the connection and authentication.

Keep your key out of Git​

In every method above, treat <MCP_API_KEY> as a secret:

  • Prefer storing it in an environment variable and referencing that variable rather than pasting the literal key.
  • If you must put it in a file, make sure that file is listed in .gitignore.
  • Never commit a real key to a shared repository.

Troubleshooting​

  • Server not connected: confirm the URL and that your network can reach https://mcp.nutritionistpro.com.
  • 401 / authentication errors: re-check <MCP_API_KEY> and the header scheme (for example Bearer).
  • 403 "This account has no active subscription.": the key is valid, and your subscription has ended, been cancelled, or been frozen. The same key works again once your subscription is active.
  • npx not found (Codex CLI): install Node.js 18+ and reopen your terminal.