Overview
The/mcp endpoint is the main entry point for all Model Context Protocol (MCP) communication. This endpoint implements the MCP JSON-RPC protocol using Streamable HTTP transport, allowing MCP clients to discover and invoke tools for interacting with data.gouv.fr.
This endpoint is designed to be accessed by MCP clients (like Claude Desktop, Cline, or other AI assistants), not directly by end users. All communication follows the MCP specification.
Endpoint Details
The main MCP JSON-RPC endpoint
Request Format
All requests must be valid MCP JSON-RPC messages. The endpoint uses Streamable HTTP transport, which means:- Each request is a JSON-RPC 2.0 message
- The server operates in stateless mode (no session management required)
- Clients don’t need to maintain
mcp-session-idheaders
Response Format
Responses follow the JSON-RPC 2.0 specification:Security
The endpoint implements comprehensive security measures following MCP specification requirements:DNS Rebinding Protection
The server validates theHost header to prevent DNS rebinding attacks. Only requests from allowed hosts are accepted:
mcp.data.gouv.fr(production)mcp.preprod.data.gouv.fr(pre-production)localhost:*(local development)127.0.0.1:*(local development)
Origin Validation
TheOrigin header is validated to prevent cross-origin attacks. Allowed origins:
https://mcp.data.gouv.frhttps://mcp.preprod.data.gouv.frhttp://localhost:*http://127.0.0.1:*
Stateless Mode
This server operates in stateless HTTP mode, which means:- No server-initiated notifications
- No session state maintained between requests
- Clients don’t need to track session IDs
- Each request is independent and self-contained
Transport Details
The endpoint uses Streamable HTTP transport as defined in the MCP specification:- Protocol: HTTP/1.1 or HTTP/2
- Method: POST
- Content-Type:
application/json - Encoding: UTF-8
MCP Protocol Methods
The following MCP methods are available through this endpoint:Core Methods
initialize- Initialize the MCP sessiontools/list- List all available toolstools/call- Invoke a specific tool
Available Tools
For a complete list of available tools, see the Tools documentation.Example Usage
Most users won’t interact with this endpoint directly. Instead, you’ll configure your MCP client to connect to this server.
MCP Client Configuration
Add the data.gouv.fr MCP server to your MCP client configuration:Direct HTTP Request (Advanced)
If you need to test the endpoint directly:Monitoring
All requests to the/mcp endpoint are tracked with Matomo analytics for usage monitoring and insights. No personally identifiable information is collected.
Error Handling
Errors are returned following the JSON-RPC 2.0 error format:Common Error Codes
-32700- Parse error (invalid JSON)-32600- Invalid request-32601- Method not found-32602- Invalid parameters-32603- Internal error