cocktail-recipes-mcp
A Dockerized Python MCP server that provides tools to manage cocktail recipes, ingredients, and related operations via the Aephir/cocktail-recipes REST API, with dry-run safety defaults and automatic re-authentication.
README
cocktail-recipes-mcp
Dockerized Python 3.11 MCP server for the Aephir/cocktail-recipes REST API.
This server is designed for Claude Desktop and other MCP clients. It authenticates against the cocktail app via session-cookie login (POST /api/auth/login) and uses REST-only calls.
Features
- Python 3.11 MCP server with typed models and validation
- Session-cookie auth with automatic re-login on
401 - Safe retries for idempotent calls (read-only and dry-run operations)
- No blind retries for non-idempotent apply calls
- Dry-run safety defaults for destructive tools
- Structured response and error schema
- Capability probing tool for backend endpoint readiness
- Operation log tool for recent MCP actions
Implemented Tools
list_recipesget_recipecreate_recipe(defaultsdry_run=true)update_recipe(defaultsdry_run=true)delete_recipe(defaultsdry_run=true)list_ingredientslist_toolsmerge_ingredients(dry_run=truedefault)merge_tools(dry_run=truedefault)recategorize_recipes(dry_run=truedefault)update_tags_bulk(dry_run=truedefault)operation_log_recentapi_capabilities
Safety Behavior
All destructive tools default to dry_run=true (create/update/delete/merge/recategorize/tag bulk).
To apply, pass explicit dry_run=false.
Each destructive tool returns:
- preview (
affectedIDs and count) apply_executedboolean- backend result payload
If backend admin endpoints are not available yet, tool responses return structured not_implemented with an actionable message.
Required Environment Variables
COCKTAIL_API_BASE_URLCOCKTAIL_API_USERNAMECOCKTAIL_API_PASSWORD
Optional variables are in .env.example.
Transport Modes
stdio(default in.env.example): process-local MCP over stdin/stdout, no published port.streamable-http: network-reachable MCP over HTTP, requires a published port or reverse proxy.
For Claude running on a different machine, use streamable-http.
Local Run
- Create env file:
cp .env.example .env
- Install dependencies and run:
python3.11 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e .[test]
python -m cocktail_recipes_mcp.main
Docker Run
Build image:
docker build -t cocktail-recipes-mcp:latest .
Run container:
docker run --rm -i --env-file .env cocktail-recipes-mcp:latest
Compose example:
docker compose up --build cocktail-recipes-mcp
Note: docker-compose.yml reads values from environment variables. For local CLI usage, export them or place them in a local .env file before running docker compose.
For remote clients, set MCP_TRANSPORT=streamable-http and publish MCP_HTTP_PUBLISH_PORT.
Portainer Deployment (Recommended)
Use this when you run both the cocktail app and this MCP server as containers.
- Deploy both services on the same Docker network.
- Set MCP environment variables in Portainer for the MCP service:
COCKTAIL_API_BASE_URLCOCKTAIL_API_USERNAMECOCKTAIL_API_PASSWORD
MCP_TRANSPORT=streamable-httpMCP_HTTP_HOST=0.0.0.0MCP_HTTP_PORT=8000MCP_HTTP_PATH=/mcpMCP_HTTP_PUBLISH_PORT=8000(or another host port)
- Use internal service URL for
COCKTAIL_API_BASE_URLwhen possible, for example:http://cocktail-app:3000
- Start the cocktail app first, then start the MCP service.
- In Claude, call
api_capabilitiesandlist_recipesto validate connectivity.
Portainer Error: .env not found
If you saw an error like env file /data/compose/<id>/.env not found, the stack was expecting a physical .env file inside Portainer's compose directory.
This repo now avoids that requirement by reading COCKTAIL_API_* from stack environment variables directly.
In Portainer Stack deployment:
- Add these variables in the Stack
Environment variablesUI:COCKTAIL_API_BASE_URLCOCKTAIL_API_USERNAMECOCKTAIL_API_PASSWORD
- Redeploy the stack.
Your example values are valid for this setup.
Portainer Error: pull access denied for cocktail-recipes-mcp
This happens when Portainer tries to pull cocktail-recipes-mcp:latest from a registry.
This project is intended to build from source in the stack, not pull from Docker Hub.
Resolution:
- Use the current compose file from this repo (it uses
buildandpull_policy: never). - In Portainer stack deployment, disable any "pull latest image" behavior for this stack.
- Redeploy the stack so the image is built locally on the Docker host.
FQDN vs Internal URL
- If MCP and cocktail app are in the same Docker network, prefer internal URL (
http://service-name:port). - If MCP is outside that network, use a reachable external URL/FQDN (for example
https://cocktails.example.com).
For MCP client access:
- Same LAN/VPN:
http://<host-ip>:<published-port><MCP_HTTP_PATH> - Internet-facing: put SWAG/Nginx in front and use
https://<fqdn><MCP_HTTP_PATH>
Example Portainer Stack Snippet
services:
cocktail-recipes-mcp:
image: cocktail-recipes-mcp:latest
build:
context: .
dockerfile: Dockerfile
environment:
COCKTAIL_API_BASE_URL: http://cocktail-app:3000
COCKTAIL_API_USERNAME: admin
COCKTAIL_API_PASSWORD: change-me
MCP_TRANSPORT: streamable-http
MCP_HTTP_HOST: 0.0.0.0
MCP_HTTP_PORT: 8000
MCP_HTTP_PATH: /mcp
ports:
- "8000:8000"
restart: unless-stopped
stdin_open: true
tty: true
networks:
- cocktail_net
networks:
cocktail_net:
external: true
Go-Live Checklist
- MCP and app containers share a network.
- MCP env vars are set in Portainer.
- Login endpoint is reachable from MCP (
POST /api/auth/login). api_capabilitiessucceeds.list_recipessucceeds.- For admin operations, run
dry_run=truefirst and apply only withdry_run=false.
Claude Desktop Connection
Add an MCP server entry to your Claude Desktop config.
Local Python command
{
"mcpServers": {
"cocktail-recipes": {
"command": "/absolute/path/to/cocktail-recipes-mcp/.venv/bin/python",
"args": ["-m", "cocktail_recipes_mcp.main"],
"env": {
"COCKTAIL_API_BASE_URL": "http://localhost:3000",
"COCKTAIL_API_USERNAME": "admin",
"COCKTAIL_API_PASSWORD": "change-me"
}
}
}
}
Docker command
{
"mcpServers": {
"cocktail-recipes": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--env-file",
"/absolute/path/to/cocktail-recipes-mcp/.env",
"cocktail-recipes-mcp:latest"
]
}
}
}
Remote HTTP MCP (different machine)
When running in Portainer with MCP_TRANSPORT=streamable-http, use your reachable URL:
- Direct host/port example:
http://10.0.30.51:8000/mcp - SWAG/FQDN example:
https://mcp.example.com/mcp
If your Claude client supports URL-based MCP servers, register this URL there.
Tests
Run minimal tests:
pytest
Example Transcript
See docs/example_transcripts.md for a dry_run/apply merge example (Cucumber vs cucumber).
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.