Skip to main content

MCP server for FOLIO, the Federated Open Legal Information Ontology

Project description

folio-mcp

MCP server for FOLIO, the Federated Open Legal Information Ontology.

FOLIO is an open-source legal ontology with 18,000+ concepts covering areas of law, document types, legal entities, governmental bodies, and more. This MCP server makes the full ontology available to AI agents as searchable, browsable tools.

A public REST API is already available at https://folio.openlegalstandard.org/ with interactive Swagger documentation at /docs. This MCP server wraps the same ontology for native use in AI coding assistants and agent frameworks.

License: MIT (server code) / CC-BY 4.0 (ontology data)

Backends

folio-mcp supports two interchangeable backends:

Mode Startup Dependencies Use case
API (default) Instant httpx only Normal usage — calls the public FOLIO REST API
Local (--local) ~10s folio-python[search] Offline use or when mounting inside folio-api

API mode (default)

The server starts instantly and delegates all queries to the public API at https://folio.openlegalstandard.org/. No local ontology loading required.

Local mode

Loads the full FOLIO ontology in-process (~18k classes). Useful for offline work or when embedded in folio-api.

# Install with local dependencies
pip install folio-mcp[local]

# Run in local mode
folio-mcp --local

# Or via environment variable
FOLIO_MCP_LOCAL=1 folio-mcp

Custom API URL

Point to a different FOLIO API instance:

folio-mcp --api-url https://my-folio-instance.example.com

Installation

Claude Code

claude mcp add folio -- uvx folio-mcp

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "folio": {
      "command": "uvx",
      "args": ["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:

https://folio.openlegalstandard.org/mcp

Manual (pip)

pip install folio-mcp
folio-mcp

Tools

Tool Description
search_concepts(query, limit=10) Search concepts by label/name using fuzzy matching
search_definitions(query, limit=10) Search concepts by definition text
get_concept(iri) Get full details for a concept by IRI
export_concept(iri, format) Export a concept as markdown, JSON-LD, or OWL XML
list_branches() List all 24 taxonomy branches with concept counts
get_taxonomy_branch(branch_name, max_depth) Get concepts in a taxonomy branch
get_children(iri, max_depth) Get child concepts
get_parents(iri, max_depth) Get parent concepts
get_properties() Get all OWL object properties (relationships)
find_connections(subject_iri, property_name, object_iri) Find semantic triples

Resources

Resource URI Description
folio://branches Branch names with concept counts
folio://stats Ontology statistics (version, class/property counts)

Taxonomy Branches

The FOLIO ontology is organized into 24 top-level branches:

Branch Description
actors_players Parties, roles, and participants in legal matters
areas_of_law Legal practice areas and specializations
asset_types Types of assets (real property, intellectual property, etc.)
communication_modalities Communication channels and methods
currencies Monetary currencies
data_formats Data and file formats
document_artifacts Legal documents, contracts, filings
engagement_terms Terms of engagement and fee arrangements
events Legal events and milestones
forum_venues Courts, tribunals, and dispute resolution venues
governmental_bodies Government agencies and departments
industries Industry sectors and classifications
languages Natural languages
folio_types FOLIO internal type classifications
legal_authorities Statutes, regulations, case law
legal_entities Entity types (corporations, LLCs, trusts, etc.)
locations Geographic locations and jurisdictions
matter_narratives Matter descriptions and narratives
matter_narrative_formats Formats for matter narratives
objectives Legal objectives and goals
services Legal services and service types
standards_compatibilities Standards and compatibility mappings
statuses Status values for matters, documents, etc.
system_identifiers System and external identifiers

Development

# Clone and install
git clone https://github.com/alea-institute/folio-mcp.git
cd folio-mcp
uv sync

# Run tests (requires folio-python for local backend tests)
uv sync --extra local
uv run pytest tests/

# Run with MCP Inspector
uv run mcp dev folio_mcp/server.py

# Run locally for Claude Code
claude mcp add folio-dev -- uv run --directory /path/to/folio-mcp folio-mcp

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

folio_mcp-0.2.3.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

folio_mcp-0.2.3-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file folio_mcp-0.2.3.tar.gz.

File metadata

  • Download URL: folio_mcp-0.2.3.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for folio_mcp-0.2.3.tar.gz
Algorithm Hash digest
SHA256 b88eef22d945e4c1292cfbeab02cde32f3aee7b5400ac3769271a21d6c550e2e
MD5 657ff4a7e0b6daec02046ec84f5cab5b
BLAKE2b-256 99b508eb1b06b22c46e3890a26975c220153f90534c4fb27284476e20c1d768c

See more details on using hashes here.

File details

Details for the file folio_mcp-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: folio_mcp-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for folio_mcp-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9c4bc811f4fd3d3d1d9f7dc6e1d430abf8c5a9e2d20adaa64c9bbb2aa5c1548e
MD5 e735b0d25e5c93c1fd0b0b37f813e1bc
BLAKE2b-256 370a85d74b818b5fcb29df8103ab421e82cbbbd1307cc2e9ce84b285a72737a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page