OpenContracts
Self-hosted document intelligence with a citation graph, annotation, and MCP server.
Overview
OpenContracts is an open-source, self-hosted document intelligence platform that turns a repository of files into a programmable citation graph. It combines human annotation, structured extraction, AI agents, and a Model Context Protocol server behind a single API, and presents the same graph through a React interface, a GraphQL and REST API, and an MCP endpoint. The project is MIT-licensed and intended for teams working with document sets at scale.
The product is aimed at people who need to navigate what documents cite rather than merely store them: statutory citations, precedent, standards, governing contracts, and similar reference relationships. Once documents are uploaded, agents describe and summarize them and detected citations are resolved and drawn as edges. References the library does not yet hold are tracked as a backlog rather than discarded, and citations are highlighted inline with a References panel that lists what a document cites and what cites it back.
What distinguishes OpenContracts is that the interface is not a closed box. The UI runs on surfaces users can call directly, including document- and corpus-scoped agents in Python, a pluggable MCP server, structured extraction across an entire corpus, and swappable parsing, embedding, and thumbnail components. A corpus-scoped agent answers questions with grounded, cited responses, and every graph element, from corpuses and documents to annotations, relationships, and extracts, is queryable through the typed API.
Best for
- Legal operations and contract analysts
- Compliance and policy researchers
- Knowledge base and research library managers
- Software engineers building document tooling
- Data extraction and annotation teams
- Legal services
- Financial services
- Research and academia
- Engineering and standards
- Corporate compliance
How to use
- Create a corpus and upload your documents.
- Click Set up to install the intelligence bundle and begin citation resolution.
- Review inline citation highlights and open cites from the References panel.
- Ask corpus-scoped questions in the ask bar to get grounded, cited answers.
- Define a fieldset and run it across the corpus, then approve or reject each extracted cell.
- Connect an MCP client or call the GraphQL and REST API to build your own tooling.
What it can do
How it works
Documents enter through uploads; an optional converter can turn eligible non-native formats into PDF ahead of parsing, and the pipeline then parses, thumbnails, and embeds each file using components stored in a database-backed settings record. The default extraction pipeline runs a column's query through the agent framework, while custom extractors can register their own Celery task and call the structured-response API directly. Parsers, embedders, and thumbnailers are swappable, with formats mapped to preferred implementations, and the original upload is preserved when conversion occurs.
The citation graph is reachable through three surfaces: a React interface for teams, a typed GraphQL API with REST for uploads and health checks, and an MCP server exposed per corpus, with anonymous and authenticated endpoint variants and discovery files. External MCP clients can search corpuses, list documents and annotations, walk relationships, and read or post messages in threads. Humans remain in the loop where the sources say so: extraction results carry per-cell approve or reject decisions, and an MCP client can propose annotations only when it is authorized to do so.
Agents handle document- and corpus-scoped tasks and grounded answers, and MCP clients can propose annotations only when authorized, while structured extraction requires human approve or reject on every cell.
Where it fits
- Map which SEC filings cite specific sections of Delaware corporate law and federal securities rules.
- Summarize indemnification or other clauses in a contract with cited, grounded answers.
- Extract defined fields such as contract dates across hundreds of documents into a review grid.
- Let an external agent search a corpus and traverse citation edges over MCP.
Good fit
- Building a citation graph from a repository of legal, research, or policy documents
- Teams needing a self-hosted, MIT-licensed document intelligence platform with API and MCP access
- AI agent workflows that require grounded answers with citations from documents
- Structured data extraction across many documents with human review
Not a fit
- Organizations seeking a fully managed, proprietary citation service with no self-hosting
- Users who need a pre-built closed citation database like Westlaw or Lexis
- Deployments where document conversion egress to external services is prohibited without network restrictions
How to evaluate
- Confirm whether you need self-hosting and have the infrastructure to run the provided Docker compose services.
- Verify that the MCP server endpoints and tools match your agent integration requirements.
- Assess whether the pipeline components (parsers, embedders, thumbnailers) support your document formats or can be extended.
- Check that the structured extraction workflow with human approve/reject fits your data quality process.
- Review the security considerations for file conversion, especially SSRF risks if using Gotenberg.
Our take
OpenContracts is an open-source platform for building a citation graph from document repositories, with APIs, MCP integration, and a React UI. It is self-hosted and MIT-licensed, making it suitable for teams that want control over their data and infrastructure. The platform supports AI agents, structured extraction, and pluggable pipelines, but it requires technical setup and may not suit those seeking a fully managed service. Its focus on citations and relationships between documents differentiates it from simple document storage tools.
Alternatives
| Agent | Pricing | Autonomy | Best for |
|---|---|---|---|
| ragflow | — | Supervised | AI developers, RAG engineers, Data engineers, Knowledge managers, Platform engineers |
| deer-flow | — | Supervised | Software developers, AI and agent engineers, Research engineers, Technical teams building agent workflows, Data pipeline builders |
| anything-llm | — | Supervised | IT administrators managing private AI instances, Developers building custom integrations, Teams evaluating local versus cloud model providers, Knowledge workers querying internal documents, Operations staff scheduling recurring agent tasks |
| Vane | — | Assistant | Privacy-conscious researchers, AI developers testing local models, Technical writers and documentation specialists, Students doing academic research, Data analysts comparing model outputs |
| FrontierAgent | — | Supervised | Research analysts, Developers building agent workflows, Benchmark and evaluation engineers, Data and file-processing specialists, Technical operations staff |
| Sidekick | — | Supervised | Researchers, Students, Writers and editors, Software developers, Knowledge workers, Analysts |
FAQ
- What is OpenContracts?
- OpenContracts is an open-source document intelligence platform that builds a programmable citation graph from document repositories, offering human annotation, structured extraction, AI agents, and an MCP server behind one API.
- How is OpenContracts licensed?
- OpenContracts is MIT-licensed, as stated in the README.
- What are the system requirements for self-hosting?
- The sources mention Docker compose services for local and production deployments, but specific hardware or software requirements are not detailed. You should review the documentation for deployment prerequisites.
- Can I use my own AI agents with OpenContracts?
- Yes, every corpus is exposed over the Model Context Protocol, allowing Claude, Cursor, or any MCP client to search it and interact with citation edges when authorized.
- What pricing model does OpenContracts use?
- The sources do not provide pricing information. As an open-source project, it is likely free to self-host, but you should check the official repository or website for any commercial offerings.
- Does OpenContracts offer a free trial?
- No trial information is provided in the sources. Since it is open-source, you can evaluate it by self-hosting without a trial.
- What document formats are supported?
- The pipeline supports PDF, text, and DOCX natively, and file converters can handle other formats like Office documents via Gotenberg. Custom parsers can be registered for additional formats.
- How does structured extraction work?
- You define a fieldset with columns as natural-language queries, and extraction runs across a corpus using Celery workers, presenting results in a grid with human approve/reject for each cell.
Embed a listing badge
<a href="https://aiagentsmarketplace.dev/agents/opencontracts"><img src="https://aiagentsmarketplace.dev/badges/featured.svg" alt="Featured on AI Agents Marketplace" width="262" height="36"></a>
Comments
No comments yet.