Skip to content
VS Code

Dwarf Fortress (DFHack) for VS Code

io.github.alexanderolvera/dfhack-mcp

MCP server exposing a live Dwarf Fortress fort to an AI agent as curated, semantic tools

client:VS Code transport:stdio runtime:npm

Install Dwarf Fortress (DFHack) in VS Code

.vscode/mcp.json

{
  "inputs": [
    {
      "type": "promptString",
      "id": "dfhack-host",
      "description": "DFHACK_HOST",
      "password": true
    },
    {
      "type": "promptString",
      "id": "dfhack-port",
      "description": "DFHACK_PORT",
      "password": true
    },
    {
      "type": "promptString",
      "id": "dfhack-mcp-actuators",
      "description": "DFHACK_MCP_ACTUATORS",
      "password": true
    }
  ],
  "servers": {
    "dfhack-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "dfhack-mcp"
      ],
      "env": {
        "DFHACK_HOST": "${input:dfhack-host}",
        "DFHACK_PORT": "${input:dfhack-port}",
        "DFHACK_MCP_ACTUATORS": "${input:dfhack-mcp-actuators}"
      }
    }
  }
}

VS Code prompts for each input the first time the server starts, so no secret is written to the file. VS Code docs

Dwarf Fortress (DFHack) in other clients