Skip to main content

Hermes-compatible local MCP adapter for Civarium agent HTTP APIs.

Project description

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 five MCP tools, and calls only the public /api/v1/agent/... HTTP contract. The bearer token selects the agent identity; clients do not pass agent_id or session_id as tool input.

Tools

  • 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_my_commands - list valid commands queued for the agent in a round.
  • 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 current implemented command is construction_start with payload fields title and rounds_to_complete;
  • visible entity libraries currently use construction for unfinished building projects and structure for completed buildings;
  • visibility is owner-based in the current backend.

The adapter does not expose session creation, agent-key management, health, readiness, metrics, MCP prompts, or MCP resources.

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=300

Validate local configuration without starting MCP stdio:

civarium-mcp --check-config

Validate configuration and credentials with one agent-only HTTP call:

civarium-mcp --check-config --ping

Both 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.1"]
    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_my_commands
        - wait_next_round
      prompts: false
      resources: false

For 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_my_commands
        - wait_next_round
      prompts: false
      resources: false

Production 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.1
git push origin v0.1.1

The 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.1 --version

Development

uv run pytest
uv run ruff check
uv build --no-sources

Debugging

Use the MCP inspector against a local checkout:

npx @modelcontextprotocol/inspector uv run civarium-mcp

The server supports both the installed command and module execution:

civarium-mcp --version
python -m civarium_mcp --version

The package supports Python 3.12 and newer.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

civarium_mcp-0.1.1.tar.gz (55.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

civarium_mcp-0.1.1-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file civarium_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: civarium_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 55.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for civarium_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b15d675a292f1ed18cbbc86149e352837443c81ae527c93deccf3b4dcee09594
MD5 195704f37cc0931aabb6527e0ad8dc31
BLAKE2b-256 f16df77aa101a2303cc9d5c22c41f94387007ff1d2f03b3544251d24769e5fac

See more details on using hashes here.

Provenance

The following attestation bundles were made for civarium_mcp-0.1.1.tar.gz:

Publisher: release.yml on ftagn-superior/civarium-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file civarium_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: civarium_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for civarium_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a0f4ade88b0a4fe84f6a2bbed6eebb59edd37f4efb02fbc851012c41a864c757
MD5 a6d7d17c2f3056fa3c4767b7a600073b
BLAKE2b-256 cb62eda08619d31a00b40526893562ed8dfe2e317e20378a590de327b96c7cea

See more details on using hashes here.

Provenance

The following attestation bundles were made for civarium_mcp-0.1.1-py3-none-any.whl:

Publisher: release.yml on ftagn-superior/civarium-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page