FOLIO MCP Server

The FOLIO MCP Server brings the full power of the FOLIO legal ontology — 18,000+ concepts covering areas of law, document types, legal entities, and more — directly into AI coding assistants like Claude Code, Gemini CLI, and OpenAI Codex.

Using the Model Context Protocol (MCP), the FOLIO MCP server gives AI assistants real-time access to search, browse, and export legal concepts without leaving the development environment. This enables AI-assisted legal software development, document classification, and ontology-driven workflows.

ResourceLink
PyPI Packagehttps://pypi.org/project/folio-mcp/
GitHub Repositoryhttps://github.com/alea-institute/folio-mcp
Claude Code Pluginhttps://github.com/alea-institute/folio-claude-plugin
FOLIO API (Backend)https://folio.openlegalstandard.org/docs

Claude Code Plugin

The FOLIO plugin for Claude Code has been submitted to the official plugin marketplace and is currently under review. Once approved, you’ll be able to install it with:

/plugin install folio

In the meantime, you can use the manual setup below.

Quick Start

Prerequisites

  • Python 3.10+ and uv installed
  • One of: Claude Code, Gemini CLI, OpenAI Codex, VS Code, or Cursor

Claude Code

claude mcp add folio -- uvx folio-mcp

Or create .mcp.json in your project root:

{
  "mcpServers": {
    "folio": {
      "command": "uvx",
      "args": ["folio-mcp"]
    }
  }
}

Gemini CLI

gemini mcp add folio uvx folio-mcp

OpenAI Codex

codex mcp add folio -- uvx folio-mcp

Cursor

Add to .cursor/mcp.json in your project:

{
  "mcpServers": {
    "folio": {
      "command": "uvx",
      "args": ["folio-mcp"]
    }
  }
}

VS Code

Add to your User Settings (JSON):

{
  "mcp": {
    "servers": {
      "folio": {
        "command": "uvx",
        "args": ["folio-mcp"]
      }
    }
  }
}

Remote (Streamable HTTP)

Connect to the hosted endpoint — no installation required:

https://folio.openlegalstandard.org/mcp

Available Tools

The FOLIO MCP server provides 12 tools for searching, browsing, and exporting legal concepts:

ToolDescription
search_conceptsSearch concepts by label (name) — primary entry point
search_definitionsSearch concepts by definition text
query_conceptsAdvanced query with composable text and structural filters
query_propertiesQuery OWL object properties by label, domain, range
get_conceptGet full details for a concept by IRI
export_conceptExport as Markdown, JSON-LD, or OWL XML
list_branchesList all 24 taxonomy branches with concept counts
get_taxonomy_branchGet all concepts in a specific branch
get_childrenGet child concepts in the taxonomy
get_parentsGet parent concepts in the taxonomy
get_propertiesList all OWL object properties
find_connectionsFind semantic connections between concepts

All tool responses include full concept data when available: translations (31% of concepts across 10+ languages including Spanish, French, Japanese, Chinese, Hindi), preferred labels, external identifiers (ISO codes, SALI codes), alternative labels, cross-references, and more.

Resources

The server also exposes MCP resources for direct context access:

Resource URIDescription
folio://branchesIndex of all 24 taxonomy branches with concept counts
folio://statsOntology statistics — version, class/property counts, license
folio://branch/{name}Top-level concepts in a specific branch (on-demand)

Prompt Templates

The server includes reusable prompt templates that guide the AI through structured classification workflows:

PromptDescriptionArgument
classify-documentClassify a legal document against the FOLIO taxonomydescription
identify-area-of-lawIdentify applicable areas of law for a situationsituation
classify-entityClassify a legal entity (person, organization, role)entity

Examples

Classifying a contract clause

Ask your AI assistant: “Search FOLIO for assignment clause”

The assistant will search the ontology and find:

  • Assignment Clause — provision allowing a party to transfer rights or obligations
  • Plus narrower subtypes: Assignment by Buyer Clause, Assignment of Claims Clause, Assignment of Rents Clause, Consent to Assignment Clause, No Assignment Clause, Reassignment Clause

Ask: “Show me the U.S. court system in FOLIO”

The assistant will browse the forum_venues branch and find the Dispute Venue hierarchy:

  • U.S. Courts — Federal Courts, State Courts (all 50 states)
  • Alternative Dispute Resolution Venues — Arbitration, Mediation
  • Administrative Proceeding Venues — USPTO, MSPB, and other agencies
  • Legislative Proceedings

Browsing areas of law

Ask: “What areas of law does FOLIO define?”

The assistant will read the folio://branches resource, then browse areas_of_law to find all 31 practice areas — from Agriculture Law to Transportation Law — each with definitions and translations in 10+ languages.

Classifying a document type

1. search_concepts("software licensing agreement")
   → Finds: Software License Agreement, License Agreement, ...

2. get_concept(iri)
   → Full details: definition, translations, parent/child concepts

3. get_parents(iri)
   → Taxonomy path: Software License Agreement → License Agreement
     → Contract → Transactional Document → Document Types

4. export_concept(iri, format="jsonld")
   → Machine-readable JSON-LD for integration

Multilingual concept lookup

Many FOLIO concepts include translations in 10+ languages. When you retrieve a concept like “U.S. Postal Service”, you get:

  • es-es: Servicio Postal de EE. UU.
  • fr-fr: Service postal des États-Unis
  • ja-jp: アメリカ合衆国郵便公社
  • zh-cn: 美国邮政服务
  • hi-in: यूएस पोस्टल सर्विस

Architecture

The MCP server supports two modes:

API Mode (Default)

AI Assistant → stdio → folio-mcp → HTTPS → folio.openlegalstandard.org

Lightweight client that calls the public FOLIO REST API. No API key required — the FOLIO API is freely available with open CORS.

Local Mode

AI Assistant → stdio → folio-mcp → in-process → FOLIO ontology

Loads the full ontology in-process for offline or low-latency use. Requires the folio-python[search] package:

{
  "mcpServers": {
    "folio-local": {
      "command": "uvx",
      "args": ["folio-mcp", "--local"]
    }
  }
}

Use Cases

  • Legal software development: Classify documents, entities, and events using FOLIO’s standardized taxonomy
  • Contract analysis: Map contract types and clauses to FOLIO categories
  • Compliance workflows: Identify relevant areas of law and regulatory frameworks
  • Legal research: Explore relationships between legal concepts and their definitions
  • Data interoperability: Export concepts in JSON-LD or OWL XML for system integration

Contributing

Contributions are welcome! Visit the folio-mcp GitHub repository to report issues, suggest features, or submit pull requests.

License

The FOLIO MCP server is released under the MIT License. See the LICENSE file for details.

Support

If you encounter any issues or have questions, please open an issue on GitHub or visit the FOLIO community forum.