Skip to main content
Glama

prun-mcp

MCP server for Prosperous Universe game data via the FIO API.

Overview

This is a Model Context Protocol (MCP) server that provides tools for accessing Prosperous Universe game data. It uses the FIO REST API to fetch live game information.

Related MCP server: factory-resource-manager-mcp

Installation

Requires Python 3.11+ and uv.

# Clone the repository (includes submodules)
git clone --recurse-submodules <repo-url>
cd prun-mcp

# Or if already cloned without submodules:
git submodule update --init

# Install dependencies
uv sync

Note: This MCP Server uses content from fnar/prun-community-derived-mechanics as a git submodule for game mechanics formulas.

Note on toon-format

This project uses toon-python for TOON serialization (30-60% token reduction vs JSON). The library is installed directly from GitHub because the PyPI version (v0.1.0) has an unimplemented encoder. This is configured in pyproject.toml via [tool.uv.sources].

Usage

Local

uv run prun-mcp

Docker

# Build the image
docker build -t prun-mcp:latest .

# Run with STDIO transport
docker run -i prun-mcp:latest

Claude Code Configuration

Add the server (local):

claude mcp add prun-mcp -- uv run --directory /path/to/prun-mcp prun-mcp

Add the server (Docker):

claude mcp add prun-mcp -- docker run -i prun-mcp:latest

Management commands:

claude mcp list                # List configured servers
claude mcp remove prun-mcp     # Remove the server

Manual Configuration

Alternatively, add to your MCP client configuration (~/.claude.json):

{
  "mcpServers": {
    "prun-mcp": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/prun-mcp", "prun-mcp"]
    }
  }
}

Or with Docker:

{
  "mcpServers": {
    "prun-mcp": {
      "command": "docker",
      "args": ["run", "-i", "prun-mcp:latest"]
    }
  }
}

Available Tools

Category

Tools

Documentation

Materials

get_material_info, refresh_materials_cache, get_all_materials

docs/tools/materials.md

Buildings

get_building_info, refresh_buildings_cache, search_buildings

docs/tools/buildings.md

Planets

get_planet_info, search_planets

docs/tools/planets.md

Recipes

get_recipe_info, search_recipes, refresh_recipes_cache

docs/tools/recipes.md

Exchange

get_exchange_prices, get_exchange_all

docs/tools/exchange.md

Market Analysis

get_market_summary, analyze_fill_cost, get_price_history_summary, get_order_book_depth, get_price_history

docs/tools/market_analysis.md

COGM

calculate_cogm

docs/tools/cogm.md

Permit I/O

calculate_permit_io, calculate_building_cost

docs/tools/permit_io.md

Base Plans

save_base_plan, get_base_plan, list_base_plans, delete_base_plan, calculate_plan_io

docs/tools/base_plans.md

Available Resources

URI

Description

exchange://list

List all commodity exchanges with codes and names

workforce://types

List workforce types in tier order (Pioneers → Scientists)

workforce://habitation

List habitation buildings with workforce capacities

buildings://efficiency

Building efficiency formula and factors overview

buildings://efficiency/workforce

Workforce satisfaction impact on efficiency

buildings://efficiency/experts

Expert bonus system (up to ~28.4%)

buildings://efficiency/cogc

CoGC ADVERTISING program bonuses (up to 25%)

buildings://efficiency/condition

Building condition and maintenance

pct-mechanics://list

List of available game mechanics topics

pct-mechanics://arc

ARC level formula

pct-mechanics://building-degradation

Building condition and repair cost formulas

pct-mechanics://hq

HQ upgrade costs and efficiency formula

pct-mechanics://planet

Planet resource extraction formulas

pct-mechanics://population-infrastructure

Population needs, happiness, and growth

pct-mechanics://ship-blueprints

Ship construction formulas and component volumes

pct-mechanics://workforce

Workforce efficiency formulas

Configuration

Environment Variable

Description

Default

PRUN_MCP_CACHE_DIR

Directory for cache files (materials, buildings, recipes)

cache (relative to working directory)

Development

# Install dev dependencies
uv sync

# Run tests
PYTEST_DISABLE_PLUGIN_AUTOLOAD="" uv run pytest

# Lint and format
uv run ruff check .
uv run ruff format .

# Type check
uv run pyright

Project Structure

prun-mcp/
├── data/
│   └── community-mechanics/  # Git submodule: FNAR community-derived game mechanics
├── src/prun_mcp/
│   ├── __init__.py
│   ├── app.py              # FastMCP instance
│   ├── server.py           # Entry point
│   ├── fio/                # FIO API client
│   │   ├── __init__.py
│   │   ├── client.py       # HTTP client for FIO API
│   │   └── exceptions.py   # Custom exceptions
│   ├── cache/              # JSON-based caching layer (24h TTL)
│   │   ├── __init__.py
│   │   ├── materials_cache.py
│   │   ├── buildings_cache.py
│   │   ├── recipes_cache.py
│   │   └── workforce_cache.py
│   ├── models/             # Pydantic models for type safety
│   │   ├── __init__.py
│   │   ├── fio.py          # FIO API response models
│   │   └── domain.py       # Domain output models (COGM, BuildingCost, etc.)
│   ├── prun_lib/           # Business logic layer (reusable as standalone library)
│   │   ├── __init__.py     # Public API exports
│   │   ├── exceptions.py   # Unified exception classes
│   │   ├── building.py     # Building cost calculations
│   │   ├── cogm.py         # COGM (Cost of Goods Manufactured) calculations
│   │   ├── market.py       # Market analysis logic
│   │   ├── base_io.py      # Base I/O calculations
│   │   ├── exchange.py     # Exchange validation and data fetching
│   │   └── ...             # Additional business logic modules
│   ├── storage/            # Persistent storage
│   │   ├── __init__.py
│   │   ├── base_plan_storage.py  # Base plan JSON storage
│   │   └── validation.py         # Plan validation rules
│   ├── resources/          # Static reference data (MCP resources)
│   │   ├── __init__.py
│   │   ├── buildings.py    # Building efficiency documentation
│   │   ├── exchanges.py    # Exchange data resource
│   │   ├── extraction.py   # Extraction building constants
│   │   ├── mechanics.py    # Community mechanics resources
│   │   └── workforce.py    # Workforce types and habitation
│   └── tools/              # Thin MCP tool wrappers
│       ├── __init__.py
│       ├── materials.py        # Material-related tools
│       ├── buildings.py        # Building-related tools
│       ├── planets.py          # Planet-related tools
│       ├── recipes.py          # Recipe-related tools
│       ├── exchange.py         # Exchange/pricing tools
│       ├── market_analysis.py  # Market analysis tools
│       ├── cogm.py             # COGM calculation tool
│       ├── building_cost.py    # Building cost calculation tool
│       ├── permit_io.py        # Permit I/O calculation tool
│       ├── base_plans.py       # Base plan management tools
│       └── info.py             # Server info tools (version, cache status)

Architecture Note: Tools are "ultra-thin" wrappers that validate input, delegate to prun_lib for business logic, and serialize output with TOON. This separation allows prun_lib to be used as a standalone library for Prosperous Universe calculations.

License

MIT

Available Tools

28 tools
analyze_fill_costA

Calculate expected cost/proceeds for a specific quantity.

Walks the order book to account for slippage when executing a trade.

Args:
    ticker: Material ticker symbol (e.g., "RAT"). Single ticker only.
    exchange: Exchange code (e.g., "CI1").
              Valid: AI1, CI1, CI2, IC1, NC1, NC2.
    quantity: Number of units to buy or sell.
    direction: "buy" or "sell".

Returns:
    TOON-encoded fill analysis including fills breakdown, VWAP,
    slippage, and limit price recommendations.

Inputs: ticker (required), exchange (required), quantity (required), direction (required). Returns: result

calculate_building_costA

Calculate total cost to build a building on a planet.

Calculates the complete material requirements including base building
costs and infrastructure materials based on planetary environment
(surface type, pressure, gravity, temperature).

Args:
    building_ticker: Building ticker (e.g., "FP", "HB1", "FRM").
    planet: Planet identifier (name, natural ID, or planet ID).
    exchange: Optional exchange code for cost calculation (e.g., "CI1").
              Valid: AI1, CI1, CI2, IC1, NC1, NC2.

Returns:
    TOON-encoded breakdown of materials including base costs
    and infrastructure requirements based on planet environment.
    If exchange is provided, includes price and cost per material.

Inputs: planet (required), building_ticker (required), exchange. Returns: result

calculate_cogmA

Calculate Cost of Goods Manufactured for a recipe.

Args:
    recipe: Recipe name (e.g., "1xGRN 1xBEA 1xNUT=>10xRAT")
    exchange: Exchange code for pricing (e.g., "CI1").
              Valid: AI1, CI1, CI2, IC1, NC1, NC2.
    efficiency: Production efficiency multiplier (default: 1.0 = 100%)
    self_consume: If True, use produced output to satisfy workforce needs.

Returns:
    TOON-encoded COGM breakdown including cogm_per_unit, costs, and output.

Inputs: recipe (required), exchange (required), efficiency, self_consume. Returns: result

calculate_permit_ioA

Calculate daily material I/O for a base.

Args:
    production: List of production lines with recipe, count, efficiency.
    habitation: List of habitation buildings with building, count.
    exchange: Exchange code for pricing. Valid: AI1, CI1, CI2, IC1, NC1, NC2.
    permits: Number of permits for this base (default: 1).
    extraction: Optional extraction operations with building, resource, count.
    planet: Planet identifier (required if extraction is provided).

Returns:
    TOON-encoded daily I/O breakdown with materials, workforce, area.

Inputs: exchange (required), habitation (required), production (required), planet, +2 more. Returns: result

calculate_plan_ioA

Calculates daily I/O for a saved base plan.

Loads the specified plan and calculates material input/output,
workforce requirements, and daily costs using current market prices.

Args:
    name: Plan identifier.
    exchange: Exchange code for pricing (e.g., "CI1").
              Valid: AI1, CI1, CI2, IC1, NC1, NC2.

Returns:
    TOON-encoded I/O breakdown (same format as calculate_permit_io):
    - materials: List of {ticker, in, out, delta, cis_per_day}
    - workforce: Required workers by type
    - habitation: Capacity vs required validation
    - area: Used vs limit validation
    - totals: Net CIS/day

Inputs: name (required), exchange (required). Returns: result

delete_base_planB

Removes a base plan.

Args:
    name: Plan identifier.

Returns:
    Success confirmation or error if not found.

Inputs: name (required). Returns: result

get_all_materialsB

Get all materials from the cache.

Returns:
    TOON-encoded list of all materials with their properties.

Inputs: no named parameters. Returns: result

get_base_planA

Retrieves a single base plan by name.

Args:
    name: Plan identifier.

Returns:
    TOON-encoded plan data or error if not found.

Inputs: name (required). Returns: result

get_building_infoA

Get information about a building by its ticker symbol.

Args:
    ticker: Building ticker symbol(s). Can be single (e.g., "PP1")
            or comma-separated (e.g., "PP1,HB1,FRM").
            Also accepts BuildingId (32-character hex string).

Returns:
    TOON-encoded building data including name, area, expertise,
    construction costs, and workforce requirements.

Inputs: ticker (required). Returns: result

get_cache_infoB

Get cache status for all data caches.

Returns:
    TOON-encoded cache info including validity, counts, age, and file paths.

Inputs: no named parameters. Returns: result

get_exchange_allA

Get summary prices for all materials on a specific exchange.

Args:
    exchange: Exchange code(s). Can be single (e.g., "CI1")
              or comma-separated (e.g., "CI1,NC1").
              Valid: AI1, CI1, CI2, IC1, NC1, NC2.

Returns:
    TOON-encoded list of all material prices on the exchange(s).

Inputs: exchange (required). Returns: result

get_exchange_pricesA

Get current market prices with full order book for material(s).

Args:
    ticker: Material ticker symbol(s). Can be single (e.g., "RAT")
            or comma-separated (e.g., "RAT,BSE,H2O").
    exchange: Exchange code(s). Can be single (e.g., "CI1")
              or comma-separated (e.g., "CI1,NC1").
              Valid: AI1, CI1, CI2, IC1, NC1, NC2.

Returns:
    TOON-encoded price data including full order book (BuyingOrders,
    SellingOrders), bid/ask, supply/demand, and price statistics.

Inputs: ticker (required), exchange (required). Returns: result

get_market_summaryA

Get a quick market snapshot with actionable warnings.

Args:
    ticker: Material ticker symbol(s). Single (e.g., "RAT") or
            comma-separated (e.g., "RAT,COF,SF").
    exchange: Exchange code (e.g., "CI1"). Single exchange only.
              Valid: AI1, CI1, CI2, IC1, NC1, NC2.

Returns:
    Plain text market summary with bid/ask, spread, supply/demand,
    and warnings about market conditions.

Inputs: ticker (required), exchange (required). Returns: result

get_material_infoA

Get information about a material by its ticker symbol.

Args:
    ticker: Material ticker symbol(s). Can be single (e.g., "BSE")
            or comma-separated (e.g., "BSE,RAT,H2O").
            Also accepts MaterialId (32-character hex string).

Returns:
    TOON-encoded material data including name, category, weight, and volume.

Inputs: ticker (required). Returns: result

get_order_book_depthA

Get full order book in TOON tabular format.

Args:
    ticker: Material ticker symbol(s). Single (e.g., "RAT") or
            comma-separated (e.g., "RAT,COF").
    exchange: Exchange code (e.g., "CI1"). Single exchange only.
              Valid: AI1, CI1, CI2, IC1, NC1, NC2.
    side: "buy" (bids), "sell" (asks), or "both". Default: "both".
    levels: Maximum price levels per side. Capped to 10 for multi-ticker.
            Valid: 1-100. Default: 20.

Returns:
    TOON-encoded order book with aggregated levels and cumulative
    calculations for cost/proceeds analysis.

Inputs: ticker (required), exchange (required), side, levels. Returns: result

get_planet_infoA

Get information about a planet by its identifier.

Args:
    planet: Planet identifier(s). Can be single (e.g., "Katoa")
            or comma-separated (e.g., "Katoa,Montem,Promitor").
            Accepts PlanetId, PlanetNaturalId (e.g., "XK-745b"), or PlanetName.

Returns:
    TOON-encoded planet data including resources, environment, and other details.

Inputs: planet (required). Returns: result

get_price_historyA

Get historical price data in TOON tabular format.

Args:
    ticker: Material ticker symbol(s). Single (e.g., "RAT") or
            comma-separated (e.g., "RAT,COF,SF").
    exchange: Exchange code (e.g., "CI1"). Single exchange only.
              Valid: AI1, CI1, CI2, IC1, NC1, NC2.
    days: Historical lookback period in days. Valid: 1-30. Default: 7.

Returns:
    TOON-encoded time series with daily OHLCV data and summary
    statistics for trend analysis.

Inputs: ticker (required), exchange (required), days. Returns: result

get_price_history_summaryA

Compare current market conditions to historical norms.

Args:
    ticker: Material ticker symbol(s). Single (e.g., "RAT") or
            comma-separated (e.g., "RAT,COF,SF").
    exchange: Exchange code (e.g., "CI1"). Single exchange only.
              Valid: AI1, CI1, CI2, IC1, NC1, NC2.
    days: Historical lookback period in days. Valid: 1-30. Default: 7.

Returns:
    Plain text historical comparison with current vs. historical
    prices, spreads, volume, and insights.

Inputs: ticker (required), exchange (required), days. Returns: result

get_recipe_infoA

Get recipes that produce a specific material.

Args:
    ticker: Material ticker symbol(s). Can be single (e.g., "BSE")
            or comma-separated (e.g., "BSE,RAT,H2O").

Returns:
    TOON-encoded recipe data including building, inputs, outputs, and duration.

Inputs: ticker (required). Returns: result

get_versionA

Get prun-mcp server version.

Returns:
    Server version string.

Inputs: no named parameters. Returns: result

list_base_plansA

Lists all stored base plans.

Args:
    active: Filter by active status (optional).
            If None, returns all plans.
            If True, returns only active plans (real in-game bases).
            If False, returns only inactive plans (planning/reference).

Returns:
    TOON-encoded array of plan summaries containing:
    - name: Plan identifier
    - planet: Planet ID
    - planet_name: Human-readable name (if set)
    - active: Whether the plan is active
    - updated_at: Last update timestamp

Inputs: active. Returns: result

refresh_buildings_cacheA

Refresh the buildings cache from FIO API.

Forces a fresh download of all building data, bypassing the TTL.

Returns:
    Status message with the number of buildings cached.

Inputs: no named parameters. Returns: result

refresh_materials_cacheA

Refresh the materials cache from FIO API.

Forces a fresh download of all materials data, bypassing the TTL.

Returns:
    Status message with the number of materials cached.

Inputs: no named parameters. Returns: result

refresh_recipes_cacheA

Refresh the recipes cache from FIO API.

Forces a fresh download of all recipe data, bypassing the TTL.

Returns:
    Status message with the number of recipes cached.

Inputs: no named parameters. Returns: result

save_base_planA

Creates or updates a base plan.

Args:
    name: Plan identifier (unique name).
    planet: Planet ID (e.g., "KW-020c").
    habitation: Habitation buildings, each with:
               - building: Building ticker (e.g., "HB1")
               - count: Number of buildings
    production: Recipe assignments, each with:
               - recipe: Full recipe name (e.g., "1xGRN 1xALG 1xVEG=>10xRAT")
               - count: Number of buildings running this recipe
               - efficiency: Efficiency multiplier (e.g., 1.33 for 133%)
    planet_name: Human-readable planet name (optional).
    cogc_program: Active COGC program if any (optional).
    expertise: Expert counts by category using PascalCase keys (optional).
              Valid keys: Agriculture, Chemistry, Construction, Electronics,
              FoodIndustries, FuelRefining, Manufacturing, Metallurgy,
              ResourceExtraction.
    storage: Storage buildings with capacity (optional), each with:
            - building: Storage ticker (e.g., "STO")
            - count: Number of buildings
            - capacity: Storage capacity
    extraction: Resource extraction operations (optional), each with:
               - building: Extraction building ticker (EXT, RIG, COL)
               - resource: Material ticker to extract (e.g., "GAL", "FEO")
               - count: Number of buildings
               - efficiency: Efficiency multiplier (default: 1.0)
    notes: Freeform notes (optional).
    active: Whether the plan represents an active in-game base (default: False).
            Active plans represent real bases/permits; inactive plans are for
            planning or reference only.
    overwrite: Must be true to update an existing plan.

Returns:
    TOON-encoded saved plan with any validation warnings.

Inputs: name (required), planet (required), habitation (required), production (required), +8 more. Returns: result

search_buildingsA

Search buildings by construction materials, expertise, or workforce.

Args:
    commodity_tickers: Material tickers (e.g., ["BSE", "BBH"]).
                      Returns buildings that use ALL specified materials.
    expertise: Expertise type. Valid values: AGRICULTURE, CHEMISTRY,
               CONSTRUCTION, ELECTRONICS, FOOD_INDUSTRIES, FUEL_REFINING,
               MANUFACTURING, METALLURGY, RESOURCE_EXTRACTION.
    workforce: Workforce type. Valid values: Pioneers, Settlers,
               Technicians, Engineers, Scientists.

Returns:
    TOON-encoded list of matching buildings (Ticker and Name only).
    Use get_building_info for full details. All buildings if no filters.

Inputs: expertise, workforce, commodity_tickers. Returns: result

search_planetsA

Search planets by resource criteria.

Args:
    include_resources: Comma-separated material tickers that must be present
                      (e.g., "FEO,LST"). Maximum 4 materials.
    exclude_resources: Comma-separated material tickers to exclude
                      (e.g., "H2O,O"). Client-side filtering.
    limit: Maximum planets to return (default 20).
    top_resources: Number of top resources to show per planet (default 3).

Returns:
    TOON-encoded list of planets with name, id, gravity, temperature,
    fertility, and top resources by factor.

Inputs: limit, top_resources, exclude_resources, include_resources. Returns: result

search_recipesA

Search recipes by building, input materials, or output materials.

Args:
    building: Building ticker to filter by (e.g., "PP1", "FP").
    input_tickers: Input material tickers (e.g., ["GRN", "BEA"]).
                   Returns recipes that use ALL specified materials.
    output_tickers: Output material tickers (e.g., ["RAT"]).
                    Returns recipes that produce ALL specified materials.

Returns:
    TOON-encoded list of matching recipes.

Inputs: building, input_tickers, output_tickers. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 28 tools

    Disambiguation4/5

    Most tools target clearly distinct resources or actions across base plans, buildings, recipes, planets, materials, and market data. However, several market/analysis pairs overlap in surface purpose—get_exchange_prices vs get_order_book_depth, get_price_history vs get_price_history_summary, and calculate_plan_io vs calculate_permit_io—so agents must read descriptions to choose the right granularity/format.

    Naming Consistency5/5

    Tool names consistently use snake_case and start with clear action verbs such as get_, list_, search_, calculate_, refresh_, save_, and delete_. The few compound names and the calculate_cogm acronym still fit the overall pattern and remain readable.

    Tool Count3/5

    At 28 tools, the server is above the typical sweet spot and includes multiple market-analysis variants that could plausibly be consolidated. Still, it covers several substantive domains—base planning, recipes, buildings, planets, materials, and market data—so the count is heavy rather than wildly excessive.

    Completeness4/5

    Base plans have full create/read/update/delete plus IO calculation, and recipes, buildings, materials, planets, and market data have solid lookup/search coverage. Minor gaps exist, such as no broader planet environment search or production-chain solver, but the core workflows are covered.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to search EVE Online items, validate ship fits against fitting limits, compute combat stats like DPS and EHP, and retrieve Jita market prices.
      4
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Exposes nine purpose-built tools for EVE: Frontier on Sui Move, covering Smart Assembly contract coding, Smart Gate route and toll planning, Network Node gigajoule optimization, Smart Turret targeting, killmail threat intel, SSU market making, zkLogin character verification, sovereignty fuel tracking, and PTB drain simulation.
      14
      1
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables MCP clients to answer Star Citizen crafting, mining and trading questions from public game data: product recipes with quality effects, mining locations, scan signatures and refinery yields, plus terminal prices and UEX player marketplace listings. It is read-only and requires no account.
      14
      MIT