Skip to main content
Glama
Captain of Industry MCP

Captain of Industry MCP

by DongFengYan

Captain of Industry MCP

简体中文

A local Model Context Protocol server for Captain of Industry. It reads live production, consumption and inventory from the game's official Web API, ranks likely shortages, and calculates machine counts and upstream demand from recipe rates.

这是《Captain of Industry》的本地 MCP。可以查库存和产销并计算配比。启用配套 MOD 后,也可以向开局码头生成可由卡车提取的零件。

Requirements

  • Captain of Industry Update 4.3 (v0.8.8) or later, with an island loaded. See the official Web API release notes.

  • Node.js 22 or later and a local MCP client that supports stdio.

  • Run the MCP process on the same Windows machine as the game. Its game requests go to 127.0.0.1.

Related MCP server: steam-mcp

Install from GitHub

git clone https://github.com/DongFengYan/captain-of-industry-mcp.git
cd captain-of-industry-mcp
npm ci

Load your island. Open the in-game console with the backtick/tilde key, then enter:

web_api_start

The default API port is 3073. You can check the available routes at localhost:3073/routes. For a custom port, use e.g. web_api_start 3080 and set COI_PORT=3080 in the MCP client's server environment. The default browser-origin settings are sufficient. To stop the API, enter web_api_stop in the game console.

Configure an MCP client

Use the absolute path to src/index.js in your clone. If the client cannot find Node, use the absolute path to node.exe as the command.

Codex (MCP configuration):

[mcp_servers.captain_of_industry]
command = "node"
args = ["C:/projects/captain-of-industry-mcp/src/index.js"]

[mcp_servers.captain_of_industry.env]
COI_PORT = "3073"

Claude Desktop or another client using an mcpServers object:

{
  "mcpServers": {
    "captain_of_industry": {
      "command": "node",
      "args": ["C:/projects/captain-of-industry-mcp/src/index.js"],
      "env": { "COI_PORT": "3073" }
    }
  }
}

Reload the client configuration, then ask it to call coi_game_info to check the connection.

Tools

Tool

What it returns

coi_game_info

Game date, tick, speed and pause status.

coi_list_products

Game-localized product names and their IDs, with optional name or ID search.

coi_product_stats

Current amounts and the game's production and consumption totals.

coi_product_history

Monthly production, consumption or stock levels for selected products.

coi_product_sources

Measured flows attributed to recipes, machine types or other sources and sinks when available.

coi_find_shortages

Products consuming more than they produced over completed months, ranked by estimated stock runway.

coi_size_recipe

Whole-machine count and input demand given a monthly target, per-machine rates and an assumed utilization. Works offline.

coi_shipyard_stock

Read how many units of a product are in the original starting shipyard. Requires the companion mod.

coi_add_shipyard_stock

Add physical units of a product to that shipyard and report the resulting cargo quantity. Requires the companion mod.

Shipyard supplies

  1. Extract the CoiMcpShipyard folder from the release ZIP into %APPDATA%\Captain of Industry\Mods. It must contain the manifest and DLL.

  2. Enable Captain of Industry MCP Shipyard in the game's mod list for the island, then load the island and run web_api_start. Keep the default browser-origin settings.

  3. Ask the MCP client to add a specific amount to the starting shipyard. For example, “Add 40 Vehicle Parts I to the starting shipyard.” The tool returns the entity ID and the before and after quantities.

The tool supports storable, countable goods such as vehicle and construction parts. It uses the shipyard's truck logistics cargo buffer. Set up a destination that requests the product to have trucks move it from the shipyard. The target is the unique original starting shipyard. If it has been removed, the request fails. One call adds the requested amount on top of existing cargo. After an interrupted write, check the shipyard quantity before repeating the request.

Example prompts

  • 看过去三个完整游戏月的柴油、土豆和小麦。哪个会先耗尽?列出库存、月缺口和主要消耗来源。

  • Compare diesel production and consumption over the last three completed months. Where did last month's diesel go?

  • I need 45 more diesel per game month. Each machine makes 20 and uses 30 crude oil per game month at full speed. How many machines do I need at 75% utilization?

Interpreting results

Shortage estimates use current aggregate stock divided by the measured average monthly deficit, excluding the month in progress. They can differ from local stock available to a machine. A supply interruption can also depress recorded consumption, so a small measured deficit can coexist with unmet demand. New islands need completed months before the shortage report can estimate a trend.

Use the rates from your current recipe panel for machine sizing. The Web API reports historical flows and source summaries. The calculator accepts recipe rates as inputs. The calculated input demand assumes those rates scale linearly with utilization.

The service uses the game's localhost API. The original analysis tools work with the base game. Live tools need a running island. Recipe sizing works without a game connection.

Development

npm ci
npm test

The integration tests exercise the server over MCP stdio with a simulated game API.

To build the companion mod on Windows, set COI_ROOT to the game installation directory and run dotnet build mod/CoiMcpShipyard -c Release with the .NET SDK and .NET Framework 4.8 targeting pack. The output folder contains CoiMcpShipyard.dll and manifest.json.

Developed by OpenAI Codex. Published by DongFengYan.

Community project, independent of MaFi Games.

Available Tools

9 tools
coi_add_shipyard_stockA

Create real cargo in the starting shipyard's truck logistics buffer. Requires the CoiMcpShipyard game mod. Only call when the user wants to create the specified number of units. Check stock before retrying an uncertain write.

Inputs: amount (required), productId (required).

coi_find_shortagesA
Read-onlyIdempotent

Rank products with a recorded net deficit by estimated months until aggregate inventory runs out. Uses measured full months. Pass product IDs to focus on essentials such as fuel, food, or maintenance.

Inputs: ids, limit, months.

coi_game_infoA
Read-onlyIdempotent

Check the game connection, in-game date, speed, and pause state.

Inputs: no named parameters.

coi_list_productsA
Read-onlyIdempotent

Find product IDs by localized name or ID. Defaults to unlocked products.

Inputs: search, includeLocked.

coi_product_historyB
Read-onlyIdempotent

Read monthly history for selected products. The last sample is the month in progress.

Inputs: ids (required), months, series.

coi_product_sourcesC
Read-onlyIdempotent

Break down measured product flows by recipe, machine or other source/sink, where the game reports them.

Inputs: ids (required), period.

coi_product_statsA
Read-onlyIdempotent

Read current inventory and production/consumption totals for product IDs. Flow arrays are [thisMonth, lastMonth, thisYear, lastYear, lifetime].

Inputs: ids (required).

coi_shipyard_stockA
Read-onlyIdempotent

Read the physical stock of a countable product in the starting shipyard. Requires the CoiMcpShipyard game mod.

Inputs: productId (required).

coi_size_recipeC
Read-onlyIdempotent

Calculate machine count and upstream input demand for one recipe. Supply rates per machine per game month from the recipe panel. This tool also works offline.

Inputs: targetPerMonth (required), outputPerMachinePerMonth (required), utilization, inputsPerMachinePerMonth.

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 9 tools

    Disambiguation4/5

    Most tools target clearly different facets: discovery (list_products), scalar aggregates (product_stats), temporal series (product_history), attribution (product_sources), ranking (find_shortages), and calculation (size_recipe). The three product-read tools (stats/history/sources) all read product flow data, so an agent could occasionally misselect between them, but the descriptions do differentiate them (current totals vs. monthly arrays vs. per-recipe breakdown). The shipyard read/write pair is cleanly distinguished.

    Naming Consistency4/5

    All names share a consistent coi_ prefix and snake_case, which is highly predictable. The only deviation is the verb/noun mix: some are verb-first (list_products, find_shortages, size_recipe, add_shipyard_stock) while others are noun-first (game_info, product_stats, shipyard_stock). Readable and consistent enough, but not a uniform verb_noun pattern.

    Tool Count5/5

    With 9 tools, the surface is well-scoped for a game analytics/inspection purpose. Every tool earns its place: one discovery tool, several analysis facets, an offline calculator, and a mod-gated shipyard read/write pair. No redundant or filler tools.

    Completeness4/5

    The product-analysis lifecycle is well covered: lookup IDs, current stats, monthly history, source attribution, shortage ranking, and recipe sizing, plus game connection info. Minor gaps remain: the single write tool (coi_add_shipyard_stock) has no matching remove/clear operation and there is no recipe/machine ID discovery tool (agents must recover IDs from coi_product_sources). Those are workable but noticeable gaps.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      A
      maintenance
      An MCP server for Satisfactory that plans factories using your actual save files, reads game data, and runs LP/MILP optimization. It provides tools for game data lookup, factory planning, hard drive advice, and a local web map of your world.
      49
      7
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server for the Steam Web API, exposing your game library, playtime, achievements, friends, wishlist, and the Steam store to MCP clients over stdio.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to connect to The Farmer Was Replaced through a local BepInEx bridge, providing live game state, inventory, unlocks, save management, script read/write/run, recipe lookup, and documentation access.
      2
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables external MCP clients to read Poi fleet, ship, equipment, resource, quest, airbase, battle, action-event, and KCSAPI data through a local-only HTTP/stdio MCP interface. It also supports optional read-only resource-history and plugin integration for safe local analysis.
      1
      MIT