cfr-compliance-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cfr-compliance-mcpFind relevant CFR parts for a clause on data retention."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CFR Compliance Checker
AI-assisted compliance checking system that takes a contract PDF, extracts its clauses, retrieves the relevant CFR (Code of Federal Regulations) sections through a custom eCFR MCP server, and evaluates each clause's compliance using an LLM agent.
Overview
This project has two independent layers:
MCP Server (
src/cfr_compliance_mcp/) — wraps the official eCFR REST API and exposes it as a set of MCP tools (search, section/part/title retrieval, version history, agency lookup).Agent Pipeline (
agent/) — parses a contract PDF into clauses, builds an optimized CFR search query for each clause, retrieves the matching regulation via the MCP server, and runs an LLM-based compliance evaluation.
The agent layer never talks to eCFR directly — all retrieval goes through the MCP server as an MCP client.
Contract PDF
│
▼
Contract Parser ──▶ Clauses
│
▼
Query Optimizer ──▶ Optimized Query
│
▼
MCP Search (search_regulations → retrieve_section) ──▶ MCP Server ──▶ eCFR REST API
│
▼
Compliance Agent (Agno + Ollama / Llama 3.1)
│
▼
Compliance Result (status, confidence, reason)Related MCP server: fedreg-mcp
Features
Custom eCFR MCP server built on FastMCP, with async HTTP client, XML parsing, caching, and typed request/response models.
Deterministic query optimizer — detects a clause's regulatory domain (environmental, safety, employment, labor, procurement) and predicts likely CFR titles before retrieval, without an LLM call.
Compliance agent built with Agno running on local Ollama (Llama 3.1), returning a validated Pydantic
ComplianceResult(status, confidence, reason).End-to-end pipeline that runs a contract PDF through extraction, retrieval, and compliance evaluation with no manual intervention between steps.
MCP Tools
Tool | Purpose |
| Search eCFR content for a query, returning candidate matches |
| Retrieve the full text of a specific CFR section |
| Retrieve a specific CFR part |
| Retrieve a specific CFR title |
| Retrieve the hierarchical structure of a CFR title |
| Retrieve version/revision history for CFR content |
| Retrieve the list of agencies with CFR content |
Project Structure
agent/
├── contract_parser.py # Extracts text from a contract PDF, splits into clauses
├── cfr_query_optimizer.py # Deterministic domain detection + query optimization
├── mcp_search.py # MCP client: search_regulations + retrieve_section
├── compliance_agent.py # Agno/Ollama compliance evaluation, structured output
├── compliance_pipeline.py # Orchestrates the full clause-by-clause workflow
└── models.py # Shared data models (clauses, ComplianceResult, etc.)
src/cfr_compliance_mcp/
├── clients/ # Async HTTP client for the eCFR API
├── parsing/ # XML parsing for eCFR API responses
├── tools/ # MCP tool implementations
└── server.py # FastMCP server setup, tool registration, caching
contracts/
└── sample_contract.pdf # Sample contract for manual/end-to-end testing
tests/
├── test_optimizer_manual.py
└── test_compliance_agent_manual.pyTech Stack
Python 3.13
FastMCP — MCP server framework
Agno — agent framework with structured (Pydantic) output
Ollama (Llama 3.1) — local LLM runtime
Pydantic v2 — validation and typed models
uv — dependency management and running project modules
Setup
Install dependencies:
uv syncInstall and run Ollama locally, and pull the model:
ollama pull llama3.1Copy
.env.exampleto.envand fill in any required configuration.
Usage
Run the full pipeline against the sample contract:
uv run python -m agent.compliance_pipelineRun the contract parser / clause extraction step on its own:
uv run python -m agent.workflowRun the manual test suites:
uv run python -m tests.test_optimizer_manual
uv run python -m tests.test_compliance_agent_manualSample Result
For the clause SECTION 2. HAZARDOUS MATERIALS HANDLING, the pipeline correctly matched 40 CFR 262.84 (hazardous waste generator standards) and returned:
Field | Value |
Status | Compliant |
Confidence | 0.80 |
Reason | The retrieved regulation matched the contract clause and the compliance agent produced a structured compliance assessment. |
Current Capabilities
Parse a contract PDF and extract its text
Split contract text into individual, structured clauses
Deterministically optimize a CFR search query per clause, based on detected regulatory domain
Search official eCFR content via the custom MCP server
Retrieve the matched CFR section's full text
Evaluate clause-vs-regulation compliance using an LLM agent with structured, validated output
Produce a per-clause compliance result (status, confidence, reason) tied back to the correct clause title
Known Limitations
No automated CI test suite — testing is currently via manual scripts only
No multi-clause batch reporting (single clause per run)
No PDF/Markdown compliance report export
No ranking mechanism when
search_regulationsreturns multiple plausible candidates — current behavior is best-result selectionNo support yet for clauses governed by more than one CFR section
Roadmap
Multi-clause contract reports (aggregate results across all clauses)
PDF/Markdown compliance report export
Improved retrieval ranking for multiple plausible candidates
Support for multiple CFR references per clause
Automated evaluation metrics against a labeled test set
Automated unit/integration test suite runnable in CI
REST API / UI for the pipeline
Normalize LLM confidence values (e.g., convert
95→0.95before validation)Detect clauses with no applicable CFR regulation and skip unnecessary retrieval
Retrieval explainability (optimized query, predicted CFR title, matched keywords, retrieval score)
Branching
Branch | Purpose |
| Stable, production/reference branch |
| Active integration branch |
| Feature branch for retrieval optimization and compliance-agent work |
Author
Vaibhav Vikas Ranjan
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceThe most comprehensive keyless federal-data MCP server. 36 tools for SAM.gov + USAspending + Federal Register + eCFR + Grants.gov. No API key, no registration, no signup. Works in Claude Desktop, Claude Code, Codex CLI, Cursor, Continue, Gemini CLI, and any MCP-aware host.Last updated1001,3954MIT
- Flicense-qualityBmaintenanceAn MCP server that provides AI agents with access to U.S. Federal Register rules and Regulations.gov public comments, enabling searches, rule retrieval, and comment fetching.Last updated
- Alicense-qualityCmaintenanceA modular MCP server providing structured, methodology-driven prompt endpoints for rapid legal/compliance landscape mapping, gap discovery, and risk prioritization across privacy, IP, AI governance, security, consumer, and disclosure domains, with argument-based adaptability to any product context.Last updated316MIT
- Flicense-qualityCmaintenancePro Se Engine is an MCP server that provides 39 legal research tools across 6 government APIs, enabling AI agents to access case law, SEC filings, federal legislation, regulations, government contracts, and document processing workflows.Last updated
Related MCP Connectors
A paid remote MCP for CLI tool MCP, built to return verdicts, receipts, usage logs, and audit-ready
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Connect AI to millions of laws and court cases with the Lawstronaut MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/vvXranjan/cfr-compliance-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server