Quick Start Guide¶
Get started with the EurLex MCP Server in just a few minutes.
Step 1: Connect to the Server¶
Using Claude Desktop¶
Add the server to your Claude configuration:
Using Direct API¶
Connect directly to the API endpoint:
curl -X POST https://eurlex.lexsocket.ai/mcp \
-H "Content-Type: application/json" \
-d '{"method": "search_eurlex", "params": {"query": "GDPR"}}'
Step 2: Make Your First Query¶
Simple Search¶
Keyword Search¶
Concept Search¶
Step 3: Retrieve a Document¶
Once you find a document, get the full text:
Step 4: Check Database Info¶
Get statistics about the legal database:
Connection Examples¶
Python¶
import requests
def search_eurlex(query, limit=5):
url = "https://eurlex.lexsocket.ai/mcp"
payload = {
"method": "search_eurlex",
"params": {
"query": query,
"limit": limit
}
}
response = requests.post(url, json=payload)
return response.json()
# Example usage
results = search_eurlex("data protection")
print(f"Found {len(results['result']['data'])} documents")
JavaScript¶
async function searchEurlex(query, limit = 5) {
const url = 'https://eurlex.lexsocket.ai/mcp';
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
method: 'search_eurlex',
params: { query, limit }
})
});
return await response.json();
}
// Example usage
searchEurlex('GDPR compliance', 3)
.then(result => console.log(result))
.catch(error => console.error(error));
cURL¶
curl -X POST https://eurlex.lexsocket.ai/mcp \
-H "Content-Type: application/json" \
-d '{
"method": "search_eurlex",
"params": {
"query": "data protection principles",
"limit": 5
}
}'
Response Format¶
All responses follow the same format:
{
"result": {
"data": [
{
"file_id": "32016R0679",
"title": "REGULATION (EU) 2016/679",
"content": "General Data Protection Regulation...",
"score": 0.95,
"metadata": {
"document_type": "regulation",
"date": "2016-04-27",
"celex_id": "32016R0679"
}
}
],
"metadata": {
"total_results": 150,
"search_mode": "hybrid",
"processing_time_ms": 287
}
},
"error": null
}
Error Handling¶
If something goes wrong, you'll receive an error response:
{
"error": {
"code": "INVALID_QUERY",
"message": "Query parameter is required",
"details": {
"missing_param": "query"
}
},
"result": null
}
Next Steps¶
- Search Guide: Learn advanced search techniques
- Examples: See practical usage scenarios
- API Reference: Understand the API in detail