DraCor (Drama Corpora Project) MCP server

Integrates with the Drama Corpora Project API to enable analysis of dramatic texts, character networks, and literary themes across different languages and historical periods.
Back to servers
Setup instructions
Provider
Stijn Meijers
Release date
Mar 19, 2025
Language
Python
Stats
3 stars

The DraCor MCP server enables seamless interaction with the Drama Corpora Project API, allowing Claude and other LLMs to analyze dramatic texts, character networks, and play information across different languages and periods. This server bridges the gap between large language models and structured drama corpora data.

Installation

Prerequisites

  • Python 3.10 or higher
  • UV package manager (recommended) or pip

Setting Up the Server

  1. Install UV:
pip install uv
  1. Create a virtual environment and install dependencies:
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e .
  1. Install the MCP server in Claude Desktop:
mcp install dracor_mcp_fastmcp.py  # Recommended (v1 API)

Development Mode Testing

For testing and development purposes:

mcp dev dracor_mcp_fastmcp.py

This launches the MCP Inspector for interactive tool and resource testing.

Claude Configuration

Configure Claude to use the DraCor MCP server by adding this to your Claude configuration file:

{
  "mcpServers": {
    "DraCor API v1": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "--with",
        "requests",
        "--with",
        "pydantic",
        "--with",
        "python-multipart",
        "mcp",
        "run",
        "/path/to/dracor-mcp/dracor_mcp_fastmcp.py"
      ],
      "env": {
        "DRACOR_API_BASE_URL": "https://dracor.org/api/v1"
      }
    }
  }
}

Replace /path/to/dracor-mcp/ with the actual path to your dracor-mcp directory.

To use a different server such as staging:

"env": {
  "DRACOR_API_BASE_URL": "https://staging.dracor.org/api/v1" 
}

Docker Installation (Optional)

If you prefer using Docker:

docker build -t dracor-mcp .
docker run dracor-mcp

For the FastMCP implementation:

docker run -e IMPLEMENTATION=fastmcp dracor-mcp

Using the DraCor MCP Server

Once installed in Claude Desktop, you can interact with the DraCor API through natural language queries.

Basic Queries

Ask Claude about available corpora:

Can you list all available drama corpora in DraCor?

Get information about specific plays:

Tell me about Goethe's Faust in the German corpus

Analyze character networks:

Analyze the character network in Hamlet from the Shakespeare corpus

Advanced Analysis

Analyze character relationships:

What are the strongest character relationships in Pushkin's Boris Godunov?

Compare different plays:

Compare Goethe's Faust and Schiller's Die Räuber in terms of network density and character count

Identify influential characters:

Who are the most central characters in Shakespeare's Hamlet based on speaking time and relationships?

Analyze gender representation:

Analyze the gender distribution and representation in Molière's Le Misanthrope

Find characters across multiple plays:

Find all plays that feature a character named "Hamlet" or similar

Text Analysis

Analyze complete play texts:

Provide a comprehensive analysis of the full text of Goethe's Faust

Extract themes and motifs:

What are the main themes and motifs in the full text of Shakespeare's Hamlet?

Examine language patterns:

Analyze the language patterns and style in Chekhov's The Cherry Orchard

Literary and Structural Analysis

Analyze play structure:

Analyze the structure of Molière's Le Misanthrope in terms of acts, scenes, and dialogue distribution

Compare different playwrights:

Compare the network structures in plays by Shakespeare and Molière

Examine historical context:

Put Pushkin's Boris Godunov in its historical context and analyze how this is reflected in the character network

Available Resources and Tools

Key Resources

  • Information about corpora and plays
  • Character lists and networks
  • Spoken text and stage directions
  • Network metrics and character relations
  • Full play texts (plain text and TEI XML formats)

Analytical Tools

  • Search functionality across plays
  • Play comparison tools
  • Character relationship analysis
  • Play structure analysis
  • Full text analysis capabilities

Troubleshooting

If you encounter issues:

  1. Verify you're using Python 3.10 or higher
  2. Run in development mode to debug: mcp dev dracor_mcp_fastmcp.py
  3. Check the DraCor API status at https://dracor.org/doc/api

Remember that the DraCor API is publicly accessible with rate limits, so be mindful of excessive requests.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "DraCor-API-v1" '{"command":"uv","args":["run","--with","mcp[cli]","--with","requests","--with","pydantic","--with","python-multipart","mcp","run","/path/to/dracor-mcp/dracor_mcp_fastmcp.py"],"env":{"DRACOR_API_BASE_URL":"https://dracor.org/api/v1"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "DraCor API v1": {
            "command": "uv",
            "args": [
                "run",
                "--with",
                "mcp[cli]",
                "--with",
                "requests",
                "--with",
                "pydantic",
                "--with",
                "python-multipart",
                "mcp",
                "run",
                "/path/to/dracor-mcp/dracor_mcp_fastmcp.py"
            ],
            "env": {
                "DRACOR_API_BASE_URL": "https://dracor.org/api/v1"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "DraCor API v1": {
            "command": "uv",
            "args": [
                "run",
                "--with",
                "mcp[cli]",
                "--with",
                "requests",
                "--with",
                "pydantic",
                "--with",
                "python-multipart",
                "mcp",
                "run",
                "/path/to/dracor-mcp/dracor_mcp_fastmcp.py"
            ],
            "env": {
                "DRACOR_API_BASE_URL": "https://dracor.org/api/v1"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later