Law Scrapper MCP

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.

Category
访问服务器

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.

Python Version License Version

✨ 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 analysis
  • calculate_date_offset - Calculate date ranges for legal periods

📚 System metadata (6 tools)

  • get_legal_keywords - Access all available search keywords
  • get_legal_publishers - List all legal publishers (DU, MP)
  • get_publisher_details - Detailed publisher information
  • get_legal_statuses - Document status types
  • get_legal_types - Legal document types
  • get_legal_institutions - Involved institutions

🔍 Acts browsing & search (2 tools)

  • search_legal_acts - Advanced multi-criteria search
  • get_publisher_year_acts - Browse acts by publisher and year

📋 Act details & analysis (4 tools)

  • get_act_comprehensive_details - Complete document metadata
  • get_act_content - PDF/HTML content retrieval
  • get_act_table_of_contents - Document structure analysis
  • get_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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes using Conventional Commits format
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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

@numikel


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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选