Invoice Intelligence MCP server built with FastMCP, SQLAlchemy, and Alembic.
- Query tool:
analyze_invoice_risk - Execute tools:
extract_invoice_fields,compare_invoice_history - Strict Pydantic schemas with deterministic outputs
- Regex invoice parsing + rule-based anomaly detection
- SQLite by default, PostgreSQL-ready via
DATABASE_URL - Alembic migrations for schema lifecycle
Builder prompt is tracked in:
docs/system-prompts/invoice-mcp-builder.md
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
cp .env.example .envCreate a new revision:
alembic revision --autogenerate -m "describe change"Upgrade to latest migration:
alembic upgrade headDowngrade by one revision:
alembic downgrade -1python -m app.mainServer defaults:
- MCP endpoint:
http://127.0.0.1:8000/mcp - Health route:
http://127.0.0.1:8000/health
pytest