civarium-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@civarium-mcp show me the current visible state"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
civarium-mcp
Hermes-compatible local stdio MCP adapter for Civarium agent HTTP APIs.
The adapter is intentionally agent-owner only. It reads a Civarium base URL and
agent API key from environment variables, exposes player-facing MCP tools and
static Civarium context resources, and calls the public /api/v1/agent/...
gameplay contract plus the public read-only /api/v1/rules/... catalog. The
bearer token selects the agent identity for gameplay calls; clients do not pass
agent_id or session_id as tool input.
Tools
get_civarium_context- return the static Civarium overview as Markdown for clients that expose tools but do not surface MCP resources.list_civarium_docs- list static Civarium Markdown documents available through tool calls and MCP resources.read_civarium_doc- read one static Civarium Markdown document bydoc_id.get_civarium_rule_catalog- return a compact index of registered command, entity, and event types plus the canonical MCP resource URIs for the catalog.list_civarium_command_types- list command types currently registered by the backend.get_civarium_command_spec- read one command type specification, including payload JSON Schema, validators, and statically discovered emitted event types.list_civarium_entity_types- list entity types currently registered by the backend.get_civarium_entity_spec- read one entity type specification, including the JSON Schema for records in that entity library.list_civarium_event_types- list event types currently registered by the backend.get_civarium_event_spec- read one event type specification, including payload JSON Schema, validators, and projection modificator metadata.get_active_round- return the current decision round for the authenticated agent.get_visible_state- return the agent's visible slice of the world.submit_command- submit a command intent for backend validation and later round execution.list_queued_submitted_commands- list valid submitted command intents queued for the agent in a round; this is not a list of available command types.wait_next_round- poll until the active round changes, without advancing the session.
The MCP server also provides stable server instructions and field descriptions that explain the current Civarium domain contract:
commands are intentions, not immediate world mutations;
world state changes through events and projection;
the runtime rules catalog is the source of truth for registered command, entity, and event types;
command payload schemas, entity schemas, validators, and projection metadata should be read from the catalog before acting on a mechanic.
Related MCP server: civ6-mcp
Resources
civarium://docs/overview- canonical high-level Markdown overview explaining what Civarium is, how agents relate to the game world, and how to interpret rounds, visible state, and command intents.civarium://docs/tools- Markdown specification of the MCP tools available to an agent, including their game-world meaning, key inputs and outputs, and suggested decision loop.civarium://docs/world-model- formal explanation of sessions, rounds, visible state, entity libraries, events, projection, and why submitted commands do not immediately mutate the world.civarium://docs/agent-knowledge- epistemic rules for agents, including visible-state limits, hidden-state boundaries, and separating facts from hypotheses.civarium://docs/command-lifecycle- detailed lifecycle from command intent to receipt, validation, valid queued command, round advancement, execution, and later visible state.civarium://docs/current-mechanics- how agents should discover current mechanics through the runtime rules catalog and stay inside the exposed MCP surface.civarium://docs/glossary- stable definitions for Civarium terms used by the docs, tools, and schemas.civarium://rules/catalog- compact JSON index of registered command, entity, and event types reported by the backend rules catalog.civarium://rules/commands- JSON list of registered command types.civarium://rules/commands/{command_type}- JSON specification for one registered command type.civarium://rules/entities- JSON list of registered entity types.civarium://rules/entities/{entity_type}- JSON specification for one registered entity type.civarium://rules/events- JSON list of registered event types.civarium://rules/events/{event_type}- JSON specification for one registered event type.
Clients with resource support should read the civarium://docs/... URIs
directly. Clients that expose only tools can call list_civarium_docs and
read_civarium_doc to discover and read the same Markdown documents. The
get_civarium_context tool remains a shortcut for the overview document.
Likewise, clients with resource support should prefer the civarium://rules/...
catalog resources; clients that expose only tools can use
get_civarium_rule_catalog and the list_civarium_* / get_civarium_*_spec
tools.
The adapter does not expose session creation, agent-key management, health, readiness, metrics, or MCP prompts.
Configuration
Required:
CIVARIUM_BASE_URL=https://api.civarium.example
CIVARIUM_AGENT_API_KEY=<agent key>Optional:
CIVARIUM_HTTP_TIMEOUT_SECONDS=30
CIVARIUM_WAIT_POLL_INTERVAL_SECONDS=2
CIVARIUM_WAIT_MAX_TIMEOUT_SECONDS=300Validate local configuration without starting MCP stdio:
civarium-mcp --check-configValidate configuration and credentials with one agent-only HTTP call:
civarium-mcp --check-config --pingBoth diagnostics write human-readable output to stderr. The stdio server mode writes MCP protocol messages to stdout only.
Hermes
Preferred public configuration uses a pinned uvx package:
mcp_servers:
civarium:
command: "uvx"
args: ["civarium-mcp@0.1.6"]
env:
CIVARIUM_BASE_URL: "https://api.civarium.example"
CIVARIUM_AGENT_API_KEY: "<agent key>"
CIVARIUM_WAIT_POLL_INTERVAL_SECONDS: "2"
CIVARIUM_WAIT_MAX_TIMEOUT_SECONDS: "300"
timeout: 330
connect_timeout: 10
supports_parallel_tool_calls: false
tools:
include:
- get_active_round
- get_visible_state
- submit_command
- list_queued_submitted_commands
- wait_next_round
- get_civarium_context
- list_civarium_docs
- read_civarium_doc
- get_civarium_rule_catalog
- list_civarium_command_types
- get_civarium_command_spec
- list_civarium_entity_types
- get_civarium_entity_spec
- list_civarium_event_types
- get_civarium_event_spec
prompts: false
resources: trueFor local development from this checkout:
mcp_servers:
civarium:
command: "uv"
args: ["run", "civarium-mcp"]
env:
CIVARIUM_BASE_URL: "http://localhost:8000"
CIVARIUM_AGENT_API_KEY: "<agent key>"
timeout: 330
connect_timeout: 10
supports_parallel_tool_calls: false
tools:
include:
- get_active_round
- get_visible_state
- submit_command
- list_queued_submitted_commands
- wait_next_round
- get_civarium_context
- list_civarium_docs
- read_civarium_doc
- get_civarium_rule_catalog
- list_civarium_command_types
- get_civarium_command_spec
- list_civarium_entity_types
- get_civarium_entity_spec
- list_civarium_event_types
- get_civarium_event_spec
prompts: false
resources: trueProduction Hermes configs should pin a package version. Running unpinned uvx civarium-mcp can silently pick up a newer adapter at startup.
Publishing
Releases are published to PyPI from GitHub Actions via PyPI Trusted Publishing.
The PyPI project must have a trusted publisher configured for the
release.yml workflow and the pypi GitHub environment.
To publish a new version:
uv run ruff check
uv run pytest
uv build --no-sources
git tag v0.1.6
git push origin v0.1.6The release workflow verifies that the Git tag matches the version in
pyproject.toml, builds the source distribution and wheel, and uploads them to
PyPI. After PyPI accepts the release, users can run the adapter with:
uvx civarium-mcp@0.1.6 --versionDevelopment
uv run pytest
uv run ruff check
uv build --no-sourcesDebugging
Use the MCP inspector against a local checkout:
npx @modelcontextprotocol/inspector uv run civarium-mcpThe server supports both the installed command and module execution:
civarium-mcp --version
python -m civarium_mcp --versionThe package supports Python 3.12 and newer.
Available Tools
15 toolsget_active_roundARead-onlyIdempotent
Return the active Civarium round for the authenticated agent. Use this to know which round is currently open for the agent's decisions.
Inputs: no named parameters. Returns: Active round context visible to the authenticated agent.
get_civarium_command_specARead-onlyIdempotent
Read the backend rules catalog specification for one command type, including payload JSON Schema, validators, and statically discovered emitted event types.
Inputs: command_type (required). Returns: Public specification for one registered Civarium command type.
get_civarium_contextARead-onlyIdempotent
Return the static Civarium overview as Markdown. This read-only fallback exists for MCP clients that expose tools to agents but do not surface MCP resources or server instructions. Prefer the civarium://docs/overview resource when resource reading is available.
Inputs: no named parameters. Returns: Static Civarium context document for MCP clients and agents.
get_civarium_entity_specARead-onlyIdempotent
Read the backend rules catalog specification for one entity type, including the JSON Schema for records in that entity library.
Inputs: entity_type (required). Returns: Public specification for one registered Civarium entity type.
get_civarium_event_specARead-onlyIdempotent
Read the backend rules catalog specification for one event type, including payload JSON Schema, validators, and projection modificator metadata.
Inputs: event_type (required). Returns: Public specification for one registered Civarium event type.
get_civarium_rule_catalogARead-onlyIdempotent
Return a compact JSON index of the current Civarium rules catalog from the backend: registered command, entity, and event types plus the canonical MCP resource URIs for reading the same catalog through resources.
Inputs: no named parameters. Returns: Compact index of the Civarium rule catalog exposed by the backend.
get_visible_stateARead-onlyIdempotent
Return the visible Civarium state for the authenticated agent. This is the agent's observable slice of the world; hidden or unseen state is not included. Use list_civarium_entity_types and get_civarium_entity_spec to inspect currently registered entity libraries.
Inputs: no named parameters. Returns: Visible game state for the authenticated agent.
list_civarium_command_typesARead-onlyIdempotent
List command types currently registered by the Civarium backend. Use get_civarium_command_spec for the payload schema before submit_command.
Inputs: no named parameters. Returns: Registered Civarium command types.
list_civarium_docsARead-onlyIdempotent
List the static Civarium Markdown documents available to the authenticated agent. Use this when looking for Civarium documentation through tools; resource-aware clients may also read the returned MCP resource URIs.
Inputs: no named parameters. Returns: List of static Civarium reference documents exposed by this adapter.
list_civarium_entity_typesARead-onlyIdempotent
List entity types currently registered by the Civarium backend. These are the entity library keys that visible state snapshots may contain.
Inputs: no named parameters. Returns: Registered Civarium entity types.
list_civarium_event_typesARead-onlyIdempotent
List event types currently registered by the Civarium backend. Events are backend facts projected into world state; agents cannot submit them directly.
Inputs: no named parameters. Returns: Registered Civarium event types.
list_queued_submitted_commandsARead-onlyIdempotent
List submitted command intents that the backend has validated and queued for later execution for the authenticated agent in a Civarium round. Use this after submit_command to confirm which submitted intents are queued; this does not list available command types. Invalid submissions can still have receipts but are not listed here.
Inputs: round_id (required). Returns: Valid submitted commands queued for the authenticated agent in one round.
read_civarium_docARead-onlyIdempotent
Read one static Civarium Markdown document by doc_id. This tool bridges MCP resources for clients that expose tools to agents but do not surface resource-reading operations.
Inputs: doc_id (required). Returns: Static Civarium reference document content.
submit_commandA
Submit a command intent for the authenticated agent in a round. The command is recorded for backend validation and later round execution; it is not an immediate mutation of the world. Use get_civarium_command_spec to inspect the payload schema before submitting a command type.
Inputs: payload (required), round_id (required), command_type (required), client_command_id (required). Returns: Backend receipt for a submitted command.
wait_next_roundARead-onlyIdempotent
Wait for the active round to change from after_round_id or until a bounded timeout expires. This is only polling for session progress; it never advances the Civarium session.
Inputs: after_round_id (required), timeout_seconds. Returns: Structured result for bounded next-round polling.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Most tools have clearly distinct targets: each list/get tool addresses a different registry (entity types, command types, event types, docs, queued commands). The main ambiguity is get_civarium_rule_catalog, which duplicates the individual list_* commands as a combined index, and get_civarium_context/read_civarium_doc overlap slightly for documentation access.
The pattern is mostly verb_noun with a civarium prefix, but several tools (get_active_round, get_visible_state, submit_command, wait_next_round) omit the prefix, and read_civarium_doc uses 'read' while get_civarium_context uses 'get' for similar doc access. The long list_queued_submitted_commands also breaks the concise style.
At 15 tools, the count is at the upper bound of typical well-scoped servers. Each tool serves a distinct introspection or lifecycle need, but the granularity is fine-grained—many list/get pairs could be consolidated into a single catalog tool, though the separate endpoints provide flexibility.
The tool surface covers the core loop for a round-based simulation: inspect registered types and specs, read visible state, submit commands, verify queued intents, and wait for the next round. Minor gaps include no direct history of executed commands or agent identity information, but the visible state and round polling cover the essential workflow.
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server exposing the Backtest360 engine API as tools for AI agents.
Official MCP server for Agentwork — delegate tasks to AI agents with human-in-the-loop
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
Related MCP Servers
- FlicenseAqualityDmaintenanceLightweight MCP server that exposes tools for system information and weather lookup, designed for agent integration via stdio.1-
- AlicenseAqualityDmaintenanceAn MCP server that lets LLM agents play full games of Civilization VI. It connects to a running game and provides tools for unit movement, city management, diplomacy, and more, all through the game's rule-enforcing APIs.76235MIT
- AlicenseAqualityDmaintenanceThis MCP server exposes Riven's chat, research, council, and usage capabilities as tools over stdio, enabling any MCP-compatible client to interact with Riven directly.4MIT
- AlicenseNot gradedqualityDmaintenanceA local MCP server that gives AI agents access to developer tooling — GitHub (read-only), documentation search, and web research — via stdio transport.MIT