
bakery
展示如何将模型上下文协议(MCP)集成到FastAPI应用中,用于检查面包店商品的可用性。
Repository Info
About This Server
展示如何将模型上下文协议(MCP)集成到FastAPI应用中,用于检查面包店商品的可用性。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Bakery API with MCP Support
This API demonstrates integrating Model Context Protocol (MCP) with a FastAPI application for a bakery availability checker.
Features
- Checks if bakery items are available
- Uses MCP Fetch server for API calls
- Uses MCP Filesystem server for local file access
- Provides fallback responses when MCP servers are unavailable
Deployment Options
Option 1: Direct Deployment (Render)
- Deploy to Render using the render.yaml configuration
- Ensure the build.sh script installs all required dependencies
- The API will run using the updated bakery_api_with_mcp.py file with proper MCP initialization
Option 2: Docker Deployment
-
Build and run with Docker:
docker build -t bakery-api . docker run -p 8000:8000 bakery-api -
Or use Docker Compose:
docker-compose up
Troubleshooting MCP Server Issues
If you encounter MCP initialization errors:
- Check that MCP module paths in fastagent.config.yaml are correct
- Ensure you have the latest MCP package versions
- Try running in a local environment first to validate configuration
- Use the Docker approach for more consistent environment isolation
API Usage
GET /: Check API statusGET /check?item=bread: Check item availability (GET method)POST /check: Check item availability with JSON request body:{ "query": "Can I order a cake for Saturday?" }
Endpoints
GET /- Returns basic API infoPOST /check- Checks if an item is available on a specific day
How to Use
Send a POST request to /check with a query string like:
"Can I order a croissant on Monday?"
The API will check:
- If the bakery is open on that day
- If the item is on the menu
Deployment
This API is deployed on Render.
Quick Start
Clone the repository
git clone https://github.com/mariagorskikh/bakeryInstall dependencies
cd bakery
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.