MCP Server, Prompts & Resources
Elthoria's MCP stack is split cleanly into three modular artifacts so hosts can either run the turnkey standalone server or embed the protocol runtime and GM pipeline inside another Spring Boot application.
For how the upstream Kompile MCP server, profiles, schema compaction, and Enforcer middleware work on the client/harness side, see Upstream Kompile MCP Architecture ↗.
Artifacts & SPI architecture
| Artifact | Responsibility |
|---|---|
elthoria-mcp-server-core | Host-neutral MCP runtime: SSE (/mcp/sse) and stdio transports, McpToolProvider / McpResourceProvider / McpPromptProvider SPI registries, McpActionLogService undo wrapper, McpReadyFileListener, and ExternalMcpServerManager. Contains zero campaign-specific logic. |
elthoria-mcp-server-gm | Optional nested AI GM MCP tools (elthoria_*) backed by CampaignTurnService (GmTurnRunner, GmSessionStore), plus GmManualPromptProvider (elthoria_gm_manual and elthoria_gm_quickstart). |
elthoria-mcp-server | Thin standalone launcher (StandaloneMcpServerApplication), elthoria CLI wrapper, Kompile harness templates, install.sh, stdio-smoke.sh, and .kspin build tooling. |
Embedding in your own Spring Boot host
@Configuration
public class CustomMcpHostConfig {
@Bean
public McpToolProvider myDomainTools() {
return () -> List.of(/* SyncToolSpecification entries */);
}
@Bean
public GmSessionStore gmSessionStore() {
return new InMemoryGmSessionStore();
}
}Import ai.elthoria.mcp.McpServerConfiguration and supply any McpToolProvider, McpResourceProvider, or McpPromptProvider beans.
Optional nested AI GM tools (elthoria_*)
GmMcpTools exposes Elthoria's in-app CampaignTurnService pipeline over MCP for clients that want to delegate turns to an inner provider (with prompt templates, grounding, and memory writeback):
| Tool | Purpose |
|---|---|
elthoria_start_session | Bind an MCP client sessionKey to a fresh GM chat session |
elthoria_chat | Send a player message to the nested AI GM; returns narration, structured actions, grounding summary, and provider diagnostics |
elthoria_history | Return recent conversation history for a bound GM session |
elthoria_set_context | Pin campaign, characters, and prompt templates for the bound session |
elthoria_list_providers | List available inner AI providers (claude, codex, gemini, …) |
elthoria_list_sessions | List recent GM chat sessions |
elthoria_session_bindings | Inspect all active MCP-session-to-chat bindings |
elthoria_unbind_session | Release a session binding |
TIP
External GM vs. Nested GM: When Kompile, Claude Desktop, Codex, or Antigravity is already acting as the Game Master, call Elthoria's domain tools directly and write the narration yourself. Reserve elthoria_chat only for intentional inner-provider delegation.
Prompt templates (PromptTemplateMcpTools)
Customize how nested or templated GM responses are assembled:
list_prompt_templates,get_prompt_template,create_prompt_template,update_prompt_template,delete_prompt_template(built-in templates cannot be deleted),compose_prompt_templates,preview_prompt_template.
Built-in MCP Prompts catalog
External MCP harnesses can fetch structured playbooks and GM assistants directly via prompts/list and prompts/get:
Harness-as-GM playbooks (GmManualPromptProvider)
| Prompt | Purpose |
|---|---|
elthoria_gm_manual | Complete external-GM playbook covering discovery, dice, generic oracle (fate_check), living-world inspection/advance, Content Workbench safety rules, and GM discipline |
elthoria_gm_quickstart | Compact cheat-sheet with the minimum tool sequence for a grounded GM turn |
GM assistant prompts (GmAssistantMcpPrompts)
| Prompt | Purpose |
|---|---|
build_world | Bootstrap or extend a living world simulation from setting ideas and pasted lore |
generate_encounter | Generate a balanced combat encounter tailored to party composition |
generate_npc | Generate an NPC with personality, backstory, and statblock |
generate_treasure | Generate level-appropriate treasure/loot for an encounter |
session_recap | Produce a grounded session recap from journal entries |
suggest_scenes | Suggest next scenes based on current campaign and world state |
generate_map | Drive iterative procedural generation of a tactical battle map |
Character & combat prompts (CharacterMcpPrompts, CombatMcpPrompts)
| Prompt | Purpose |
|---|---|
character_creation_wizard | Interactive guided character creation |
optimize_character | Suggest mechanical build improvements for an existing character |
generate_backstory | Generate a character backstory tied to campaign hooks |
level_up_advice | Advise on feats, spells, and multiclass choices on level-up |
combat_tactics | Suggest tactical moves for a character or party |
describe_attack | Generate dramatic attack narration from roll results |
describe_spell | Generate dramatic spellcasting narration |
run_combat_encounter | Guide a complete multi-round combat encounter |
Built-in MCP Resources catalog
Read-only live snapshots exposed via resources/list and resources/read:
| URI | Description |
|---|---|
campaign://characters | All characters in the active campaign |
campaign://characters/{id} | Full character sheet details |
campaign://characters/{id}/stats | Calculated stats and bonus breakdowns |
combat://current | Active combat encounter and initiative tracker |
combat://encounters | All saved campaign encounters |
rules://classes | Available RPG classes |
rules://races | Available races |
rules://feats | Available feats |
rules://spells | Available spells |
rules://items | Available weapons, armor, and accessories |
rules://buffs | Available buff and condition templates |
SSE client note
The Java MCP SDK's SSE client defaults its endpoint path to /sse, whereas Elthoria serves /mcp/sse. Always point SSE clients at the full path:
HttpClientSseClientTransport.builder("http://127.0.0.1:8083")
.sseEndpoint("/mcp/sse")
.build();