Légifrance MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Légifrance MCP ServerGet Article 1104 of the French Civil Code"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Légifrance MCP Server
フランスの法典条文を、条番号を指定して都度検索・取得できるMCPサーバー(Streamable HTTP)です。 Claude Desktopのカスタムコネクタとして登録することで、Claudeに「Code civil の第1104条を教えて」のように聞くと、 Légifrance公式API(PISTE経由)から実際の条文本文を取得して回答できるようになります。
提供するツール
get_code_article(codeName, articleNumber)codeName: 法典名。例:Code civil,Code pénal,Code du travailarticleNumber: 条番号。例:1104,L1231-1
Related MCP server: French Law MCP Server
1. ローカルでの動作確認
npm install
cp .env.example .env
# .env を編集し、PISTE_CLIENT_ID / PISTE_CLIENT_SECRET を設定
npm start起動後、http://localhost:3000/health にアクセスして ok が返れば起動成功です。
/search のレスポンス構造を必ず事前確認してください
server.js 内の searchArticleId() 関数は、/search エンドポイントのレスポンスから
条文ID(LEGIARTI)を取り出す処理が推測に基づいています。本番投入前に、必ず単体で
curl -X POST 'https://sandbox-api.piste.gouv.fr/dila/legifrance/lf-engine-app/search' \
--header 'Authorization: Bearer <取得したトークン>' \
--header 'Content-Type: application/json' \
--data-raw '{
"recherche": {
"champs": [
{"typeChamp": "NUM_ARTICLE", "criteres": [{"typeRecherche": "EXACTE", "valeur": "1104", "operateur": "ET"}], "operateur": "ET"}
],
"filtres": [{"facette": "NOM_CODE", "valeurs": ["Code civil"]}],
"pageNumber": 1, "pageSize": 5, "operateur": "ET", "sort": "PERTINENCE", "typePagination": "DEFAUT"
},
"fond": "CODE_DATE"
}'を実行し、返ってきたJSONの中でLEGIARTI IDがどのキーに入っているかを確認したうえで、
server.jsのsearchArticleId()内のパース処理(first?.titles?.[0]?.id ?? first?.idの部分)を
実際の構造に合わせて修正してください。
2. 公開サーバーへのデプロイ
Claude DesktopはAnthropicのクラウドからこのサーバーに接続するため、 パブリックインターネットからHTTPSで到達可能な場所にデプロイする必要があります (自宅Mac上でローカルに起動しただけでは動きません)。
選択肢の例:
Render / Railway / Fly.io などのPaaS(無料枠あり、Node.jsアプリを
git pushだけでデプロイ可能)自前のVPS + リバースプロキシ(nginx等)でHTTPS終端
デプロイ時は、環境変数 PISTE_ENV / PISTE_CLIENT_ID / PISTE_CLIENT_SECRET を
各サービスの環境変数設定画面から設定してください(.envファイルをそのままアップロードしない)。
デプロイ後、https://あなたのドメイン/mcp がMCPエンドポイントのURLになります。
3. Claude Desktopへの登録
Claude Desktopを開く
Settings(または Customize) → Connectors → 「Add custom connector」
サーバーURL(例:
https://あなたのドメイン/mcp)を入力して追加
登録はローカル端末ではなくClaudeアカウントに対して行われるため、 同じアカウントでログインした他のMac・Web版・モバイル版でも自動的に使えるようになります。
セキュリティ上の注意
PISTE_CLIENT_SECRETは絶対に公開リポジトリにコミットしない、チャットやログに貼らないでください。本番運用する場合は、sandbox用とは別にproduction用アプリケーションをPISTEで作成し、 対応するCGU同意・API紐付けを行ってください。
万一client_secretが漏洩した場合は、PISTE管理画面から再生成(ローテーション)してください。
This server cannot be deployed
Maintenance
Related MCP Connectors
Resolve, search and verify legal citations against the official sources, with provenance.
French law via Ansvar Gateway. Cited, OAuth + paid tier.
Search French-language and European case law and French legal texts (codes, statutes, treaties).
Search Swiss federal legislation: laws, articles, amendments via the Fedlex SPARQL endpoint.
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.33MIT
- AlicenseNot gradedqualityFmaintenanceEnables AI assistants to search and retrieve French legislation, case law, and EU law integrations from official sources via MCP.165 npm1Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables querying and retrieving legal texts and decisions from French public APIs Légifrance and JudiLibre for legal research.MIT
- AlicenseAqualityAmaintenanceMCP server for querying French legislation and case law via the Legifrance API, enabling search and retrieval of laws, codes, and court decisions with verifiable citations.850 PyPI2Apache 2.0