Law Scrapper MCP
Enables AI-powered legal research and analysis of Polish legal acts from the Sejm API. Provides comprehensive search, document retrieval, metadata analysis, and content access for legal documents from Dziennik Ustaw and Monitor Polski.
README
Law Scrapper MCP 📜⚖️
A comprehensive Model Context Protocol (MCP) server for accessing and analyzing Polish legal acts from the Sejm API, enabling AI-powered legal research and document analysis.
✨ Features
✅ Comprehensive legal act access - Full access to Polish legal acts from Dziennik Ustaw and Monitor Polski ✅ Advanced search & filtering - Multi-criteria search by date, type, keywords, publisher, and status ✅ Detailed document analysis - Complete metadata, structure, references, and content retrieval ✅ Date & time utilities - Specialized date calculations for legal document analysis ✅ System metadata access - Keywords, statuses, document types, and institution data ✅ FastMCP integration - Built with FastMCP framework following best practices ✅ Professional documentation - Extensive examples and clear parameter descriptions ✅ RESTful API integration - Direct connection to official Sejm API endpoints
📋 Requirements / prerequisites
- Python: 3.12 or higher
- Package manager: uv (recommended) or pip
- Internet connection: Required for accessing Sejm API endpoints
- MCP-compatible tool: Cursor IDE, Claude Code, or other MCP-supported applications
🚀 Installation
Using uv (recommended)
# Clone the repository
git clone https://github.com/numikel/law-scrapper-mcp.git
cd law-scrapper-mcp
# Install dependencies
uv sync
Using pip
# Clone the repository
git clone https://github.com/numikel/law-scrapper-mcp.git
cd law-scrapper-mcp
# Install dependencies
pip install -e .
⚙️ Configuration
MCP server configuration
Add the following configuration to your MCP client's configuration file:
For Cursor IDE (.cursor/mcp.json):
{
"mcpServers": {
"law-scrapper-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/numikel/law-scrapper-mcp",
"law-scrapper"
],
"transport": "stdio"
}
}
}
For Claude Code:
claude mcp add law-scrapper-mcp uvx '--from' 'git+https://github.com/numikel/law-scrapper-mcp' 'law-scrapper'
For other MCP tools (.mcp.json or mcp_config.json):
{
"mcpServers": {
"law-scrapper-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/numikel/law-scrapper-mcp",
"law-scrapper"
],
"transport": "stdio"
}
}
}
🎯 Quick start / usage
Once configured, you can start using the legal research tools:
Basic usage examples
Get current date for legal analysis:
"What is today's date?"
Search for specific legal acts:
"Find all regulations from 2020 containing 'environment'"
Analyze document structure:
"Show me the table of contents for act DU/2020/1"
Get comprehensive document details:
"Give me full information about legal act DU/2020/1280"
Available tool categories
The server provides 14 specialized tools organized in 4 categories:
🕒 Dates & time (2 tools)
get_current_date- Get current date for legal analysiscalculate_date_offset- Calculate date ranges for legal periods
📚 System metadata (6 tools)
get_legal_keywords- Access all available search keywordsget_legal_publishers- List all legal publishers (DU, MP)get_publisher_details- Detailed publisher informationget_legal_statuses- Document status typesget_legal_types- Legal document typesget_legal_institutions- Involved institutions
🔍 Acts browsing & search (2 tools)
search_legal_acts- Advanced multi-criteria searchget_publisher_year_acts- Browse acts by publisher and year
📋 Act details & analysis (4 tools)
get_act_comprehensive_details- Complete document metadataget_act_content- PDF/HTML content retrievalget_act_table_of_contents- Document structure analysisget_act_relationships- Legal references and amendments
📁 Project structure
law-scrapper-mcp/
├── app.py # Main MCP server implementation with 14 legal research tools
├── pyproject.toml # Project configuration, dependencies, and CLI scripts
├── uv.lock # Lock file ensuring reproducible builds
├── README.md # Project documentation
└── __pycache__/ # Python bytecode cache (generated)
🛠️ Development
Development setup
# Install in development mode
uv sync
# Run the server directly
uv run app.py
# Or use the installed script
law-scrapper
Running tests
# Run basic functionality tests
uv run python -c "
import app
print('Server imports successfully')
funcs = [name for name in dir(app) if name.startswith('get_')]
print(f'Available tools: {len(funcs)}')
"
Code quality
The project follows FastMCP best practices:
- Tagged Tools: All tools have descriptive tags for filtering
- Annotated Parameters: Every parameter has clear descriptions
- Comprehensive Examples: Minimum 5 examples per tool
- Professional Documentation: Detailed docstrings and usage examples
🤝 Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes using Conventional Commits format
- Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development guidelines
- Follow FastMCP best practices for tool definitions
- Include comprehensive examples and parameter descriptions
- Add appropriate tags for tool categorization
- Test all new functionality before submitting
- Use English for all code comments and documentation
📄 License
This project is licensed under the MIT License
👤 Author
Legal disclaimer: This tool provides access to Polish legal documents for research purposes. Always consult with qualified legal professionals for legal advice and interpretation of laws.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.