Skip to content

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 ​

ArtifactResponsibility
elthoria-mcp-server-coreHost-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-gmOptional nested AI GM MCP tools (elthoria_*) backed by CampaignTurnService (GmTurnRunner, GmSessionStore), plus GmManualPromptProvider (elthoria_gm_manual and elthoria_gm_quickstart).
elthoria-mcp-serverThin 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 ​

java
@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):

ToolPurpose
elthoria_start_sessionBind an MCP client sessionKey to a fresh GM chat session
elthoria_chatSend a player message to the nested AI GM; returns narration, structured actions, grounding summary, and provider diagnostics
elthoria_historyReturn recent conversation history for a bound GM session
elthoria_set_contextPin campaign, characters, and prompt templates for the bound session
elthoria_list_providersList available inner AI providers (claude, codex, gemini, …)
elthoria_list_sessionsList recent GM chat sessions
elthoria_session_bindingsInspect all active MCP-session-to-chat bindings
elthoria_unbind_sessionRelease 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) ​

PromptPurpose
elthoria_gm_manualComplete external-GM playbook covering discovery, dice, generic oracle (fate_check), living-world inspection/advance, Content Workbench safety rules, and GM discipline
elthoria_gm_quickstartCompact cheat-sheet with the minimum tool sequence for a grounded GM turn

GM assistant prompts (GmAssistantMcpPrompts) ​

PromptPurpose
build_worldBootstrap or extend a living world simulation from setting ideas and pasted lore
generate_encounterGenerate a balanced combat encounter tailored to party composition
generate_npcGenerate an NPC with personality, backstory, and statblock
generate_treasureGenerate level-appropriate treasure/loot for an encounter
session_recapProduce a grounded session recap from journal entries
suggest_scenesSuggest next scenes based on current campaign and world state
generate_mapDrive iterative procedural generation of a tactical battle map

Character & combat prompts (CharacterMcpPrompts, CombatMcpPrompts) ​

PromptPurpose
character_creation_wizardInteractive guided character creation
optimize_characterSuggest mechanical build improvements for an existing character
generate_backstoryGenerate a character backstory tied to campaign hooks
level_up_adviceAdvise on feats, spells, and multiclass choices on level-up
combat_tacticsSuggest tactical moves for a character or party
describe_attackGenerate dramatic attack narration from roll results
describe_spellGenerate dramatic spellcasting narration
run_combat_encounterGuide a complete multi-round combat encounter

Built-in MCP Resources catalog ​

Read-only live snapshots exposed via resources/list and resources/read:

URIDescription
campaign://charactersAll characters in the active campaign
campaign://characters/{id}Full character sheet details
campaign://characters/{id}/statsCalculated stats and bonus breakdowns
combat://currentActive combat encounter and initiative tracker
combat://encountersAll saved campaign encounters
rules://classesAvailable RPG classes
rules://racesAvailable races
rules://featsAvailable feats
rules://spellsAvailable spells
rules://itemsAvailable weapons, armor, and accessories
rules://buffsAvailable 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:

java
HttpClientSseClientTransport.builder("http://127.0.0.1:8083")
    .sseEndpoint("/mcp/sse")
    .build();

Built on the upstream Kompile harness. Released under the MIT License.