JurisCassation MCP Server
Provides AI agents with access to Moroccan Court of Cassation decisions through search tools and PDF retrieval. Enables both real-time queries against the official portal and local searches across indexed decisions.
README
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
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.py
API Endpoints
| Endpoint | Description |
|---|---|
GET /graphql |
GraphQL playground (interactive) |
POST /graphql |
GraphQL API |
GET /api/pdf/{encrypted_id} |
Download decision PDF (proxied + cached) |
GET /api/stats |
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 100
Architecture Notes
- The Arabic endpoint (
/Decisions/RechercheDecisionsRes) returns encrypteddata-idattributes needed for PDF download - The French endpoint (
/Decisions/RechercheDecisionsResFr) returns numericidArretCassationIDs but no encrypted IDs - PDFs are downloaded via
/Decisions/GetArret?encryptedId=...— no auth required - Empty
Sujetin Arabic search returns 0 results; we use ا (alef) as a wildcard catch-all - SSL cert on the upstream site is broken;
verify=Falseis required
Environment Variables
| Variable | Default | Description |
|---|---|---|
JURIS_DB |
/data/decisions.db |
SQLite database path |
JURIS_PDF_CACHE |
/data/pdfs |
PDF cache directory |
JURIS_CONCURRENCY |
3 |
Max concurrent scrape requests |
JURIS_DELAY |
0.5 |
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 |
|---|---|
search_decisions |
Live search against juriscassation.cspj.ma |
search_local |
FTS5 search over local SQLite index |
get_decision_pdf |
Check/download a decision PDF by encrypted ID |
list_chambers |
List all 7 chambers with index counts |
scrape_chamber |
Index decisions from a chamber |
get_stats |
Local index statistics |
Resources
| URI | Description |
|---|---|
juriscassation://chambers |
Chamber reference list (AR/FR/EN) |
juriscassation://stats |
Current index statistics |
MCP Environment Variables
| Variable | Default | Description |
|---|---|---|
JURIS_API_BASE |
http://localhost:5091 |
GraphQL API base URL |
JURIS_DB |
/mnt/data/juriscassation/decisions.db |
SQLite path (for direct search) |
MCP_PORT |
5098 |
MCP server port |
MCP_HOST |
0.0.0.0 |
MCP server bind host |
MCP_TRANSPORT |
sse |
Transport type (sse or streamable-http) |
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/sse
Deployment
The app is containerized and runs on port 8000 internally, mapped to host port 5091.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。