- Explore MCP Servers
- Nutrient_db_MCP
Nutrient Db Mcp
What is Nutrient Db Mcp
The USDA MCP Server is a high-performance implementation of the Message Control Protocol designed to provide access to USDA nutritional data. It allows users to perform complex searches and analyses of food and nutrient information through compatible clients such as Claude Desktop.
Use cases
Users can engage with the USDA MCP Server for various purposes, including creating meal plans for specific nutrient deficiencies, comparing the nutritional content of different foods, and finding nutrient-dense foods to enhance diet quality. It is also suitable for research related to nutrition and dietetics.
How to use
To use the USDA MCP Server, users need to clone the repository, set up a Python environment, download USDA data, and initialize the SQLite database. Once configured, users can integrate with Claude Desktop to interact with the server and execute nutritional queries through the MCP protocol.
Key features
Key features of the USDA MCP Server include an optimized SQLite database for storing nutritional data, advanced search capabilities for food and nutrients, nutrient density scoring and analysis, built-in caching for enhanced performance, and support for integration with Claude Desktop.
Where to use
The server can be used in various settings, including home kitchens for meal planning, academic research in nutrition, and professional dietary consultations. It is ideal for anyone looking to analyze and improve dietary habits based on USDA nutritional data.
Overview
What is Nutrient Db Mcp
The USDA MCP Server is a high-performance implementation of the Message Control Protocol designed to provide access to USDA nutritional data. It allows users to perform complex searches and analyses of food and nutrient information through compatible clients such as Claude Desktop.
Use cases
Users can engage with the USDA MCP Server for various purposes, including creating meal plans for specific nutrient deficiencies, comparing the nutritional content of different foods, and finding nutrient-dense foods to enhance diet quality. It is also suitable for research related to nutrition and dietetics.
How to use
To use the USDA MCP Server, users need to clone the repository, set up a Python environment, download USDA data, and initialize the SQLite database. Once configured, users can integrate with Claude Desktop to interact with the server and execute nutritional queries through the MCP protocol.
Key features
Key features of the USDA MCP Server include an optimized SQLite database for storing nutritional data, advanced search capabilities for food and nutrients, nutrient density scoring and analysis, built-in caching for enhanced performance, and support for integration with Claude Desktop.
Where to use
The server can be used in various settings, including home kitchens for meal planning, academic research in nutrition, and professional dietary consultations. It is ideal for anyone looking to analyze and improve dietary habits based on USDA nutritional data.
Content
USDA MCP Server
A high-performance Message Control Protocol (MCP) server implementation for accessing USDA nutritional data through Claude Desktop or other MCP-compatible clients.
Features
- π Fast, optimized SQLite database for USDA nutritional data
- π Advanced food and nutrient search capabilities
- π Nutrient density scoring and analysis
- πͺ Support for complex nutritional queries
- π Built-in caching for improved performance
- π± Claude Desktop integration
Prerequisites
- Python 3.10 or higher
- SQLite 3.x
- Claude Desktop (latest version)
uv
package manager (recommended)
Quick Start
-
Clone the repository:
git clone https://github.com/yourusername/usda-mcp-server.git cd usda-mcp-server
-
Set up environment:
# Create and activate virtual environment python -m venv venv source venv/bin/activate # Unix # OR venv\Scripts\activate # Windows # Install dependencies pip install -r requirements.txt
-
Download USDA data:
- Visit FoodData Central
- Download βFull Download of All Data Typesβ (CSV format)
- Extract files to
data/FoodData_Central_csv
directory
-
Initialize database:
python setup_nutrient_db.py
-
Configure Claude Desktop:
Edit
claude_desktop_config.json
:{ "mcpServers": { "usda": { "command": "usda-mcp-server", "args": [ "--db-path", "/path/to/usda.db" ] } } }
-
Start using with Claude Desktop!
Database Setup Details
The database initialization process:
- Downloads and processes USDA nutritional data
- Creates optimized SQLite schema
- Builds indexes for common query patterns
- Calculates nutrient density scores
- Generates summary statistics
- Expect it to compile for multiple hours on most hardware
See Setup Guide: USDA Nutrient Database.md for detailed instructions.
Usage Examples
Ask Claude about nutrition:
Make a full day of recipies based around a vitamin D deficiency.
Compare foods:
Recomend meals that minimize carbohydrates and maximize protien
Find nutrient-dense foods:
Give me a nutrient breakdown for this recipie: [xyz]
Available Resources
The server exposes several resources:
usda://foods/list
- Searchable food databaseusda://nutrients/list
- Available nutrientsusda://foods/{food_id}
- Detailed food informationusda://foods/nutrient_dense
- Foods ranked by nutrient density
Development
Project Structure
usda-mcp-server/ βββ src/ β βββ usda_mcp_server/ β βββ server.py # MCP server implementation β βββ schema.sql # Database schema β βββ tools/ # Utility scripts βββ tests/ # Test suite βββ docs/ # Documentation βββ data/ # Data directory
Running Tests
pytest tests/
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Performance Optimization
The server includes several optimizations:
- Efficient SQLite schema design
- Strategic indexing
- Query result caching
- Materialized views for common queries
- WAL journal mode
Troubleshooting
See Troubleshooting Guide for common issues and solutions.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- USDA FoodData Central for the comprehensive nutrient database
- Claude Desktop team for the MCP protocol specification
- Contributors and maintainers
Citation
If you use this project in your research, please cite:
@software{usda_mcp_server, title = {USDA MCP Server}, url = {https://github.com/LoggerApp/Nutrient_db_MCP}, version = {0.1.0}, year = {2024} }