- Home
- MCP servers
- Law Scrapper
Law Scrapper
- python
9
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can access Polish legal acts from the Sejm API using this MCP server to perform fast searches, browse by publisher and year, load documents into a local store for section-level reading, and run structured queries with caching and robust transport options. It is designed for researchers and developers who want programmable access to official acts and to perform in-depth analysis with scalable tooling.
How to use
You connect an MCP client to either the standard in-process transport or an HTTP transport, then issue tool calls to search, browse, retrieve act details, read sections, and analyze relationships. Start by locating metadata about available publishers, types, and statuses, then perform targeted searches for acts by publisher (DU or MP) and year. You can load an act into the Document Store to navigate sections quickly, read specific articles, and search within the loaded content. If you need to monitor changes over time, you can track new acts within a date range and filter results by keywords.
How to install
Prerequisites: ensure you have Python 3.13 or higher installed on your system. You also need a package manager capable of installing the server, with uv recommended for its fast MCP integration, or pip if you prefer a Python-centric workflow. An active internet connection is required to access Sejm API endpoints.
Configuration and usage notes
The server supports two primary transport options: STDIO (default) for in-process usage and streamable HTTP for remote clients. You can control transport and server behavior through environment variables prefixed with LAW_MCP_. Common settings include the transport mode, host, port, API timeouts, and various TTLs for caching and document storage. You can also enable detailed logging and tune circuit-breaking behavior for resilience when the Sejm API experiences issues.
Security and best practices
Run the server behind a trusted network boundary when exposing it via HTTP. Use secure transport where possible and limit concurrent API requests to prevent overloading the Sejm API or your own environment. Keep sensitive configuration values out of source control and use environment-based configuration for deployment.
Troubleshooting tips
If you encounter connection issues with the Sejm API, verify network access, check retry and timeout settings, and review circuit-breaker configuration. For HTTP transport, ensure the server URL includes the /mcp path and that the client points to the correct host and port. Review logs in JSON or text format to locate failures and adjust log level as needed.
Examples of typical workflows
Load an act into the Document Store, read a section like Art. 1, then search within that loaded act for a term such as penalty. Track changes over a date range to identify new acts from a specific publisher, and compare metadata between two acts to understand differences in status or publication date.
Available tools
get_system_metadata
Retrieve system metadata for filtering and searching legal acts. Returns keywords, publishers, document types, statuses, and institutions.
search_legal_acts
Search for legal acts with advanced filtering options by publisher, year, keywords, detail level, status, and type; returns a list of matching acts with metadata.
browse_acts
Browse all legal acts published in a specific year by publisher; returns a complete list of acts.
filter_results
Filter and narrow down previously retrieved results with regex patterns, field matching, date ranges, sorting, and limits; returns a new result set for chaining.
get_act_details
Retrieve detailed information about a specific act and optionally load its content into the Document Store for section reading.
read_act_content
Read content from a specific section of a loaded act; requires prior loading via get_act_details with load_content=true.
search_in_act
Search for terms within a loaded legal act and return matching sections with context and location.
analyze_act_relationships
Analyze relationships and references of an act, including amendments and references to other acts.
track_legal_changes
Track legal changes and new acts within a date range, optionally filtered by publisher and keywords.
calculate_legal_date
Calculate legal dates with a clear sign convention for past and future offsets.
compare_acts
Compare metadata of two legal acts, highlighting differences in title, type, status, dates, and keywords.
list_result_sets
Display active result sets stored in memory with IDs and summaries.
list_loaded_documents
Display documents currently loaded into the Document Store with basic metadata.