dwelldelta-mcp 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Xcelerent Pty Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ The data files in vendor/ (rents-index.json, indicators.json) are not covered by
24
+ this licence. Each figure keeps its source's own licence and attribution, which
25
+ the data files and every answer state (for example, ABS data: CC BY 4.0, "Based
26
+ on Australian Bureau of Statistics data").
package/README.md CHANGED
@@ -1,55 +1,65 @@
1
- # DwellDelta MCP server - Australian property data for AI agents
1
+ # dwelldelta-mcp - is an Australian rent fair?
2
2
 
3
- **Built 2026-09-26, not published.** Design and reasoning: dwelldelta-control
4
- `project_team/advisory/2026-09-26-dwelldelta-mcp-design.md`.
3
+ An MCP server that lets an AI assistant check a weekly rent against the ABS rents index, and quote sourced
4
+ Australian property and lending indicators. From [DwellDelta](https://dwelldelta.com.au/), a service of
5
+ Xcelerent Pty Ltd, built on public data.
5
6
 
6
- Three read-only tools for any AI assistant that speaks MCP:
7
+ Three read-only tools:
7
8
 
8
9
  | Tool | What it answers |
9
10
  |---|---|
10
- | `rent_check` | a weekly rent, and any proposed new rent, against the ABS rents index for the capital city since the lease began (the rent check's own arithmetic) |
11
+ | `rent_check` | a weekly rent, and any proposed new rent, against the ABS rents index for the capital city since the lease began (the same arithmetic as the rent check at tools.dwelldelta.com.au) |
11
12
  | `market_indicators` | the latest RBA cash rate, unemployment, wage growth, rents for all eight capitals, NSW lending, lending standards and arrears, approvals and completions - each with period, source, licence and limits; filter by `geography` |
12
13
  | `data_sources` | the sources, their licences, and what DwellDelta cannot answer |
13
14
 
14
- It runs on the user's own machine over stdio, sends nothing anywhere and records nothing. Figures come from
15
- `dwelldelta-data/market/indicators.json`, which the Monday job writes (`dwelldelta-local/tools/build_indicators.py`);
16
- set `DWELLDELTA_INDICATORS` to use another file.
15
+ It runs on your own machine over stdio and records nothing. At start it fetches the week's indicators from
16
+ tools.dwelldelta.com.au - one request for one public file; nothing about you or your questions is sent - and
17
+ otherwise uses the copy it ships with. Set `DWELLDELTA_OFFLINE=1` and it makes no request at all. Nothing it says is
18
+ a forecast, a valuation or advice.
17
19
 
18
- ## Try it in Claude Desktop (owner's machine only, until it is published)
20
+ ## Use it
19
21
 
20
- Add to `%APPDATA%\Claude\claude_desktop_config.json`:
22
+ Claude Desktop - add to `claude_desktop_config.json`:
21
23
 
22
24
  ```json
23
25
  {
24
26
  "mcpServers": {
25
27
  "dwelldelta": {
26
- "command": "node",
27
- "args": ["D:\\local-repo\\personal\\dwelldelta-tools\\mcp\\server.mjs"]
28
+ "command": "npx",
29
+ "args": ["-y", "dwelldelta-mcp"]
28
30
  }
29
31
  }
30
32
  }
31
33
  ```
32
34
 
33
- Restart Claude Desktop, then ask: "What is NSW unemployment doing?" or "Is a rise from $700 to $770 a week in
34
- Sydney since July 2025 in line with rents?"
35
+ Claude Code: `claude mcp add dwelldelta -- npx -y dwelldelta-mcp`. Any other MCP client: run `npx -y dwelldelta-mcp`
36
+ as a stdio server. Node 18 or later.
35
37
 
36
- ## What an agent gets back (0.2.0)
38
+ Then ask: "Is a rise from $700 to $770 a week in Sydney since July 2025 in line with rents?" or "What is NSW
39
+ unemployment doing?"
40
+
41
+ It is listed in the MCP registry as `au.com.dwelldelta/dwelldelta`.
42
+
43
+ ## What an agent gets back
37
44
 
38
45
  Every call returns text to quote and a structured result: the figures, plus `sources` (each with its licence and
39
- attribution), `data_as_of`, `snapshot_built`, `server_version`, `retrieved_at`, and `stale` / `stale_reason` when the
40
- indicators snapshot is more than 10 days old (it is rebuilt each Monday; a stale answer also says so in words).
46
+ attribution), `data_as_of`, `snapshot_built`, `snapshot_origin` (`published` for this week's file from
47
+ tools.dwelldelta.com.au, `bundled` for the copy in the package), `server_version`, `retrieved_at`, and `stale` /
48
+ `stale_reason`.
41
49
  Every failure is marked `isError` and ends with `Next step:` - an unknown city or geography names the valid ones.
42
- If the snapshot is missing the server still starts: `rent_check` works and the other two say what is missing.
43
50
 
44
- ## Tests
51
+ The indicators are a weekly snapshot, rebuilt every Monday and published at
52
+ https://tools.dwelldelta.com.au/market/indicators.json. The server uses that file when it is newer than the copy it
53
+ ships with, and the bundled copy when offline. Once a snapshot is more than 10 days old every answer says so, in
54
+ words and in the structured result, rather than passing an old figure off as current. Set `DWELLDELTA_INDICATORS`
55
+ to read another snapshot file.
56
+
57
+ ## Licence
45
58
 
46
- `npm test` here: starts the server and calls all three tools over MCP. The repository's root `npm test` holds
47
- the tool answers themselves (`tests/mcp-tools.test.mjs`).
59
+ The code is MIT (see LICENSE). The data is not: each figure keeps its source's licence and attribution, which every
60
+ answer states - for example ABS data is CC BY 4.0, "Based on Australian Bureau of Statistics data".
48
61
 
49
- ## Before publishing
62
+ ## Development
50
63
 
51
- Publication is the owner's call (npm, the MCP registry). It would also need `indicators.json` served publicly
52
- from tools.dwelldelta.com.au instead of read from this machine. Publish under the domain namespace `au.com.dwelldelta/...` (a DNS TXT
53
- record proves it), not `io.github...`: `io.dwelldata/real-estate-data` ("DwellData", US) is already in the registry
54
- and the names are close. Steps and the competitors already listed (io.ausdata, au.com.microburbs): control advisory
55
- 2026-09-28-github-research-what-to-borrow.md.
64
+ `npm test` here starts the server and calls all three tools over MCP; the repository's root `npm test` holds the
65
+ tool answers themselves and checks that `vendor/` matches its sources. `npm pack` runs `scripts/vendor.mjs` first.
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "dwelldelta-mcp",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Is an Australian rent fair? A rent check on the ABS rents index, plus sourced property and lending indicators, for AI agents.",
5
5
  "mcpName": "au.com.dwelldelta/dwelldelta",
6
- "license": "UNLICENSED",
6
+ "license": "MIT",
7
7
  "homepage": "https://dwelldelta.com.au/",
8
8
  "author": "DwellDelta, a service of Xcelerent Pty Ltd",
9
9
  "type": "module",
@@ -17,6 +17,7 @@
17
17
  "server.mjs",
18
18
  "tools.mjs",
19
19
  "vendor/",
20
+ "LICENSE",
20
21
  "README.md"
21
22
  ],
22
23
  "scripts": {
package/server.mjs CHANGED
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env node
2
- // DwellDelta MCP server: Australian property market data for AI agents. Runs on the user's machine over stdio;
3
- // sends nothing anywhere and records nothing. Three read-only tools; the logic lives in tools.mjs.
2
+ // DwellDelta MCP server: Australian property market data for AI agents. Runs on the user's machine over stdio and
3
+ // records nothing. From 0.4.0 it fetches the week's indicators once at start from tools.dwelldelta.com.au - one
4
+ // public file; nothing about the user or their questions is sent - and falls back to its bundled copy
5
+ // (DWELLDELTA_OFFLINE=1 never fetches). Three read-only tools; the logic lives in tools.mjs.
4
6
  //
5
7
  // Every result carries text to quote and a structured result (the figures plus where they come from, under which
6
8
  // licence, how current, and whether stale). Every failure is isError with the next step to take, so an agent
@@ -10,12 +12,13 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
10
12
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
11
13
  import { z } from "zod";
12
14
  import {
13
- rentCheckResult, marketIndicatorsResult, dataSourcesResult, loadJson, ToolError,
15
+ rentCheckResult, marketIndicatorsResult, dataSourcesResult, loadJson, loadSnapshot, ToolError,
14
16
  RENTS_PATH, INDICATORS_PATH, SERVER_VERSION,
15
17
  } from "./tools.mjs";
16
18
 
17
19
  const rents = await loadJson(RENTS_PATH);
18
- const snapshot = await loadJson(INDICATORS_PATH).catch(() => null);
20
+ const loaded = await loadSnapshot();
21
+ const snapshot = loaded.snapshot ? { ...loaded.snapshot, origin: loaded.origin } : null;
19
22
  const readOnly = { readOnlyHint: true, idempotentHint: true, openWorldHint: false, destructiveHint: false };
20
23
 
21
24
  const ok = ({ text, structured }) => ({ content: [{ type: "text", text }], structuredContent: structured });
package/tools.mjs CHANGED
@@ -25,11 +25,44 @@ export const RENTS_PATH = join(HERE, "vendor", "rents-index.json");
25
25
  // owner's machine (rebuilt every Monday), else the copy bundled at pack time - which the stale flag then marks
26
26
  // as old once it is more than STALE_DAYS past its build date.
27
27
  const LIVE = join(HERE, "..", "..", "dwelldelta-data", "market", "indicators.json");
28
+ export const BUNDLED_PATH = join(HERE, "vendor", "indicators.json");
28
29
  export const INDICATORS_PATH = process.env.DWELLDELTA_INDICATORS
29
- ?? (existsSync(LIVE) ? LIVE : join(HERE, "vendor", "indicators.json"));
30
+ ?? (existsSync(LIVE) ? LIVE : BUNDLED_PATH);
31
+ // 0.4.0: the snapshot is also published every Monday (dwelldelta-local tools/sync_indicators.py). At start the server
32
+ // fetches it once - a plain request for one public file; nothing about the user or their questions is sent - and
33
+ // uses it only if it is well formed and newer than the copy it ships with. DWELLDELTA_OFFLINE=1 never fetches.
34
+ export const PUBLISHED_URL = "https://tools.dwelldelta.com.au/market/indicators.json";
35
+ export const FETCH_TIMEOUT_MS = 5000;
36
+
37
+ const wellFormed = (s) => s && typeof s.built === "string" && /^\d{4}-\d{2}-\d{2}$/.test(s.built)
38
+ && Array.isArray(s.indicators) && s.indicators.length > 0 && Array.isArray(s.sources)
39
+ && s.indicators.every((i) => i.source && i.licence && i.period);
40
+
41
+ /**
42
+ * The snapshot and where it came from: "env" (DWELLDELTA_INDICATORS), "live" (the owner's machine), "published"
43
+ * (this week's file from tools.dwelldelta.com.au) or "bundled" (the copy shipped in the package). Never throws for
44
+ * a failed fetch; returns { snapshot: null } only when no copy can be read at all.
45
+ */
46
+ export async function loadSnapshot({ env = process.env, fetchImpl = globalThis.fetch, live = LIVE,
47
+ bundled = BUNDLED_PATH } = {}) {
48
+ const read = (path) => loadJson(path).catch(() => null);
49
+ if (env.DWELLDELTA_INDICATORS) return { snapshot: await read(env.DWELLDELTA_INDICATORS), origin: "env" };
50
+ if (existsSync(live)) return { snapshot: await read(live), origin: "live" };
51
+ const shipped = await read(bundled);
52
+ if (env.DWELLDELTA_OFFLINE !== "1" && typeof fetchImpl === "function") {
53
+ try {
54
+ const res = await fetchImpl(PUBLISHED_URL, { signal: AbortSignal.timeout(FETCH_TIMEOUT_MS) });
55
+ const got = res.ok ? await res.json() : null;
56
+ if (wellFormed(got) && (!shipped || got.built >= shipped.built)) return { snapshot: got, origin: "published" };
57
+ } catch {
58
+ // Offline, blocked or slow: the bundled copy answers, and the stale flag says how old it is.
59
+ }
60
+ }
61
+ return { snapshot: shipped, origin: shipped ? "bundled" : null };
62
+ }
30
63
 
31
64
  export const FOOTER = "Information, not advice. From DwellDelta (dwelldelta.com.au), built on public data.";
32
- export const SERVER_VERSION = "0.3.0";
65
+ export const SERVER_VERSION = "0.4.0";
33
66
  // The indicators snapshot is rebuilt every Monday. Older than this and the answer says so, in words and in the
34
67
  // structured result, rather than serving a stale figure as current.
35
68
  export const STALE_DAYS = 10;
@@ -50,7 +83,7 @@ export class ToolError extends Error {
50
83
  * The provenance that travels WITH every answer, as structured data an agent can carry into its own output.
51
84
  * "The attribution must travel with the data" - the principle, from abs-mcp's DataResponse.
52
85
  */
53
- export function envelope({ sources, dataAsOf, built = null }, now = new Date()) {
86
+ export function envelope({ sources, dataAsOf, built = null, origin = null }, now = new Date()) {
54
87
  const age = built ? Math.floor((now - new Date(built + "T00:00:00Z")) / 86400000) : null;
55
88
  const stale = age !== null && age > STALE_DAYS;
56
89
  return {
@@ -59,6 +92,7 @@ export function envelope({ sources, dataAsOf, built = null }, now = new Date())
59
92
  retrieved_at: now.toISOString(),
60
93
  data_as_of: dataAsOf,
61
94
  snapshot_built: built,
95
+ snapshot_origin: origin,
62
96
  stale,
63
97
  stale_reason: stale ? `the indicators snapshot was built ${built}, ${age} days ago; it is rebuilt weekly` : null,
64
98
  sources: sources.map((s) => ({ source: s.source, licence: s.licence, attribution: s.attribution ?? null })),
@@ -122,7 +156,7 @@ export function marketIndicatorsResult({ geography } = {}, snapshot, now = new D
122
156
  `Call market_indicators again with one of: ${GEOGRAPHIES(snapshot).join(", ")}; or with no geography for all.`);
123
157
  }
124
158
  const env = envelope({ sources: snapshot.sources, dataAsOf: items.map((i) => i.period).sort().at(-1),
125
- built: snapshot.built }, now);
159
+ built: snapshot.built, origin: snapshot.origin ?? null }, now);
126
160
  const text = [
127
161
  ...staleNote(env),
128
162
  `Australian property market indicators (snapshot built ${snapshot.built}). Each is the latest observed figure;`,
@@ -141,7 +175,8 @@ export function dataSources(snapshot) {
141
175
  }
142
176
 
143
177
  export function dataSourcesResult(snapshot, now = new Date()) {
144
- const env = envelope({ sources: snapshot.sources, dataAsOf: null, built: snapshot.built }, now);
178
+ const env = envelope({ sources: snapshot.sources, dataAsOf: null, built: snapshot.built,
179
+ origin: snapshot.origin ?? null }, now);
145
180
  const text = [
146
181
  ...staleNote(env),
147
182
  `Publisher: ${snapshot.publisher}.`,