How pylegifrance/mcp-server-legifrance works
This repository is a small MCP server that exposes Legifrance searches to compatible LLM clients. The principal workflow is a client invoking a registered search tool, the server dispatching the request to the corresponding Legifrance API endpoint, and returning the result as MCP text. It also exposes a predefined legal-expert prompt. The README documents the three search capabilities; the sampled source shows their dispatch and shared HTTP request handling, but not the full implementation details of every handler.
Main entry points: server.py Tool dispatch
Components 10
MCP server
- Server entry
src/server.py - Tool registry
src/server.py - Tool dispatch
src/server.py - Expert prompt
src/server.py
Legal searches
- Legal text search
src/server.py - Code search
src/server.py - Case law search
src/server.py
External services
- API request
src/server.py - Legifrance API
Other components
- MCP client
Connections 8
- MCP client → Server entry: connects to
README.md - Server entry → Tool registry: registers tools
src/server.py - Server entry → Tool dispatch: runs server
src/server.py - Tool dispatch → Legal text search: routes loda
src/server.py - Tool dispatch → Code search: routes code
src/server.py - Tool dispatch → Case law search: routes juri
src/server.py - Tool dispatch → API request: calls
src/server.py - API request → Legifrance API: posts request
src/server.py