JurisCassation MCP Server
Provides a GraphQL API wrapper for the Moroccan Court of Cassation decision portal, enabling type-safe queries and mutations for searching decisions, retrieving PDFs, and managing the local index.
Utilizes SQLite with FTS5 for local full-text search of scraped Moroccan court decisions, providing offline search capabilities and decision indexing functionality.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
JurisCassation API
GraphQL + REST wrapper for juriscassation.cspj.ma — the Moroccan Court of Cassation decision portal.
Features
Live search — real-time passthrough to the Arabic search endpoint
Local search — SQLite FTS5 full-text search over scraped decisions
GraphQL API — type-safe queries and mutations
PDF proxy — cache and serve decision PDFs by encrypted ID
Background scraper — index all decisions into local SQLite
Related MCP server: Entscheidsuche MCP Server
Quick Start
# Docker (GraphQL API on port 5091)
docker compose up -d
# Or direct
pip install -r requirements.txt
python app.py serve --port 8000
# MCP Server (port 5098, SSE transport)
# Via systemd:
sudo systemctl start juriscassation-mcp
# Or direct:
JURIS_API_BASE=http://localhost:5091 python mcp_server.pyAPI Endpoints
Endpoint | Description |
| GraphQL playground (interactive) |
| GraphQL API |
| Download decision PDF (proxied + cached) |
| Local index statistics |
GraphQL Schema
Queries
# Live search against the Moroccan portal (real-time)
query {
searchLive(chamberId: 1, sujet: "طلاق", lang: "ar", page: 1) {
total
page
perPage
items {
encryptedId
dossierNumber
decisionNumber
decisionDate
keywordsAr
pdfUrl
}
}
}
# Search the local SQLite index
query {
searchLocal(query: "طلاق", chamberId: 1, page: 1, perPage: 20) {
total
page
perPage
items {
id
encryptedId
dossierNumber
decisionNumber
decisionDate
keywordsAr
pdfUrl
}
}
}
# List chambers with decision counts
query {
chambers {
id
nameAr
nameFr
nameEn
decisionCount
}
}
# Scraper/indexer status
query {
scraperStatus {
totalDecisions
lastScrape
chambers { id nameFr decisionCount }
}
}Mutations
# Scrape decisions from a chamber (Arabic endpoint with alef wildcard)
mutation {
scrapeChamber(chamberId: 1, maxPages: 5)
}
# Scrape all pages
mutation {
scrapeChamber(chamberId: 1, maxPages: 0)
}Chambers
ID | Arabic | French | English |
1 | الغرفة المدنية | Chambre Civile | Civil |
2 | غرفة الأحوال الشخصية و الميراث | Statut Personnel & Successions | Personal Status & Inheritance |
3 | الغرفة التجارية | Chambre Commerciale | Commercial |
4 | الغرفة الإدارية | Chambre Administrative | Administrative |
5 | الغرفة الاجتماعية | Chambre Sociale | Social |
6 | الغرفة الجنائية | Chambre Pénale | Criminal |
7 | الغرفة العقارية | Chambre Immobilière | Real Estate |
CLI Scraper
# Scrape chamber 1 (all pages)
python app.py scrape --chamber 1
# Scrape all chambers, max 50 pages each
python app.py scrape --chamber 0 --max-pages 50
# Scrape from page 100 onwards
python app.py scrape --chamber 6 --since-page 100Architecture Notes
The Arabic endpoint (
/Decisions/RechercheDecisionsRes) returns encrypteddata-idattributes needed for PDF downloadThe French endpoint (
/Decisions/RechercheDecisionsResFr) returns numericidArretCassationIDs but no encrypted IDsPDFs are downloaded via
/Decisions/GetArret?encryptedId=...— no auth requiredEmpty
Sujetin Arabic search returns 0 results; we use ا (alef) as a wildcard catch-allSSL cert on the upstream site is broken;
verify=Falseis required
Environment Variables
Variable | Default | Description |
|
| SQLite database path |
|
| PDF cache directory |
|
| Max concurrent scrape requests |
|
| Delay between scrape pages (seconds) |
MCP Server
An MCP (Model Context Protocol) server exposes all API features as AI-agent tools via SSE on port 5098.
MCP Endpoint: http://localhost:5098/sse
Tools
Tool | Description |
| Live search against juriscassation.cspj.ma |
| FTS5 search over local SQLite index |
| Check/download a decision PDF by encrypted ID |
| List all 7 chambers with index counts |
| Index decisions from a chamber |
| Local index statistics |
Resources
URI | Description |
| Chamber reference list (AR/FR/EN) |
| Current index statistics |
MCP Environment Variables
Variable | Default | Description |
|
| GraphQL API base URL |
|
| SQLite path (for direct search) |
|
| MCP server port |
|
| MCP server bind host |
|
| Transport type ( |
Test with mcporter
# List tools
npx mcporter list --http-url http://localhost:5098/sse --allow-http --schema
# Search
npx mcporter call search_decisions sujet=طلاق chamber_id=1 --allow-http --http-url http://localhost:5098/sseDeployment
The app is containerized and runs on port 8000 internally, mapped to host port 5091.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
PDF tools for agents: compress to a size, Arabic + English OCR, Office conversion, JSON extraction.
Web data for agents. Extract web pages, crawl websites, discover URLs, and search the web.
Public web tools for agents: product extraction, claim checks, webpage QA and ranked audits.
Web search and page reading for AI agents, including JSON APIs, RSS feeds and YouTube.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides access to official French legal databases (Légifrance and JudiLibre) to search and retrieve French legislation, legal codes, case law, and judicial decisions through authenticated APIs.38MIT
- AlicenseNot gradedqualityNot gradedmaintenanceProvides access to Swiss court decisions through the entscheidsuche.ch API, enabling search, retrieval, and analysis of legal documents across different cantons and courts using natural language queries.-
- AlicenseNot gradedqualityBmaintenanceEnables searching and downloading Spanish court rulings from the CENDOJ database, with automatic captcha resolution via Claude's vision, returning PDFs, full text, ECLI, and metadata.5MIT
- AlicenseNot gradedqualityBmaintenanceProvides AI assistants with up-to-date legal documents from official sources, enabling accurate legal information retrieval and analysis.21AGPL 3.0