MCP CRUD Tools (FastMCP + HTTPX)
This repo exposes an MCP server that provides "tools" (functions) for Users & Products. Internally it calls your CRUD Service REST APIs.
Tools exposed
- Users:
list_users,get_user,create_user,update_user,delete_user - Products:
list_products,get_product,create_product,update_product,delete_product
Transport:
- Streamable HTTP at:
http://localhost:8002/mcp
Run with Docker (recommended)
- Create
.env:
cp .env.example .env
- Start MCP server:
docker compose up --build
Connecting to your CRUD service
Default .env.example uses:
CRUD_URL=http://host.docker.internal:8000
This works on macOS/Windows when your CRUD service is accessible at http://localhost:8000.
If you run Linux, either:
- run MCP server locally (no Docker), OR
- add
extra_hosts: ["host.docker.internal:host-gateway"]indocker-compose.yml.
Run locally (no Docker)
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python server.py
