Dwarf Fortress (DFHack) MCP Server
by alexanderolveraio.github.alexanderolvera/dfhack-mcpv1.4.1
MCP server exposing a live Dwarf Fortress fort to an AI agent as curated, semantic tools
context tax
queued
security
queued
cold start
queued
freshness
Maintained3mo ago
Install Dwarf Fortress (DFHack) MCP server
Install in Claude Code
claude mcp add dfhack -- npx -y dfhack-mcpInstall in Cursor
{
"mcpServers": {
"dfhack": {
"command": "npx",
"args": [
"-y",
"dfhack-mcp"
]
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"dfhack": {
"command": "npx",
"args": [
"-y",
"dfhack-mcp"
]
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"dfhack": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"dfhack-mcp"
]
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"dfhack": {
"command": "npx",
"args": [
"-y",
"dfhack-mcp"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| DFHACK_HOST | — | — | Host running DFHack's remote RPC server. Defaults to 127.0.0.1. |
| DFHACK_PORT | — | — | Port for DFHack's remote RPC server. Defaults to 5000. |
| DFHACK_MCP_ACTUATORS | — | — | Set to any value to expose the write tools. Unset, the server is read-only. |
Freshness
Maintained — last maintenance signal 3mo ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-07-26 · 3mo ago · GitHub
Latest release
2026-07-26 · 3mo ago · GitHub · v1.4.1
Package published
no data · npm/PyPI
Registry entry updated
2026-07-26 · 3mo ago · official registry · v1.4.1
FAQ
›How do I install the Dwarf Fortress (DFHack) MCP server in Claude Code?
Run: claude mcp add dfhack -- npx -y dfhack-mcp. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does Dwarf Fortress (DFHack) require an API key?
No required environment variables are declared in its published metadata.
›Can I use Dwarf Fortress (DFHack) as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is Dwarf Fortress (DFHack) in the official MCP registry?
Yes, as io.github.alexanderolvera/dfhack-mcp.