MCP Server
Connect AI assistants like Claude to your Loreum world data using the Model Context Protocol. Read your entire world and write changes that land in a review queue for your approval.
What is MCP?
MCP (Model Context Protocol) is an open standard that lets AI assistants connect to external tools and data sources. Loreum's MCP server exposes your world data as structured tools the AI can call. The AI reads your characters, relationships, timeline, lore, and style guide. It can also propose changes (new entities, relationships, articles) that land in a staging area for your review.
Authentication
Generate a project-scoped API key from your project settings page. Each key has a name (e.g. "Claude Desktop"), a permission level (read-only or read-write), and an optional expiration date. The key is displayed once on creation. Copy it and add it to your MCP client configuration.
You can generate multiple keys per project and revoke any key at any time from project settings.
Setup for Claude Desktop
Add this to your Claude Desktop MCP configuration file:
{
"mcpServers": {
"loreum": {
"command": "node",
"args": ["path/to/loreum/apps/mcp/dist/index.js"],
"env": {
"MCP_API_BASE_URL": "https://loreum.app/v1",
"MCP_API_TOKEN": "your-api-key"
}
}
}
}Replace your-api-key with the key you generated in project settings. For local development, use http://localhost:3021/v1 as the base URL.
Read Tools
These tools let the AI query your world data. Available with both read-only and read-write API keys.
| Tool | Description |
|---|---|
| search_project | Full-text search across entities, lore, scenes, and timeline |
| get_entity | Single entity with optional relationships, lore, scenes, and timeline |
| get_entity_hub | Full aggregated page for an entity with all connected content |
| list_entities | List and filter entities by type, tag, or search query |
| get_storyboard | Narrative structure: plotlines, works, chapters, scenes |
| get_entity_types | Entity types and their field schemas |
| get_style_guide | Base style guide, scene overrides, and character voice notes |
| get_timeline | Timeline events and eras for a project |
| get_lore_article | Single lore article with linked entities |
| list_lore_articles | List and filter lore articles by category or tag |
| get_relationships | Relationships for a specific entity |
Write Tools
These tools let the AI propose changes to your world. All writes create pending changes in the review queue instead of modifying live data. Requires a read-write API key.
| Tool | Description |
|---|---|
| create_entity | Create a character, location, organization, or custom item |
| update_entity | Partial update to an existing entity |
| delete_entity | Delete an entity |
| create_relationship | Create a relationship between two entities |
| delete_relationship | Delete a relationship |
| create_lore_article | Create a lore article linked to entities |
| update_lore_article | Update an existing lore article |
| delete_lore_article | Delete a lore article |
| create_timeline_event | Create a timeline event linked to entities |
| update_timeline_event | Update an existing timeline event |
| delete_timeline_event | Delete a timeline event |
| create_scene | Create a scene within a chapter |
| update_scene | Update scene content, style notes, or characters |
| create_plot_point | Create a plot point on a plotline |
| update_plot_point | Update a plot point |
| set_style_guide | Create or update the project style guide |
Review Queue
Every write tool creates a pending change instead of modifying your world directly. You review these changes from the Review Queue page in your project. Each change shows the operation type (create, update, or delete), the target, and a diff of what will change. Changes from a single AI session are grouped together so you can review them in context.
You can accept, edit, or reject each change individually, or use batch accept to apply all changes from a session at once.
Example Usage
Once connected, you can ask Claude things like:
- "Who are the main characters in my Star Wars project?"
- "What relationships does Luke Skywalker have?"
- "Create a new location called the Iron Citadel."
- "Write a lore article about the history of the Jedi Order."
- "What does my style guide say about dialogue?"
- "Add a timeline event for the Battle of Yavin."
- "Is there anything contradictory in my timeline?"
Self-Hosting
The MCP server is included in the Loreum repository at apps/mcp/. Build it with pnpm --filter mcp build and run with node dist/index.js.