Legal Peripherals MCP Server for Secretary of State, EIN, and Statutes automation!
Project description
⚖️ Legal Peripherals MCP Server
A premium Model Context Protocol (MCP) server powered by FastMCP that exposes highly robust tools for automating legal operations and filing compliance. This server handles state-level Secretary of State (SOS) entities, off-hours compliant IRS Form SS-4 EIN drafting/scheduling, and corporate/LLC charter templates lookup.
🗺️ System Architecture
The following diagram illustrates how the Legal Peripherals MCP Server coordinates between external LLM clients, state Secretary of State (SOS) databases, the IRS Form SS-4 preparation engine, and local template resources:
graph TD
Client[LLM / Agent Client] <-->|stdio / Server-Sent Events| MCP[FastMCP Server]
subgraph Core Features [Legal Peripherals Engine]
MCP -->|SOSTOOL| SOS[Secretary of State Lookup]
MCP -->|EINTOOL| EIN[IRS Form SS-4 EIN Engine]
MCP -->|STATUTETOOL| STATUTE[Statute & Charter Templates]
end
subgraph State Scraping Layer
SOS -->|Deep Scraper| TX[Texas Secretary of State]
SOS -->|Deep Scraper| DE[Delaware Division of Corporations]
SOS -->|Deep Scraper| WY[Wyoming Secretary of State]
SOS -->|Deep Scraper| NV[Nevada SilverFlume]
SOS -->|LLM Fallback| FB[Resilient Fallback Scraper]
end
subgraph IRS Filing Layer
EIN -->|Check EST Time| activeCheck{Is Monday-Friday<br/>7:00 AM - 10:00 PM EST?}
activeCheck -->|Yes / Override| fileNow[FILING IMMEDIATELY]
activeCheck -->|No| queueLater[QUEUED FOR SCHEDULING]
end
subgraph Statute Knowledge
STATUTE -->|State Statutes| defaults[Default Rules Mapping]
STATUTE -->|Documents| templates[Corporate/LLC Charter Templates]
end
🛠️ MCP Tools Mapping
The server registers the following standard FastMCP tools, which can be dynamically enabled or disabled via environment toggles:
| Tool Name | Parameters | Returns | Description |
|---|---|---|---|
sos_entity_lookup |
state (str), entity_name (str), entity_id (str, optional) |
str (JSON/text result) |
Performs Secretary of State entity lookups across all 50 states (utilizes optimized scrapers for TX, DE, WY, NV and fallbacks for others). |
draft_ein_form |
legal_name (str), responsible_party_ssn (str), responsible_party_name (str), business_type (str), etc. |
str (drafted form & queue details) |
Drafts IRS Form SS-4 and schedules filing with strict off-hours compliance (Mon-Fri 7:00 AM - 10:00 PM EST). Supports developer bypass override. |
lookup_statute_rules |
state (str), entity_type (str), topic (str) |
str (statute details & templates) |
Queries state statutory default rules (director voting, indemnification, etc.) and retrieves template charter links. |
⚙️ Environment Variables
Configure the server runtime using a .env file or direct container environment injections:
| Environment Variable | Type | Default | Description |
|---|---|---|---|
SOSTOOL |
bool |
True |
Toggle the sos_entity_lookup tool. |
EINTOOL |
bool |
True |
Toggle the draft_ein_form tool. |
STATUTETOOL |
bool |
True |
Toggle the lookup_statute_rules tool. |
BYPASS_IRS_FILING_HOURS |
bool |
False |
Bypasses the active-hours restriction during development/testing, enabling immediate submission mockups at any hour. |
LEGAL_PERIPHERALS_BASE_URL |
str |
http://localhost:8000 |
The base URL of the backing legal peripherals web platform API. |
LEGAL_PERIPHERALS_TOKEN |
str |
"" |
The authentication token / bearer credential for the backing API. |
LEGAL_PERIPHERALS_SSL_VERIFY |
bool |
True |
Toggles whether SSL verification is enforced on backing requests. |
🚀 Deployment & Installation
Option 1: Bare-Metal Setup (pip)
-
Clone the Repository & Install Dependencies:
pip install -r requirements.txt
-
Configure your Environment: Create a
.envfile from the template:cp .env.example .env
-
Start the Server:
python -m legal_peripherals_mcp.mcp_server
Option 2: Containerized Setup (Docker)
To run the Legal Peripherals MCP Server as a headless background container or expose it via an orchestrator (like Portainer):
-
Build the Docker Image:
docker build -t legal-peripherals-mcp .
-
Run the Container: Pass your configuration variables as environment flags:
docker run -d \ --name legal-peripherals-mcp-service \ -e SOSTOOL=True \ -e EINTOOL=True \ -e STATUTETOOL=True \ -e BYPASS_IRS_FILING_HOURS=True \ legal-peripherals-mcp
🧪 Running the Test Suite
We maintain 100% logic coverage using pytest to verify off-hours filing computations, bypass states, Secretary of State scrapers, and charter mappings:
# Run tests with detailed verbose output
pytest -v
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file legal_peripherals_mcp-0.22.0.tar.gz.
File metadata
- Download URL: legal_peripherals_mcp-0.22.0.tar.gz
- Upload date:
- Size: 27.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aeb64180565bc0945c3c087132def2ede7e55846b7db5ab3c22bb7b87513ee77
|
|
| MD5 |
857d6bf33dbf761ba2d123931d56d4c4
|
|
| BLAKE2b-256 |
8128b7411e2931d3812f8ef716cff36f640416b52477fcbef471dc2709556eeb
|
File details
Details for the file legal_peripherals_mcp-0.22.0-py3-none-any.whl.
File metadata
- Download URL: legal_peripherals_mcp-0.22.0-py3-none-any.whl
- Upload date:
- Size: 31.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ebc40259bb4e27ce28f1565d17b16de83cdba855084275d0ea8dd8f24b1738e
|
|
| MD5 |
6fcf436de3bb99fb5a68f9f8366d29ab
|
|
| BLAKE2b-256 |
0ee0a02c9f11c16a62b3e51e4d20a3cd2a29b0cbb551aeb13f3a0cd9c9e51588
|