From 2328d3cae44d34939ddeedca4a40bdef00191d08 Mon Sep 17 00:00:00 2001 From: Dodothereal <129273127+Dodothereal@users.noreply.github.com> Date: Thu, 23 Jul 2026 09:56:39 +0200 Subject: [PATCH 1/4] docs: update gameData.ts header to reflect six dossier kinds; revise CHANGELOG.md to remove outdated stabilizing paragraph; amend CONTRIBUTING.md to acknowledge Docker headless mode; modify src/wiki/api.ts to read USER_AGENT from package.json; add DFHACK_MCP_QUERY_DIR to README.md configuration table --- CHANGELOG.md | 5 +---- CONTRIBUTING.md | 3 +-- README.md | 1 + src/tools/gameData.ts | 5 +++++ src/wiki/api.ts | 3 ++- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67ea583..4b661c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,7 @@ All notable changes to this project are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) -loosely while the tool surface is still evolving: **minor** releases (`1.x.0`) -may change or remove tool output, and **patch** releases (`1.0.x`) are -backwards-compatible fixes only. +and this project follows Semantic Versioning, where minor releases add functionality in a backward-compatible manner, and only major releases may break compatibility. ## [1.2.0] - 2026-07-21 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8194c05..5f57f34 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,8 +17,7 @@ don't clone it to work on the server. stripping (`node src/index.ts`); no ts-node. (`engines` in `package.json` is the looser `>=20` — that governs the _published_ bundle's runtime, not this from-source dev workflow.) -- **Windows-native by default.** DF + DFHack run on the Windows host; there is no - headless mode yet (that's [#27](https://github.com/alexanderolvera/dfhack-mcp/issues/27)). +- **Windows-native by default.** DF + DFHack run on the Windows host; headless mode is available via Docker (see [docker/README.md](docker/README.md)) ([#27](https://github.com/alexanderolvera/dfhack-mcp/issues/27)). - **Don't expose the fort.** Never enable `allow_remote` in `remote-server.json`. DFHack's RPC only accepts connections that _originate_ from `127.0.0.1`, so the server talks to `localhost:5000` by default. `DFHACK_HOST` / `DFHACK_PORT` can diff --git a/README.md b/README.md index 3e3cfee..8aaba04 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,7 @@ All optional, set in your MCP client's `env` for the server: | `DFHACK_PORT` | `5000` | Port for DFHack's Remote RPC. | | `DFHACK_MCP_ACTUATORS` | _(unset)_ | Set to `1` to expose the write actuators (off = strictly read-only). | | `DFHACK_MCP_DEV` | _(unset)_ | Set to `1` to expose `run_lua`, a raw DFHack Lua escape hatch (reads **and writes** game state; for tool authors only). | +| `DFHACK_MCP_QUERY_DIR` | _(unset)_ | Overrides the DFHack query script path for containerized environments (see [docker/README.md](docker/README.md)). | ## Troubleshooting diff --git a/src/tools/gameData.ts b/src/tools/gameData.ts index 43db38c..ef27854 100644 --- a/src/tools/gameData.ts +++ b/src/tools/gameData.ts @@ -1,3 +1,8 @@ +/** + * @fileoverview Provides access to the loaded world's raw data (ground truth) across six dossier kinds: + * creature, material, plant, reaction, item, building. + * This is the authoritative source for procedural creatures that never appear on the wiki. + */ import { runJsonScript } from '../query.ts'; import { z } from 'zod'; import type { ToolDef } from '../register.ts'; diff --git a/src/wiki/api.ts b/src/wiki/api.ts index 3aa38f1..49a9cb3 100644 --- a/src/wiki/api.ts +++ b/src/wiki/api.ts @@ -1,7 +1,8 @@ import { cleanHtml } from './clean.ts'; +import pkg from '../../package.json'; const API = 'https://dwarffortresswiki.org/api.php'; -const USER_AGENT = 'dfhack-mcp/0.1 (personal DF co-pilot)'; +const USER_AGENT = `${pkg.name}/${pkg.version} (personal DF co-pilot)`; // The wiki kept DF2014 for the Steam/Premium release — a known constant, no v50. export const VERSION_NS = 'DF2014'; const SEARCH_LIMIT = 8; From 04ba10176e98b5741b04539e6f37a87428712f72 Mon Sep 17 00:00:00 2001 From: Dodothereal <129273127+Dodothereal@users.noreply.github.com> Date: Sat, 25 Jul 2026 05:07:31 +0200 Subject: [PATCH 2/4] docs: fix README.md table for DFHACK_MCP_QUERY_DIR (add trailing pipe and correct values) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8aaba04..29de135 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ All optional, set in your MCP client's `env` for the server: | `DFHACK_PORT` | `5000` | Port for DFHack's Remote RPC. | | `DFHACK_MCP_ACTUATORS` | _(unset)_ | Set to `1` to expose the write actuators (off = strictly read-only). | | `DFHACK_MCP_DEV` | _(unset)_ | Set to `1` to expose `run_lua`, a raw DFHack Lua escape hatch (reads **and writes** game state; for tool authors only). | -| `DFHACK_MCP_QUERY_DIR` | _(unset)_ | Overrides the DFHack query script path for containerized environments (see [docker/README.md](docker/README.md)). | +| `DFHACK_MCP_QUERY_DIR` | `src/dfhack-queries/` (dev) / `dist/dfhack-queries/` (bundled) | Overrides the directory from which the MCP query scripts are loaded. | ## Troubleshooting From f941c29c40598f963af05f1f48d64239c0fdf012 Mon Sep 17 00:00:00 2001 From: Dodothereal <129273127+Dodothereal@users.noreply.github.com> Date: Mon, 26 Oct 2026 01:28:45 +0100 Subject: [PATCH 3/4] fix(wiki): give the package.json import its NodeNext JSON attribute src/wiki/api.ts imported package.json as a bare ESM import, which under module: nodenext fails typecheck with TS1543 and throws ERR_IMPORT_ATTRIBUTE_MISSING at runtime for the dev path (node src/index.ts, which T0 spawns). Use the `with { type: 'json' }` import attribute the compiler asks for. --- src/wiki/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wiki/api.ts b/src/wiki/api.ts index 49a9cb3..d094e6a 100644 --- a/src/wiki/api.ts +++ b/src/wiki/api.ts @@ -1,5 +1,5 @@ import { cleanHtml } from './clean.ts'; -import pkg from '../../package.json'; +import pkg from '../../package.json' with { type: 'json' }; const API = 'https://dwarffortresswiki.org/api.php'; const USER_AGENT = `${pkg.name}/${pkg.version} (personal DF co-pilot)`; From ff0b95a42be5e7eff3b91a344bfb7f72a027c0e7 Mon Sep 17 00:00:00 2001 From: Dodothereal <129273127+Dodothereal@users.noreply.github.com> Date: Mon, 26 Oct 2026 01:34:53 +0100 Subject: [PATCH 4/4] docs: drop unsupported version-policy and header changes --- CHANGELOG.md | 5 ++++- src/tools/gameData.ts | 5 ----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f41b97..2f73314 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,10 @@ All notable changes to this project are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), -and this project follows Semantic Versioning, where minor releases add functionality in a backward-compatible manner, and only major releases may break compatibility. +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) +loosely while the tool surface is still evolving: **minor** releases (`1.x.0`) +may change or remove tool output, and **patch** releases (`1.0.x`) are +backwards-compatible fixes only. ## [Unreleased] diff --git a/src/tools/gameData.ts b/src/tools/gameData.ts index ef27854..43db38c 100644 --- a/src/tools/gameData.ts +++ b/src/tools/gameData.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Provides access to the loaded world's raw data (ground truth) across six dossier kinds: - * creature, material, plant, reaction, item, building. - * This is the authoritative source for procedural creatures that never appear on the wiki. - */ import { runJsonScript } from '../query.ts'; import { z } from 'zod'; import type { ToolDef } from '../register.ts';