tei-mcp

tei-mcp startup banner

tei-mcp: TEI P5 for AI Agents

tei-mcp is an open-source MCP server that gives AI coding assistants direct access to the TEI P5 specification. Instead of relying on memorised training data — which often produces plausible but incorrect markup — the AI can query the specification in real time.

Features

The server parses the TEI P5 ODD and exposes 16 tools:

  • Lookup any element, class, macro, or module by name with case-insensitive matching and typo suggestions
  • Resolve attributes across the full TEI class hierarchy (local + inherited)
  • Expand content models into structured trees with class and macro resolution
  • Validate nesting — direct parent-child or recursive reachability with path tracking
  • Validate documents against TEI P5: content models, attributes, closed value lists, reference integrity, and deprecation warnings
  • Validate single elements for incremental editing workflows
  • Load ODD customisations to constrain the schema to a project-specific subset
  • Search across all entity types with regex patterns

Installation

pip install tei-mcp

Or run directly with:

uvx tei-mcp

Usage

Add to any MCP-compatible client (Claude, Cursor, Windsurf, etc.):

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

Find the source code and documentation at the GitHub repository.

Clément Godbarge
Clément Godbarge
Lecturer in Digital Humanities

My research interests include early modern history, European literature and the digital humanities.