LandlordLaw MCP Server
Provides AI agents with instant access to jurisdiction-specific landlord-tenant law data and verified state statutes across five US states and major cities. It enables users to query legal rules for security deposits, eviction timelines, and habitability standards with sub-10ms local response times.
README
g MCP Server
Instant, AI-queryable landlord-tenant law lookups with statute citations across 5 US states.
What It Does
LandlordLaw MCP is a legal intelligence server that provides AI agents with instant access to jurisdiction-specific landlord-tenant law data. Query security deposit limits, eviction timelines, entry requirements, and late fee rules — all backed by verified state statutes and local ordinances.
- ⚡ Sub-10ms response times (pre-built in-memory cache)
- 📚 36 legal rules across 4 topics
- 🏛️ Statute-cited (Cal. Civ. Code, Tex. Prop. Code, etc.)
- 🌆 City overrides for Los Angeles, Chicago, NYC
- 🔒 No external API calls (100% local data)
Built for the CTX Protocol marketplace with full Data Broker Standard compliance.
Supported Jurisdictions
States
- California (CA) — includes AB 1482 just cause eviction, AB 12 deposit limits
- Texas (TX) — landlord-friendly, no statutory deposit caps
- New York (NY) — HSTPA 2019, Good Cause Eviction (2024)
- Florida (FL) — fast eviction timelines, minimal deposit restrictions
- Illinois (IL) — state law + Chicago RLTO variations
City Overrides
- Los Angeles, CA — RSO just cause, relocation assistance requirements
- New York City, NY — rent-stabilized unit protections, interest on deposits
- Chicago, IL — RLTO strict caps on deposits/late fees, just cause eviction
Available Tools
get_deposit_rules
Get security deposit regulations including maximum amounts, return deadlines, interest requirements, and penalties.
Example query: "What's the maximum security deposit in California for an unfurnished apartment?"
Returns:
{
"state": "CA",
"max_deposit": "1 month's rent",
"return_deadline_days": 21,
"itemized_deductions_required": true,
"interest_required": false,
"statute_reference": "Cal. Civ. Code § 1950.5",
"rule_summary": "California limits security deposits to 1 month's rent...",
"last_updated": "2026-03-22T..."
}
get_eviction_timeline
Get eviction notice periods, cure rights, just cause requirements, and court timelines.
Example query: "How many days notice does a Texas landlord need to give for nonpayment of rent?"
Returns:
{
"state": "TX",
"nonpayment_notice_days": 3,
"cure_period_allowed": false,
"just_cause_required": false,
"estimated_court_timeline_days": "10-30 days",
"statute_reference": "Tex. Prop. Code §§ 24.002-24.005",
"rule_summary": "Texas is landlord-friendly with no statewide just cause..."
}
get_entry_requirements
Get landlord entry notification rules including notice periods, permitted reasons, and emergency access.
Example query: "How much advance notice must a Florida landlord give before entering a rental unit?"
Returns:
{
"state": "FL",
"notice_required": true,
"notice_hours": 12,
"notice_must_be_written": false,
"emergency_entry_allowed": true,
"entry_hours_restriction": "7:30am-8pm",
"statute_reference": "Fla. Stat. § 83.53"
}
get_late_fee_rules
Get late fee caps, grace period requirements, and NSF check fee limits.
Example query: "What's the maximum late fee a Chicago landlord can charge on $1,200 rent?"
Returns:
{
"state": "IL",
"city_override": "Chicago",
"late_fee_cap": "$10 + 5% of rent over $500 = $45",
"grace_period_days": 5,
"grace_period_required_by_law": true,
"statute_reference": "Chicago RLTO § 5-12-140"
}
get_rent_increase_rules
Get rent increase caps, notice periods, and rent control rules for a US state.
Example query: "Does California have rent control?"
Returns:
{
"state": "CA",
"rent_control_exists": true,
"max_annual_increase": "5% + CPI (max 10% total) under AB 1482",
"notice_required_days": 90,
"exempt_properties": "Buildings built after 2/1/1995, single-family homes (unless owned by corporation/REIT)",
"statute_reference": "Cal. Civ. Code § 1947.12",
"rule_summary": "AB 1482 (2019) caps rent increases statewide..."
}
get_habitability_standards
Get implied warranty of habitability requirements and tenant remedies for a US state.
Example query: "Can a California tenant use 'repair and deduct' for habitability issues?"
Returns:
{
"state": "CA",
"implied_warranty_exists": true,
"repair_and_deduct_allowed": true,
"rent_withholding_allowed": true,
"repair_timeline_days": "30 days for non-emergency repairs",
"tenant_remedies": "Repair and deduct (up to 1 month rent), rent withholding, sue for damages...",
"statute_reference": "Cal. Civ. Code §§ 1941-1942.5"
}
get_lease_termination_rules
Get lease termination rules including early termination, abandonment, and military/DV protections.
Example query: "Can a domestic violence victim break a lease early in California?"
Returns:
{
"state": "CA",
"landlord_duty_to_mitigate": true,
"domestic_violence_termination": true,
"domestic_violence_notice_days": "14 days written notice",
"military_termination_right": true,
"month_to_month_notice_days": 30,
"abandonment_timeline_days": 18,
"statute_reference": "Cal. Civ. Code §§ 1946, 1946.7"
}
get_required_disclosures
Get required landlord disclosures (lead paint, mold, flood, bed bugs, etc.) for a US state.
Example query: "What disclosures must a California landlord provide?"
Returns:
{
"state": "CA",
"lead_paint_required": true,
"mold_disclosure_required": true,
"bed_bug_history_required": true,
"landlord_identity_disclosure_required": true,
"additional_state_disclosures": "Megan's Law database, death within 3 years, military ordnance, smoking policy...",
"statute_reference": "Cal. Civ. Code §§ 1710.2, 1940-1954"
}
Quick Start
Installation & Build
# Install dependencies
npm install
# Build TypeScript
npm run build
# Start server (production)
npm start
Server runs on http://localhost:3001
Endpoints
- POST /mcp — MCP protocol endpoint (session-based)
- DELETE /mcp — Session cleanup
- GET /health — Health check + cache statistics
Development Mode
# Auto-reload on file changes
npm run dev
Testing
# Start server first
npm run dev
# In another terminal, run CTX Protocol compliance tests
npm test
The test suite validates:
- ✅ All 4 tools registered with outputSchema + _meta
- ✅ structuredContent in all responses
- ✅ City override support (Los Angeles, Chicago, NYC)
- ✅ Compare states mode (returns all 5 states)
- ✅ Error handling with helpful messages
- ✅ Data accuracy (statute references, numeric values, dates)
Docker Deployment
# Build production image
npm run build
docker build -t landlordlaw-mcp .
# Run container
docker run -p 3001:3001 landlordlaw-mcp
# Test health endpoint
curl http://localhost:3001/health
Docker Hub: (Coming soon)
Example AI Agent Queries
Query 1: Basic Deposit Lookup
Agent asks: "What's the security deposit limit in New York?"
Tool call:
{ "name": "get_deposit_rules", "arguments": { "state": "NY" } }
Response:
- Max deposit: 1 month's rent (HSTPA 2019)
- Return deadline: 14 days
- Interest required: No (except NYC buildings with 6+ units)
- Statute: NY GOL § 7-108
Query 2: City-Specific Override
Agent asks: "Do Los Angeles landlords have to pay interest on security deposits?"
Tool call:
{ "name": "get_deposit_rules", "arguments": { "state": "CA", "city": "Los Angeles" } }
Response:
- City override: Los Angeles
- Interest required: No (state and local law)
- RSO registration required for rent-stabilized units
- Relocation assistance required for no-fault evictions: $8,141–$21,042
Query 3: Multi-State Comparison
Agent asks: "Compare eviction notice periods across all states you cover."
Tool call:
{ "name": "get_eviction_timeline", "arguments": { "compare_states": true } }
Response:
- CA: 3 days (pay or quit), just cause required
- TX: 3 days (notice to vacate), no just cause
- NY: 14 days (rent demand), good cause required (2024)
- FL: 3 days (pay or vacate), no just cause
- IL: 5 days (pay or quit), no just cause (except Chicago)
Query 4: Complex Multi-Step Analysis
Agent asks: "I'm a landlord in Chicago with a tenant who hasn't paid rent. Walk me through the eviction process."
Tool calls:
get_eviction_timeline→ 5-day notice required, just cause under RLTOget_late_fee_rules→ 5-day grace period before late feesget_deposit_rules→ Cannot use deposit for last month's rent without consent
Agent synthesizes: Chicago RLTO requires 5-day notice, must specify just cause (nonpayment), and estimate 45-90 day court timeline.
Data Sources
All legal data is sourced from public domain state statutes and cross-referenced with:
-
Official State Codes:
- California Civil Code
- Texas Property Code
- New York General Obligations Law & RPAPL
- Florida Statutes Chapter 83
- Illinois Compiled Statutes 765 ILCS
-
Local Ordinances:
- Los Angeles Municipal Code (RSO)
- Chicago Residential Landlord Tenant Ordinance (RLTO)
- NYC Rent Stabilization Code
-
Verification Sources:
- Nolo.com — Landlord-tenant law guides
- Cornell LII — Legal Information Institute
- State legislature websites
- Municipal code repositories
Last data verification: March 22, 2026
Note: Laws change frequently. Always verify current statutes before making legal decisions.
Architecture
Design Principles
-
Pre-built In-Memory Cache
- All 36 legal rules loaded at startup
- Zero external API calls during queries
- Atomic cache rebuilds (no race conditions)
-
Sub-10ms Response Times
- Map-based lookups keyed by
{topic}:{state} - O(1) access for state-level rules
- O(n) filter for city overrides (n < 5 per state)
- Map-based lookups keyed by
-
Type-Safe Architecture
- Zod schemas for input validation
- TypeScript strict mode enabled
- Structured output schemas (CTX Protocol requirement)
Data Flow
Client Request
↓
POST /mcp (StreamableHTTPServerTransport)
↓
MCP Server → Tool Handler
↓
legalCache.get(topic, state)
↓
Map lookup: "security_deposit:CA"
↓
City override check (if applicable)
↓
structuredContent + outputSchema validation
↓
Response (JSON + MCP envelope)
Project Structure
landlord-law/
├── src/
│ ├── server.ts # Express + MCP server, CTX Protocol compliance
│ ├── cache.ts # In-memory Map<string, LegalRule[]>
│ ├── ingestion.ts # Loads seed data on startup
│ ├── types.ts # LegalRule interface
│ ├── tools/ # 4 MCP tool implementations
│ │ ├── get-deposit-rules.ts
│ │ ├── get-eviction-timeline.ts
│ │ ├── get-entry-requirements.ts
│ │ └── get-late-fee-rules.ts
│ └── data/
│ └── seed.ts # 36 curated legal rules
├── test-compliance.mts # CTX Protocol compliance test (50+ assertions)
├── Dockerfile
├── package.json
├── tsconfig.json
└── README.md
CTX Protocol Compliance
This server is fully compliant with the CTX Protocol Data Broker Standard:
✅ outputSchema (Zod)
Every tool has a z.object() output schema defining the response structure. Required for CTX marketplace validation.
✅ structuredContent
All responses include both:
content: [{ type: "text", text: JSON.stringify(...) }]— Human-readablestructuredContent: { ... }— Structured data for AI agents
✅ _meta Injection
All tools include CTX metadata:
{
"surface": "both",
"queryEligible": true,
"latencyClass": "instant",
"pricing": { "executeUsd": "0.001" },
"rateLimit": {
"maxRequestsPerMinute": 120,
"maxConcurrency": 10,
"cooldownMs": 500
}
}
✅ Session Management
POST /mcpcreates/reuses sessions viaX-Session-IdheaderDELETE /mcpcleans up sessionsStreamableHTTPServerTransporthandles multi-step handshake
✅ Error Handling
Invalid inputs return structured errors with:
errorfield with descriptionsupported_statesarraymessagewith helpful guidance
Roadmap
Phase 2: Expanded Coverage
- [ ] All 50 US states + DC
- [ ] Additional major cities (Austin, San Francisco, Seattle, Boston)
- [ ] Territories (Puerto Rico, Guam)
Phase 3: New Topics
- [ ] Rent increase rules (notice periods, caps, exemptions)
- [ ] Habitability standards (minimum requirements, repair timelines)
- [ ] Required disclosures (lead paint, mold, flood zones, Megan's Law)
- [ ] Lease termination (break fees, military exemptions, domestic violence)
- [ ] Fair housing (protected classes, exemptions, penalties)
Phase 4: Advanced Features
- [ ] Historical data (track law changes over time)
- [ ] Natural language search (semantic matching)
- [ ] Case law citations (major precedents)
- [ ] PDF export (formatted legal summaries)
- [ ] Multi-language support (Spanish, Chinese, Vietnamese)
Phase 5: Integration
- [ ] Stripe integration for paid tiers
- [ ] Webhook notifications for law changes
- [ ] GraphQL API alongside MCP
- [ ] Zapier integration
- [ ] Property management software plugins
Performance Benchmarks
Tested on MacBook Pro (M1, 16GB RAM):
| Operation | Avg Response Time | P95 | P99 |
|---|---|---|---|
| Single state query | 2.3ms | 4.1ms | 6.8ms |
| City override query | 3.1ms | 5.2ms | 8.4ms |
| Compare states (5) | 4.7ms | 7.3ms | 11.2ms |
| Health check | 1.1ms | 2.3ms | 3.9ms |
Cache size: 36 rules = ~180KB in memory
Contributing
We welcome contributions! Areas of need:
-
Legal Data Accuracy
- Verify statute references
- Flag outdated information
- Add missing city ordinances
-
New Jurisdictions
- Research and document new states
- Follow existing data format in
seed.ts - Include statute references and effective dates
-
Code Quality
- TypeScript strict mode improvements
- Performance optimizations
- Test coverage expansion
Before contributing legal data: Cross-reference with at least 2 authoritative sources (official statute + Nolo/LII/state bar).
FAQ
Q: Is this legal advice?
A: No. This tool provides legal information for educational purposes. It is not a substitute for professional legal counsel. Always consult a licensed attorney for specific legal situations.
Q: How often is the data updated?
A: Legal rules are verified quarterly. Major law changes (e.g., AB 12 in California) are updated within 30 days of enactment.
Q: What if I find an error?
A: Please open a GitHub issue with:
- Jurisdiction + topic (e.g., "CA security deposits")
- What's incorrect
- Authoritative source showing the correct rule
Q: Can I use this commercially?
A: Yes, under the MIT license. Attribution appreciated but not required.
Q: Does this work offline?
A: Yes. All data is bundled at build time. No internet connection required after installation.
Q: Why only 5 states?
A: We prioritized the 5 most populous states (representing 40% of US renters). Expansion to all 50 states is on the roadmap.
License
MIT License
Copyright (c) 2026 LandlordLaw MCP Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Disclaimer
⚠️ LEGAL INFORMATION, NOT LEGAL ADVICE
This tool provides general legal information about landlord-tenant law for educational purposes only. It is not a substitute for professional legal advice from a licensed attorney.
Use at your own risk:
- Laws change frequently and vary by jurisdiction
- Local ordinances may override state law
- Court interpretations affect how laws are applied
- Individual circumstances matter
Always consult a qualified attorney before making legal decisions about:
- Evictions or lease terminations
- Security deposit disputes
- Rent increases or late fees
- Habitability or repair issues
- Discrimination claims
No attorney-client relationship is created by using this tool.
The authors and contributors make no warranties about the accuracy, completeness, or timeliness of the information provided.
Contact & Support
- GitHub Issues: Report bugs or request features
- CTX Protocol Marketplace: View on CTX (coming soon)
- Documentation: This README + inline code comments
- Email: landlordlaw-mcp@example.com (for security issues only)
Built with ❤️ for landlords, tenants, and the AI agents that serve them.
Last updated: March 22, 2026
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。