CoEat Home
Model Context Protocol
Read-Only API
Streamable HTTP

CoEat MCP Server

Access your CoEat nutrition data from your AI assistant (Claude Desktop, ChatGPT, etc.). Let AI answer questions like "What did I eat today?" or "How's my calorie goal?"

What can you do?

Ask your AI assistant questions like these

🍱

What did I eat today?

You had a Chinese-style bento (860kcal) at 12:30

📊

What's my calorie achievement this week?

This week: 87% achievement, avg 1,698kcal/day

🎯

How many calories can I still eat?

Remaining: 1,090kcal (P: 68.5g, F: 17.2g, C: 162.6g)

📋

Show me the latest weekly report

Feb 8-14: 26 meals, 11,885kcal total, coach message...

Setup Guide

Claude Desktop / Claude Code

Local MCP server (Stdio transport). Connect in 2 steps with automatic download via npx.

1

Configure Your AI Client

For Claude Desktop, add the following to your config file (claude_desktop_config.json). For Claude Code, add to .mcp.json:

claude_desktop_config.json / .mcp.json
{
  "mcpServers": {
    "coeat": {
      "command": "npx",
      "args": ["-y", "@coeat/mcp-server"],
      "env": {
        "COEAT_API_URL": "https://coeat.life",
        "COEAT_SUPABASE_URL": "https://lhwcqfkkbgcerduiswat.supabase.co",
        "COEAT_SUPABASE_ANON_KEY": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imxod2NxZmtrYmdjZXJkdWlzd2F0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzkwNTc0NTMsImV4cCI6MjA1NDYzMzQ1M30.a-sK8VFrXiGWVm4pjFZHLUvuJNUZ5zP17i02CJ3PiK0",
        "COEAT_EMAIL": "<your-email>",
        "COEAT_PASSWORD": "<your-password>"
      }
    }
  }
}

Replace placeholders:

  • <your-email>your CoEat login email
  • <your-password>your CoEat login password

Requires Node.js 18+. npx will automatically download the package on first run.

2

Test the Connection

Restart your AI assistant and try asking:

U

What did I eat today?

AI

Let me check your CoEat data. Today you had a Chinese-style bento at 12:30. It was 860kcal with P:32.5g, F:36.8g, C:102.4g. That's 44.1% of your 1,950kcal daily target.

ChatGPT / Remote MCP

New

Connect directly from ChatGPT or remote MCP clients. No local installation required.

1

Remote MCP Endpoint

Set the following URL as your MCP server endpoint:

MCP Endpoint URL
https://coeat.life/api/mcp

Supports Streamable HTTP transport. Bearer token authentication required.

2

ChatGPT Setup

  1. Enable Settings → Developer Mode in ChatGPT
  2. Select Add MCP Server in the Tools section
  3. Enter https://coeat.life/api/mcp as the Server URL
  4. Select Bearer Token for Authentication and enter your Supabase JWT token

How to get a Bearer Token

After logging into CoEat, run (await supabase.auth.getSession()).data.session?.access_token in your browser DevTools Console to get the token. The token expires after 1 hour.

3

Other Remote MCP Clients

Any client that supports Streamable HTTP MCP can connect in a similar way.

curl Example
curl -X POST https://coeat.life/api/mcp \
  -H "Authorization: Bearer <supabase_jwt>" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

MCP Tools

Available tools for your AI assistant (all read-only). Works with both local and remote connections.

get_profile

Get user profile and nutrition targets (TDEE & PFC)

get_todays_meals

Get today's meal list

get_meals

Get meal history filtered by date, period, or count

Params: date?, from?, to?, limit?

get_daily_summary

Daily nutrition summary (consumed vs targets, achievement, remaining)

Params: date? (default: today)

get_weekly_report

Get the latest weekly AI report

get_weekly_reports

Get weekly reports list

Params: limit? (default: 10)

MCP Resources

Local only

Available only on the local MCP server (Stdio). For remote MCP, use Tools instead.

coeat://profile- Profile & targets
coeat://meals/today- Today's meals
coeat://summary/today- Today's summary
coeat://reports/latest- Latest weekly report

REST API

REST API used internally by the MCP server. Can also be used directly.

Authentication

Send your Supabase JWT token as a Bearer token:

Authorization: Bearer <supabase_access_token>

RLS (Row Level Security) is automatically applied. You can only access your own data. Rate limit: 30 req/min/IP.

Endpoints

POST/api/mcpRemote MCP endpoint (Streamable HTTP)
GET/api/v1/profileProfile + PFC targets
GET/api/v1/meals/todayToday's meals
GET/api/v1/daily-summaryDaily summary (consumed vs targets)
GET/api/v1/mealsMeal history
GET/api/v1/reports/latestLatest weekly report
GET/api/v1/reportsWeekly reports list

Example

# Get today's nutrition summary
curl -H "Authorization: Bearer <token>" \
  https://coeat.life/api/v1/daily-summary

# Get meal history
curl -H "Authorization: Bearer <token>" \
  https://coeat.life/api/v1/meals?limit=10

# Get your profile & targets
curl -H "Authorization: Bearer <token>" \
  https://coeat.life/api/v1/profile

Daily Summary Response

{
  "date": "2026-02-15",
  "consumed":    { "calories": 860,  "protein": 32.5, "fat": 36.8, "carbs": 102.4 },
  "targets":     { "calories": 1950, "protein": 101,  "fat": 54,   "carbs": 265   },
  "remaining":   { "calories": 1090, "protein": 68.5, "fat": 17.2, "carbs": 162.6 },
  "mealCount": 1,
  "achievement": { "calories": 44.1, "protein": 32.2, "fat": 68.1, "carbs": 38.6  }
}