ANSES Ciqual MCP Server
The ANSES Ciqual MCP Server provides SQL-based access to query nutritional data from the French food composition database containing over 3,185 foods.
Key Capabilities:
Search foods with bilingual support (French/English) and fuzzy/full-text search via
foods_ftstable for typo toleranceRetrieve comprehensive nutritional profiles with 60+ nutrients including energy, macronutrients (protein, carbohydrates, fat, fiber, sugars), vitamins, and minerals
Execute complex SQL queries using standard SQLite syntax (SELECT, WITH, JOINs, GROUP BY, ORDER BY, aggregates)
Find foods by nutritional criteria to identify high-protein, low-sodium, or high-fiber options based on specific thresholds
Compare nutritional content across multiple foods for dietary analysis
Filter by data confidence levels (A/B/C/D ratings) and food group classifications
Access automatically updated data refreshed yearly from the official ANSES Ciqual source
Work with a read-only database ensuring data integrity with no modification risk
Compatible with various MCP clients including Claude Desktop, Gemini CLI, and Codex CLI
The server is distributed through PyPI for easy installation via pip
Used for running unit and functional tests of the MCP server
The server is implemented in Python and provides direct Python API access to the nutritional database
Provides SQL query access to the ANSES Ciqual French food composition database stored in SQLite format, enabling nutritional data queries for over 3,000 foods
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ANSES Ciqual MCP Servershow me the nutritional content of apples"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ANSES Ciqual MCP Server
An MCP (Model Context Protocol) server providing SQL access to the ANSES Ciqual French food composition database. Query nutritional data for over 3,000 foods with full-text search support.

Features
π Comprehensive Database: Access nutritional data for 3,185+ French foods
π SQL Interface: Query using standard SQL with full flexibility
π Bilingual Support: French and English food names
π€ Fuzzy Search: Built-in full-text search with typo tolerance
π 60+ Nutrients: Detailed composition including vitamins, minerals, macros, and more
π Auto-Updates: Automatically refreshes data yearly from ANSES (checks on startup)
π Read-Only: Safe queries with no risk of data modification
πΎ Lightweight: ~10MB SQLite database with efficient indexing
Related MCP server: Open Food Facts MCP Server
Installation
Via pip
pip install ciqual-mcpVia uvx (recommended)
uvx ciqual-mcpFrom source
git clone https://github.com/zzgael/ciqual-mcp.git
cd ciqual-mcp
pip install -e .MCP Client Configuration
Claude Desktop
Add to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"ciqual": {
"command": "uvx",
"args": ["ciqual-mcp"]
}
}
}Gemini CLI
Add to your Gemini CLI configuration file ~/.gemini/settings.json:
{
"mcpServers": {
"ciqual": {
"command": "uvx",
"args": ["ciqual-mcp"]
}
}
}Codex CLI
Add to your Codex CLI configuration file ~/.codex/config.toml:
[mcp_servers.ciqual]
command = "uvx"
args = ["ciqual-mcp"]Usage
As an MCP Server
The server implements the Model Context Protocol and exposes a single query function:
# Start the server standalone (for testing)
ciqual-mcpDirect Python Usage
from ciqual_mcp.data_loader import initialize_database
# Initialize/update the database
initialize_database()
# Then use SQLite directly
import sqlite3
conn = sqlite3.connect("~/.ciqual/ciqual.db")
cursor = conn.execute("SELECT * FROM foods WHERE alim_nom_eng LIKE '%apple%'")API Documentation
MCP Function: query
The server exposes a single MCP function for executing SQL queries on the Ciqual database.
Function Signature
async def query(sql: str) -> list[dict]Parameters
sql(string, required): The SQL query to execute on the databaseMust be a SELECT or WITH query (read-only access)
Supports all standard SQLite SQL syntax
Can use JOIN, GROUP BY, ORDER BY, etc.
Supports full-text search via the
foods_ftstable
Returns
list[dict]: Array of result rows, where each row is a dictionary with column names as keysEmpty list if no results match the query
Error dictionary with
"error"key if query fails
Error Handling
The function returns an error dictionary in these cases:
Database not initialized:
{"error": "Database not initialized..."}Non-SELECT query attempted:
{"error": "Only SELECT queries are allowed for safety."}SQL syntax error:
{"error": "SQL error: [details]"}Table not found:
{"error": "Table not found. Available tables: foods, nutrients, composition, foods_fts, food_groups"}
Example Usage in MCP Context
{
"method": "query",
"params": {
"sql": "SELECT f.alim_nom_eng, n.const_nom_eng, c.teneur, n.unit FROM foods f JOIN composition c ON f.alim_code = c.alim_code JOIN nutrients n ON c.const_code = n.const_code WHERE f.alim_nom_eng LIKE '%apple%' AND n.const_code IN (328, 25000, 31000)"
}
}Response Example
[
{
"alim_nom_eng": "Apple, raw",
"const_nom_eng": "Energy",
"teneur": 52.0,
"unit": "kcal/100g"
},
{
"alim_nom_eng": "Apple, raw",
"const_nom_eng": "Protein",
"teneur": 0.3,
"unit": "g/100g"
}
]Database Schema
Tables
foods - Food items
alim_code(INTEGER, PK): Unique food identifieralim_nom_fr(TEXT): French namealim_nom_eng(TEXT): English namealim_grp_code(TEXT): Food group code
nutrients - Nutrient definitions
const_code(INTEGER, PK): Unique nutrient identifierconst_nom_fr(TEXT): French nameconst_nom_eng(TEXT): English nameunit(TEXT): Measurement unit (g/100g, mg/100g, etc.)
composition - Nutritional values
alim_code(INTEGER): Food identifierconst_code(INTEGER): Nutrient identifierteneur(REAL): Value per 100gcode_confiance(TEXT): Confidence level (A/B/C/D)
foods_fts - Full-text search
Virtual table for fuzzy matching with French/English names
Common Nutrient Codes
Category | Code | Nutrient | Unit |
Energy | 327 | Energy | kJ/100g |
328 | Energy | kcal/100g | |
Macros | 25000 | Protein | g/100g |
31000 | Carbohydrates | g/100g | |
40000 | Fat | g/100g | |
34100 | Fiber | g/100g | |
32000 | Sugars | g/100g | |
Minerals | 10110 | Sodium | mg/100g |
10200 | Calcium | mg/100g | |
10260 | Iron | mg/100g | |
10190 | Potassium | mg/100g | |
Vitamins | 55400 | Vitamin C | mg/100g |
56400 | Vitamin D | Β΅g/100g | |
51330 | Vitamin B12 | Β΅g/100g |
Example Queries
Basic Search
-- Find foods by name
SELECT * FROM foods WHERE alim_nom_eng LIKE '%orange%';
-- Fuzzy search (handles typos)
SELECT * FROM foods_fts WHERE foods_fts MATCH 'orang*';Nutritional Queries
-- Get vitamin C content for oranges
SELECT f.alim_nom_eng, c.teneur as vitamin_c_mg
FROM foods f
JOIN composition c ON f.alim_code = c.alim_code
WHERE f.alim_nom_eng LIKE '%orange%'
AND c.const_code = 55400;
-- Find foods highest in protein
SELECT f.alim_nom_eng, c.teneur as protein_g
FROM foods f
JOIN composition c ON f.alim_code = c.alim_code
WHERE c.const_code = 25000
ORDER BY c.teneur DESC
LIMIT 10;
-- Compare macros for different foods
SELECT
f.alim_nom_eng as food,
MAX(CASE WHEN c.const_code = 25000 THEN c.teneur END) as protein_g,
MAX(CASE WHEN c.const_code = 31000 THEN c.teneur END) as carbs_g,
MAX(CASE WHEN c.const_code = 40000 THEN c.teneur END) as fat_g,
MAX(CASE WHEN c.const_code = 328 THEN c.teneur END) as calories_kcal
FROM foods f
JOIN composition c ON f.alim_code = c.alim_code
WHERE f.alim_nom_eng IN ('Apple, raw', 'Banana, raw', 'Orange, raw')
AND c.const_code IN (25000, 31000, 40000, 328)
GROUP BY f.alim_code, f.alim_nom_eng;Dietary Restrictions
-- Find low-sodium foods (<100mg/100g)
SELECT f.alim_nom_eng, c.teneur as sodium_mg
FROM foods f
JOIN composition c ON f.alim_code = c.alim_code
WHERE c.const_code = 10110
AND c.teneur < 100
ORDER BY c.teneur ASC;
-- High-fiber foods (>5g/100g)
SELECT f.alim_nom_eng, c.teneur as fiber_g
FROM foods f
JOIN composition c ON f.alim_code = c.alim_code
WHERE c.const_code = 34100
AND c.teneur > 5
ORDER BY c.teneur DESC;Data Source
Data is sourced from the official ANSES Ciqual database:
Website: https://ciqual.anses.fr/
Data portal: https://www.data.gouv.fr/fr/datasets/table-de-composition-nutritionnelle-des-aliments-ciqual/
The database is automatically updated yearly when the server starts (data hasn't changed since 2020, so yearly updates are sufficient).
Requirements
Python 3.9 or higher
50MB free disk space (for database)
Internet connection (for initial data download)
License
MIT License - See LICENSE file for details
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development
Running Tests
# Install development dependencies
pip install -e .
pip install pytest pytest-asyncio
# Run unit tests
python -m pytest tests/test_server.py -v
# Run functional tests (requires database)
python -m pytest tests/test_functional.py -vTroubleshooting
Database not initializing
Check internet connection
Ensure write permissions to
~/.ciqual/directoryTry manual initialization:
python -m ciqual_mcp.data_loader
XML parsing errors
The tool handles malformed XML automatically with recovery mode
If issues persist, delete
~/.ciqual/ciqual.dband restart
Credits
Developed by Gael Debost as part of GPT Workbench, a multi-LLM interface for medical research developed by Ideagency.
Data provided by ANSES (Agence nationale de sΓ©curitΓ© sanitaire de l'alimentation, de l'environnement et du travail).
Citation
If you use this tool in your research, please cite:
@software{ciqual_mcp,
title = {ANSES Ciqual MCP Server},
author = {Gael Debost},
year = {2025},
url = {https://github.com/zzgael/ciqual-mcp}
}Available Tools
1 toolqueryA
Execute SQL query on ANSES Ciqual French food composition database.
IMPORTANT: Get ALL nutrients in ONE query! Don't make multiple queries for the same food.
EXAMPLE - Get complete nutrition for a food: SELECT f.alim_nom_eng, n.const_nom_eng, c.teneur, n.unit FROM foods f JOIN composition c ON f.alim_code = c.alim_code JOIN nutrients n ON c.const_code = n.const_code WHERE f.alim_code = 23000; -- Returns ALL 60+ nutrients in one query!
SCHEMA: β’ foods: 3,185+ foods with French/English names
alim_code (PK), alim_nom_fr, alim_nom_eng, alim_grp_code
β’ nutrients: ~60+ nutrients with units
const_code (PK), const_nom_fr, const_nom_eng, unit
β’ composition: nutritional values per 100g
alim_code, const_code, teneur (value), code_confiance (A/B/C/D)
β’ foods_fts: full-text search for fuzzy matching
Use: WHERE foods_fts MATCH 'search term'
COMMON QUERIES:
Search foods: SELECT * FROM foods_fts WHERE foods_fts MATCH 'cake';
Get ALL nutrients: JOIN all 3 tables, no WHERE clause on nutrients
Get specific nutrients: Use IN clause with multiple codes at once
KEY NUTRIENT CODES: Energy: 327 (kJ), 328 (kcal) Macros: 25000 (protein g), 31000 (carbs g), 40000 (fat g), 34100 (fiber g), 32000 (sugars g) Minerals: 10110 (sodium mg), 10200 (calcium mg), 10260 (iron mg), 10190 (potassium mg) Vitamins: 55400 (vit C mg), 56400 (vit D Β΅g), 51330 (vit B12 Β΅g), 56310 (vit E mg)
The database is read-only. Use SELECT queries only.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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 clearly states the database is read-only and restricts usage to SELECT queries, which informs the agent about safety and limitations. It also provides context on database structure (tables like foods, nutrients, composition), example queries, and performance tips (e.g., avoiding multiple queries), adding significant value beyond any structured fields.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (e.g., IMPORTANT, EXAMPLE, SCHEMA, COMMON QUERIES, KEY NUTRIENT CODES) and uses bullet points for readability. It is appropriately sized for a complex tool, but some parts (like the detailed schema listing) could be slightly condensed. Every sentence adds value, such as performance advice and database constraints, making it efficient overall.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (executing SQL queries on a specific database), no annotations, 0% schema coverage, but with an output schema present, the description is highly complete. It covers purpose, usage guidelines, behavioral traits (read-only, SELECT-only), parameter semantics with examples, database structure, and common queries. The output schema handles return values, so the description doesn't need to explain them, making it fully adequate for the agent's needs.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage for the single parameter 'sql', so the description must compensate. It adds substantial meaning by explaining that 'sql' should be an SQL query for the ANSES Ciqual database, providing example queries, schema details (tables and columns), and usage tips. However, it doesn't explicitly define the 'sql' parameter's syntax or constraints beyond examples, leaving some room for interpretation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states the tool's purpose: 'Execute SQL query on ANSES Ciqual French food composition database.' It specifies the verb ('Execute SQL query'), the resource ('ANSES Ciqual French food composition database'), and distinguishes it from potential alternatives by emphasizing 'Get ALL nutrients in ONE query! Don't make multiple queries for the same food.' This is specific and clear, with no siblings to differentiate from.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use this tool: for executing SQL queries on the specified database. It includes detailed examples (e.g., 'EXAMPLE - Get complete nutrition for a food'), common queries (e.g., 'Search foods', 'Get ALL nutrients'), and key constraints ('The database is read-only. Use SELECT queries only.'). This covers when to use it, how to use it effectively, and what not to do, with no alternatives mentioned as there are no sibling tools.
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. Dates show when Glama detected each change.
1 tool update
v1.0.0- Changed
query3 fields changed- removed
Input schema / properties / sql / titleRemoved value: -"Sql" - removed
Output schema / properties / result / titleRemoved value: -"Result" - removed
Output schema / titleRemoved value: -"_WrappedResult"
1 tool update
- First observed
query
TDQS
With only one tool named 'query', there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined as executing SQL queries on the ANSES Ciqual database, making it straightforward for an agent to select.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'query' follows a simple, clear verb pattern that aligns with its function, and there are no other tools to cause inconsistency.
The server has only one tool, which is too few for its apparent scope of providing access to a complex food composition database with multiple tables and query types. A single SQL query tool places excessive burden on the agent to construct correct queries, lacking specialized tools for common operations like searching foods or retrieving nutrients.
The tool surface is severely incomplete for the domain. While the 'query' tool allows access to all data, it lacks dedicated tools for key operations such as food search, nutrient lookup, or retrieving specific food compositions, which are essential for a food database. This forces agents to handle complex SQL, increasing the risk of errors and inefficiencies.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Resolve Japanese food names to nutrition facts. All 2,538 foods from Japan's official tables.
Food and nutrition data: search, macros, and comparisons
Nutrition for 910 plant foods across 11 national datasets, plus GB/EU & US claim checking
81Search foods, compare nutrients, and look up the full USDA FoodData Central database.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides access to a comprehensive food database with 300,000+ items, enabling nutritional data lookups, food searches, and barcode scanning with all processing happening locally for privacy and speed.204MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to access the Open Food Facts database to query detailed food product information, nutritional data, and environmental scores. Supports product lookup by barcode, smart search with filtering, nutritional analysis, product comparison, and dietary recommendations to help users make informed food choices.51MIT
- AlicenseNot gradedqualityNot gradedmaintenanceProvides 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.-
- FlicenseNot gradedqualityDmaintenanceProvides 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-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/plemio/ciqual-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server