Skip to main content
Glama
ruffood
by ruffood

cn-food-mcp

MCP server for Chinese food nutrition data. Provides ~1725 foods with 25 nutrients per 100g.

Usage

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "cn-food": {
      "command": "npx",
      "args": ["-y", "cn-food-mcp"]
    }
  }
}

Cursor

Add to Cursor MCP settings:

{
  "mcpServers": {
    "cn-food": {
      "command": "npx",
      "args": ["-y", "cn-food-mcp"]
    }
  }
}

Related MCP server: USDA Nutrition Database MCP Server

Tools

list_nutrients

List all available nutrient fields with Chinese/English names and units.

Parameters: none

Example: {}

{
  "per_100g": true,
  "nutrients": [
    { "field": "energy", "name_cn": "能量", "name_en": "Energy", "unit": "kcal" },
    { "field": "protein", "name_cn": "蛋白质", "name_en": "Protein", "unit": "g" },
    { "field": "carbohydrate", "name_cn": "糖类", "name_en": "Carbohydrate", "unit": "g" },
    { "field": "fat", "name_cn": "脂肪", "name_en": "Fat", "unit": "g" },
    { "field": "vitamin_a", "name_cn": "维生素A", "name_en": "Vitamin A", "unit": "μg" },
    { "field": "calcium", "name_cn": "钙", "name_en": "Calcium", "unit": "mg" },
    "... (25 nutrients total)"
  ]
}

search_food

Search foods by name.

Parameters:

  • query (string) — Food name keyword

Example: { "query": "豆腐" }

{
  "count": 20,
  "foods": [
    {
      "id": 285,
      "name": "豆腐",
      "energy_kcal": 81,
      "protein_g": 8.1,
      "fat_g": 3.7,
      "carbohydrate_g": 3.8
    },
    {
      "id": 286,
      "name": "豆腐(北)",
      "energy_kcal": 98,
      "protein_g": 12.2,
      "fat_g": 4.8,
      "carbohydrate_g": 1.5
    }
  ]
}

get_nutrition

Get full nutrition data for a food by ID (from search_food).

Parameters:

  • food_id (number) — Food ID

Example: { "food_id": 579 }

{
  "id": 579,
  "name": "鸡蛋(白皮)",
  "energy": 138,
  "protein": 12.7,
  "carbohydrate": 1.5,
  "fat": 9,
  "water": 75.8,
  "fiber": 0,
  "ash": 1,
  "vitamin_a": 310,
  "carotene": 0,
  "retinol_equivalent": 310,
  "vitamin_b1": 0.09,
  "vitamin_b2": 0.31,
  "niacin": 0.2,
  "vitamin_c": 0,
  "vitamin_e": 1.23,
  "potassium": 98,
  "sodium": 94.7,
  "calcium": 48,
  "magnesium": 14,
  "iron": 2,
  "manganese": 0.03,
  "zinc": 1,
  "copper": 0.06,
  "phosphorus": 176,
  "selenium": 16.55,
  "unit": 100
}

compare_foods

Compare nutrition of 2-5 foods side by side.

Parameters:

  • food_ids (number[]) — Array of 2-5 food IDs

Example: { "food_ids": [579, 580, 586] }

{
  "unit": 100,
  "foods": [
    { "id": 579, "name": "鸡蛋(白皮)", "energy": 138, "protein": 12.7, "fat": 9, "..." : "..." },
    { "id": 580, "name": "鸡蛋(红皮)", "energy": 156, "protein": 12.8, "fat": 11.1, "..." : "..." },
    { "id": 586, "name": "鸡蛋黄", "energy": 328, "protein": 15.2, "fat": 28.2, "..." : "..." }
  ]
}

filter_by_nutrient

Filter foods by nutrient range.

Parameters:

  • nutrient (string) — One of: energy, protein, carbohydrate, fat, water, fiber, ash, vitamin_a, carotene, retinol_equivalent, vitamin_b1, vitamin_b2, niacin, vitamin_c, vitamin_e, potassium, sodium, calcium, magnesium, iron, manganese, zinc, copper, phosphorus, selenium

  • min (number, optional) — Minimum value (inclusive)

  • max (number, optional) — Maximum value (inclusive)

  • limit (number, optional) — Max results, default 20

  • sort ("asc" | "desc", optional) — Sort order, default "desc"

Example: { "nutrient": "protein", "min": 30, "sort": "desc", "limit": 3 }

{
  "nutrient": "protein",
  "count": 3,
  "foods": [
    { "id": 875, "name": "骆驼掌", "protein": 72.8 },
    { "id": 899, "name": "曼氏无针乌贼", "protein": 65.3 },
    { "id": 959, "name": "墨鱼(干)", "protein": 65.3 }
  ]
}

License

MIT

Available Tools

5 tools
compare_foodsA

对比多个食物的营养成分(每100g),提供2-5个食物ID

ParametersJSON Schema
NameRequiredDescriptionDefault
food_idsYes食物ID数组

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds value by disclosing the per-100g normalization and the 2-5 ID constraint, but it does not explain what 'compare' means in output terms (e.g., side-by-side table, differences) or address error handling, which is a notable gap for a tool with no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that front-loads the core action and includes essential constraints. Every word earns its place, with no redundant fluff or repetition of schema details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (one parameter, no output schema), and the description covers the key functional context: the comparison basis (per 100g) and input size limits. However, it omits what the response looks like (e.g., array of nutrient comparisons), which would be useful given the lack of an output schema. Still, for a straightforward comparison tool, the description is largely complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (food_ids is described as '食物ID数组' and already has minItems/maxItems constraints). The description redundantly states 'provide 2-5 food IDs', adding no new semantic meaning beyond what the schema provides. Baseline 3 is appropriate since the schema carries the parameter details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: comparing nutritional components of multiple foods per 100g. It specifies a concrete verb ('对比' / compare), resource (foods' nutritional components), and scope (per 100g), which distinguishes it from siblings like get_nutrition (likely single-food) and list_nutrients.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying input requirements (2-5 food IDs), but it does not explicitly state when to prefer this tool over siblings or provide exclusions. There is no mention of alternatives like get_nutrition for single foods or filter_by_nutrient for filtering by nutrient, leaving usage context only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

filter_by_nutrientA

按营养素范围筛选食物,如查找高蛋白、低脂肪的食物

ParametersJSON Schema
NameRequiredDescriptionDefault
maxNo最大值(含)
minNo最小值(含)
sortNo排序方向,默认降序desc
limitNo返回数量上限,默认20
nutrientYes营养素字段名

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must carry the full burden of behavioral disclosure. It only states the tool filters by nutrient range, without mentioning return format, pagination, sorting behavior, or any edge cases. This is minimal transparency beyond the tool's name.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence in Chinese that front-loads the action ('filter foods by nutrient range') and includes a useful example. Every word contributes, with no redundant or filler content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and the schema covers parameters well, but there is no output schema or annotation to explain what the tool returns. The description doesn't clarify whether the result is a list of food names, full nutrition profiles, or something else, leaving an important gap for invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage with detailed descriptions for every parameter (e.g., min/max limits, sort direction, nutrient enum). The description adds a brief example linking nutrients to min/max ranges, but this only slightly enhances the schema's already clear semantics, so a baseline 3 is warranted.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool filters foods by nutrient range, with a concrete example (high protein, low fat). The verb 'filter' and resource 'foods' are explicit, and the nutrient-range scope distinguishes it from sibling tools like search_food or get_nutrition.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit alternatives or exclusion criteria are mentioned, but the example ('find high protein, low fat foods') implies a use case for nutrient-based filtering. This gives some contextual guidance but does not explicitly distinguish when to use this tool over search_food or get_nutrition.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_nutritionA

获取某个食物的完整营养成分(每100g),需提供食物ID(通过 search_food 获取)

ParametersJSON Schema
NameRequiredDescriptionDefault
food_idYes食物ID

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the disclosure burden. It adds the behavioral detail that results are normalized per 100g, which is useful. However, it does not disclose other traits such as whether it's a read-only operation, any rate limits, or the return structure, leaving gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that front-loads the main action, input requirement, and unit. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter get operation, the description adequately explains what is returned (complete nutrition per 100g) and the prerequisite (using search_food). The absence of an output schema and annotations is acceptable for such a simple tool, though more detail could be added.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema describes food_id as '食物ID' with full coverage. The description adds context that the ID is obtained from search_food and that nutrition is provided per 100g, enriching parameter meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly specifies the tool's function: retrieving complete nutrition information per 100g for a given food identified by an ID. It distinguishes itself from siblings by explicitly referencing search_food as the source for the ID and focuses on nutrition retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the required input (food_id) and how to obtain it (via search_food), providing direct usage context. However, it does not explicitly mention when to use this tool over compare_foods or filter_by_nutrient, though the purpose is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_nutrientsA

列出所有可查询的营养素字段名、中英文名称和单位

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It states what is listed but does not disclose return format, pagination, or side effects. For a simple listing operation, this is adequate but minimal; it lacks explicit read-only confirmation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, compact sentence in Chinese that directly communicates the tool's function without unnecessary words. It is front-loaded with the action verb '列出'.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description covers the core return content (field names, Chinese/English names, units). It lacks detail on output structure or formatting but is sufficient for a parameterless listing tool with low complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the baseline is 4. The description correctly focuses on return content rather than parameter syntax, which is appropriate given the absence of inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists all queryable nutrient field names, Chinese/English names, and units. It uses a specific verb (列出) and resource, making it distinct from sibling tools that search foods or get nutrition data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The purpose implies using this tool to discover available nutrient fields before querying, but it does not explicitly state when to use it versus alternatives like filter_by_nutrient or get_nutrition. No exclusions or alternative references are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_foodA

按名称搜索中国食物,返回匹配的食物列表(含ID、名称、主要营养素摘要)

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes食物名称关键词,如「鸡蛋」「牛肉」「米饭」

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the responsibility for behavioral disclosure. It discloses the return format (matching foods with ID, name, main nutrient summary) but does not mention search matching rules (e.g., exact vs partial), result limits, or whether the operation is read-only, though 'search' implies non-mutating behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that immediately states the action and output. No redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple search tool with one parameter and no output schema, the description provides essential information including return fields. It could be more complete by mentioning response limits or matching behavior, but it is adequate for a basic search use case.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema covers 100% of parameter meaning with a clear description and examples. The tool description adds no further parameter semantics beyond what the schema already states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description states a specific action ('search Chinese food by name') and lists the return payload (ID, name, nutrient summary). This clearly differentiates from sibling tools like compare_foods or get_nutrition, which focus on comparison or specific retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for name-based searches but does not explicitly say when to use it versus alternatives like filter_by_nutrient or compare_foods. No exclusions or alternative tool references are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv1.0.0
    • First observedcompare_foods
    • First observedfilter_by_nutrient
    • First observedget_nutrition
    • First observedlist_nutrients
    • First observedsearch_food

TDQS

A4.1/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct role: listing nutrient metadata, searching by name, retrieving full details, comparing multiple foods, and filtering by nutrient criteria. There is no meaningful overlap between them.

Naming Consistency5/5

All tool names follow a consistent snake_case verb-first pattern (list_, search_, get_, compare_, filter_by_). Although filter_by_nutrient uses a preposition, it remains predictable and aligned with the others.

Tool Count5/5

With 5 tools, the server is well-scoped for a food nutrition lookup domain. Each tool addresses a distinct user need without unnecessary redundancy.

Completeness5/5

The tool surface covers the full read-only workflow: discovering available nutrients, finding foods by name or nutrient criteria, getting detailed data, and comparing foods. There are no obvious dead ends or missing operations for the stated purpose.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Provides comprehensive food hierarchy and nutrition data through structured tools that enable searching foods, browsing categories, and retrieving detailed nutritional information from a MongoDB Atlas database.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides intelligent access to the USDA nutrition database through AI assistants, enabling users to search foods, compare nutritional content, find foods high in specific nutrients, and query authoritative nutrition data across 7,146+ food items through natural language.
    1
    -