Luxembourg Law MCP
Production-grade Luxembourg legislation MCP server with:
stdiotransport for local MCP clients.- Streamable HTTP transport for Vercel/serverless deployment.
- Golden contract tests and nightly drift detection anchors.
- Automated update checks against Legilux.
Requirements
- Node.js
>=18 - npm
Install
npm install
Build And Run
npm run build
npm start
Dev mode:
npm run dev
Database
Build the SQLite database from data/seed/*.json:
npm run build:db
Ingest from Legilux:
# Full discovery + ingestion
npm run ingest
# Only selected laws
npm run ingest -- --ids loi-1799-07-04-n1,loi-2002-08-02-n2
# Overwrite existing seed files
npm run ingest -- --ids loi-1799-07-04-n1 --force
Override DB path:
export LUXEMBOURG_LAW_DB_PATH=/absolute/path/to/database.db
Testing
Run full test suite:
npm test
Run golden contract tests:
npm run test:contract
Nightly-mode contract checks (includes network assertions):
CONTRACT_MODE=nightly npm run test:contract
Coverage:
npm run test:coverage
Drift Detection
Run upstream drift checks for configured anchors:
npm run drift:detect
Anchors are configured in fixtures/golden-hashes.json.
Update Checks
Compare local data with Legilux:
npm run check-updates
Machine-readable output:
npm run check-updates -- --json --output update-summary.json
Vercel Deployment
API handlers:
api/mcp.tsfor MCP streamable HTTP (/mcp)api/health.tsfor health/version (/health,/version)
vercel.json config includes rewrites and packaged DB file.
GitHub Actions deployment workflow
The workflow .github/workflows/vercel-deploy.yml supports:
- PR preview deploys
- Production deploys on
main
Required repository secrets:
VERCEL_TOKENVERCEL_ORG_IDVERCEL_PROJECT_ID
GitHub Actions
ci.yml: build, tests, contract tests, coverage, typecheck.check-updates.yml: daily freshness checks + issue management + optional auto-update.drift-detect.yml: nightly drift checks with issue creation on mismatch.vercel-deploy.yml: preview and production deployment to Vercel.
API Endpoints
GET /health: health payloadGET /version: version/capability payloadPOST /mcp: streamable MCP endpoint
License
Apache-2.0