@urbankitstudio/mcp-atlas 0.2.27 → 0.3.1
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/README.md +63 -4
- package/dist/city-datasets.d.ts +51 -0
- package/dist/city-datasets.js +202 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +38 -1
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://glama.ai/mcp/servers/LEOyrh/mcp-atlas)
|
|
6
6
|
|
|
7
|
-
Query the parcel ArcGIS REST endpoints of
|
|
7
|
+
Query the parcel ArcGIS REST endpoints of 314 counties across 51 US states (50 states plus DC), 331 endpoints total, for owner, APN and address lookup via the Model Context Protocol (MCP).
|
|
8
8
|
|
|
9
9
|
An [MCP](https://modelcontextprotocol.io) server that gives AI assistants direct access to UrbanKit Studio's atlas of manually verified county parcel GIS services. Ask Claude or Cursor to find the ArcGIS REST endpoint for any covered county, get the exact owner-search query URL, and look up parcel data — without needing to know anything about ArcGIS REST API conventions.
|
|
10
10
|
|
|
11
|
-
**Coverage:**
|
|
11
|
+
**Coverage:** 314 counties across 51 US states (50 states plus DC), 331 endpoints, 330 of them live (atlas 0.6.32).
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -56,8 +56,9 @@ Then use `mcp-atlas` as the command instead of `npx -y @urbankitstudio/mcp-atlas
|
|
|
56
56
|
|
|
57
57
|
## Tools
|
|
58
58
|
|
|
59
|
-
The four tools are one pipeline, and what separates them is how
|
|
60
|
-
can already name the county
|
|
59
|
+
The first four tools are one county pipeline, and what separates them is how
|
|
60
|
+
precisely you can already name the county. The fifth, `get_city_datasets`, is
|
|
61
|
+
separate: it answers about a city, not a county.
|
|
61
62
|
|
|
62
63
|
| You have | Use | You get |
|
|
63
64
|
|---|---|---|
|
|
@@ -65,6 +66,7 @@ can already name the county:
|
|
|
65
66
|
| A vague, misspelled or FIPS reference | `find_county` | Every county that reference matches, named, each with its record |
|
|
66
67
|
| An exact state and county | `get_parcel_endpoint` | That one county's endpoint URL, layer, fields and sample query |
|
|
67
68
|
| A county and an owner's name | `build_owner_query` | A runnable URL that searches for that name |
|
|
69
|
+
| A city, and optionally a street | `get_city_datasets` | That city's code-violation, building-permit and zoning-case datasets, each with a runnable query URL |
|
|
68
70
|
|
|
69
71
|
`find_county` and `get_parcel_endpoint` return the same per-county record. They
|
|
70
72
|
differ in how you address the county: `find_county` accepts an uncertain
|
|
@@ -182,6 +184,63 @@ https://gistech.countyofkane.org/arcgis/rest/services/KanePINList/MapServer/0/qu
|
|
|
182
184
|
|
|
183
185
|
---
|
|
184
186
|
|
|
187
|
+
### `get_city_datasets`
|
|
188
|
+
|
|
189
|
+
City code-violation, building-permit and zoning-case datasets. Give a city
|
|
190
|
+
slug (`fort-worth`) or name (`Fort Worth`, `Fort Worth, TX`), optionally a
|
|
191
|
+
`kind` and a street line, and it returns each verified dataset for that city:
|
|
192
|
+
the endpoint and provider (Socrata, ArcGIS, CKAN or CARTO), the column the
|
|
193
|
+
address is matched on, the date field, any filter that is part of the dataset's
|
|
194
|
+
definition, coverage and freshness notes, and, when you pass a street, a ready
|
|
195
|
+
`query_url` to run against the city's own server. Omit `city` to list every
|
|
196
|
+
covered city.
|
|
197
|
+
|
|
198
|
+
| Parameter | Type | Required | Description |
|
|
199
|
+
|-----------|------|----------|-------------|
|
|
200
|
+
| `city` | string (max 80) | No | City slug or name; omit to list covered cities |
|
|
201
|
+
| `state` | string (max 40) | No | Two-letter code or state name, for a name used in two states |
|
|
202
|
+
| `kind` | `violations` \| `permits` \| `zoning` | No | Return only that kind of dataset |
|
|
203
|
+
| `street` | string (max 120) | No | Street line only, such as `Commerce` or `600 Commerce St`. Cut at the first comma, so a full address is safe to pass |
|
|
204
|
+
|
|
205
|
+
- A name shared by two cities comes back as `found: false, ambiguous: true` with
|
|
206
|
+
the candidates; repeat with `state`. A city outside the registry comes back as
|
|
207
|
+
`found: false` with the covered cities in its state, or in its county when the
|
|
208
|
+
reference names one.
|
|
209
|
+
- `query_url` is `null` for a point lookup (a polygon docket or a current-zoning
|
|
210
|
+
map); the dataset's `query_template` then carries the request with a
|
|
211
|
+
`{LON},{LAT}` placeholder to fill in.
|
|
212
|
+
- Scope is the city's limits, not the county. These tables hold no owner data:
|
|
213
|
+
for a parcel's owner, use the county tools above.
|
|
214
|
+
- Like the county tools, this one fetches nothing. It answers from the atlas
|
|
215
|
+
package and hands you URLs to run yourself. Socrata throttles anonymous
|
|
216
|
+
callers, so send your own `X-App-Token` header for volume.
|
|
217
|
+
- It is the same tool the hosted UrbanKit MCP serves, with the same advertised
|
|
218
|
+
inputs and response keys. The stdio server holds arguments to that schema
|
|
219
|
+
strictly: `kind` must be `violations`, `permits` or `zoning` in lower case.
|
|
220
|
+
|
|
221
|
+
**Example prompt:** "Where do I pull open building permits for 600 Commerce St, Dallas?"
|
|
222
|
+
|
|
223
|
+
**Example output (abridged):**
|
|
224
|
+
```json
|
|
225
|
+
{
|
|
226
|
+
"found": true,
|
|
227
|
+
"city": { "slug": "dallas", "name": "Dallas", "state_abbrev": "TX", "county_slug": "dallas-county" },
|
|
228
|
+
"street": "600 Commerce St",
|
|
229
|
+
"datasets": [
|
|
230
|
+
{
|
|
231
|
+
"kind": "permits",
|
|
232
|
+
"provider": "socrata",
|
|
233
|
+
"endpoint": "https://www.dallasopendata.com/resource/e7gq-4sah.json",
|
|
234
|
+
"address_field": "street_address",
|
|
235
|
+
"street_used": "600 Commerce St",
|
|
236
|
+
"query_url": "https://www.dallasopendata.com/resource/e7gq-4sah.json?$where=upper(street_address)%20like%20upper('%25600%20Commerce%20St%25')&$limit=30"
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
185
244
|
## Example conversation
|
|
186
245
|
|
|
187
246
|
> **User:** I'm doing due diligence on properties in Kane County, Illinois. Can you find all parcels owned by "Blackstone"?
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* get_city_datasets: the code-violation, building-permit and zoning-case
|
|
3
|
+
* datasets UrbanKit has verified for a city, and how to query them by street.
|
|
4
|
+
*
|
|
5
|
+
* Pure and synchronous, and importable without starting the stdio transport, so
|
|
6
|
+
* test/city-datasets.test.mjs drives it directly (search-policy.ts is the same
|
|
7
|
+
* shape). It reads ONLY @urbankitstudio/atlas exports (listCities, findCity,
|
|
8
|
+
* getCityProperty, getCityZoning, cityDatasets, streetForDataset,
|
|
9
|
+
* buildCityQuery, cityPath, slugify) and never fetches: the registry ships
|
|
10
|
+
* inside the package, so there is no "registry temporarily unavailable" case
|
|
11
|
+
* here, and every URL it returns is a string for the caller to run.
|
|
12
|
+
*
|
|
13
|
+
* It mirrors the hosted MCP tool of the same name (urbankitstudio api/mcp.ts,
|
|
14
|
+
* case "get_city_datasets"): same input caps, same enum, same street handling
|
|
15
|
+
* (cut at the first comma, then trim), and the same snake_case wire keys for the
|
|
16
|
+
* list, found, ambiguous and not-found answers. The deliberate differences:
|
|
17
|
+
* - the hosted metering sentence is gone (this server has no tiers or keys),
|
|
18
|
+
* - the not-found message points at find_county, the stdio tool, instead of
|
|
19
|
+
* the hosted find_parcel_by_address.
|
|
20
|
+
*/
|
|
21
|
+
import { CITY_STREET_MAX_LEN } from "@urbankitstudio/atlas";
|
|
22
|
+
import type { CityKind, CitySummary } from "@urbankitstudio/atlas";
|
|
23
|
+
export declare const CITY_REF_MAX_LEN = 80;
|
|
24
|
+
export declare const CITY_STATE_MAX_LEN = 40;
|
|
25
|
+
export { CITY_STREET_MAX_LEN };
|
|
26
|
+
export declare const CITY_KINDS: readonly CityKind[];
|
|
27
|
+
export declare const CITY_BASE_URL = "https://urbankitstudio.com";
|
|
28
|
+
/**
|
|
29
|
+
* Appended to a dataset's query_note only when streetForDataset (the package's
|
|
30
|
+
* split-address rule) changed the typed street: the table keeps the house number
|
|
31
|
+
* in its own column with no streetNumber mapping, so the name alone is matched.
|
|
32
|
+
* Same wording as the hosted tool.
|
|
33
|
+
*/
|
|
34
|
+
export declare const SPLIT_ADDRESS_UNMAPPED_NOTE = "This dataset stores the house number in a separate column that is not yet mapped; the query matches the street name only.";
|
|
35
|
+
export interface CityDatasetsArgs {
|
|
36
|
+
city?: string | null;
|
|
37
|
+
state?: string | null;
|
|
38
|
+
kind?: string | null;
|
|
39
|
+
street?: string | null;
|
|
40
|
+
}
|
|
41
|
+
export interface CityDatasetsResult {
|
|
42
|
+
isError: boolean;
|
|
43
|
+
/** An error message, or the answer as indented JSON (the hosted tool's encoding). */
|
|
44
|
+
text: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* `resolve` is a test seam only: the registry carries no ambiguous city name
|
|
48
|
+
* today (Columbus is one city), so the ambiguous branch is exercised by handing
|
|
49
|
+
* in a finder over a fixture list. The server never passes it.
|
|
50
|
+
*/
|
|
51
|
+
export declare function getCityDatasets(args: CityDatasetsArgs, resolve?: (ref: string, state?: string) => CitySummary[]): CityDatasetsResult;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* get_city_datasets: the code-violation, building-permit and zoning-case
|
|
3
|
+
* datasets UrbanKit has verified for a city, and how to query them by street.
|
|
4
|
+
*
|
|
5
|
+
* Pure and synchronous, and importable without starting the stdio transport, so
|
|
6
|
+
* test/city-datasets.test.mjs drives it directly (search-policy.ts is the same
|
|
7
|
+
* shape). It reads ONLY @urbankitstudio/atlas exports (listCities, findCity,
|
|
8
|
+
* getCityProperty, getCityZoning, cityDatasets, streetForDataset,
|
|
9
|
+
* buildCityQuery, cityPath, slugify) and never fetches: the registry ships
|
|
10
|
+
* inside the package, so there is no "registry temporarily unavailable" case
|
|
11
|
+
* here, and every URL it returns is a string for the caller to run.
|
|
12
|
+
*
|
|
13
|
+
* It mirrors the hosted MCP tool of the same name (urbankitstudio api/mcp.ts,
|
|
14
|
+
* case "get_city_datasets"): same input caps, same enum, same street handling
|
|
15
|
+
* (cut at the first comma, then trim), and the same snake_case wire keys for the
|
|
16
|
+
* list, found, ambiguous and not-found answers. The deliberate differences:
|
|
17
|
+
* - the hosted metering sentence is gone (this server has no tiers or keys),
|
|
18
|
+
* - the not-found message points at find_county, the stdio tool, instead of
|
|
19
|
+
* the hosted find_parcel_by_address.
|
|
20
|
+
*/
|
|
21
|
+
import { CITY_STREET_MAX_LEN, buildCityQuery, cityPath, getCityProperty, getCityZoning, listCities, findCity, cityDatasets, slugify, streetForDataset, } from "@urbankitstudio/atlas";
|
|
22
|
+
export const CITY_REF_MAX_LEN = 80;
|
|
23
|
+
export const CITY_STATE_MAX_LEN = 40;
|
|
24
|
+
export { CITY_STREET_MAX_LEN };
|
|
25
|
+
export const CITY_KINDS = ["violations", "permits", "zoning"];
|
|
26
|
+
export const CITY_BASE_URL = "https://urbankitstudio.com";
|
|
27
|
+
/**
|
|
28
|
+
* Appended to a dataset's query_note only when streetForDataset (the package's
|
|
29
|
+
* split-address rule) changed the typed street: the table keeps the house number
|
|
30
|
+
* in its own column with no streetNumber mapping, so the name alone is matched.
|
|
31
|
+
* Same wording as the hosted tool.
|
|
32
|
+
*/
|
|
33
|
+
export const SPLIT_ADDRESS_UNMAPPED_NOTE = "This dataset stores the house number in a separate column that is not yet mapped; the query matches the street name only.";
|
|
34
|
+
const ok = (answer) => ({
|
|
35
|
+
isError: false,
|
|
36
|
+
text: JSON.stringify(answer, null, 2),
|
|
37
|
+
});
|
|
38
|
+
const fail = (message) => ({ isError: true, text: message });
|
|
39
|
+
/** encodeURIComponent throws on a lone surrogate, which valid JSON can carry. */
|
|
40
|
+
function isWellFormedText(s) {
|
|
41
|
+
try {
|
|
42
|
+
encodeURIComponent(s);
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function citySummaryOut(c) {
|
|
50
|
+
return {
|
|
51
|
+
slug: c.slug,
|
|
52
|
+
city: c.city,
|
|
53
|
+
state_abbrev: c.stateAbbrev,
|
|
54
|
+
county_slug: c.countySlug ?? null,
|
|
55
|
+
kinds: c.kinds,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/** camelCase -> snake_case on one level of keys. */
|
|
59
|
+
function snakeKeys(o) {
|
|
60
|
+
return Object.fromEntries(Object.entries(o).map(([k, v]) => [k.replace(/[A-Z]/g, (m) => `_${m.toLowerCase()}`), v]));
|
|
61
|
+
}
|
|
62
|
+
const sourceOut = (s) => ({
|
|
63
|
+
name: s.name,
|
|
64
|
+
url: s.url,
|
|
65
|
+
license: s.license ?? null,
|
|
66
|
+
portal_label: s.portalLabel ?? null,
|
|
67
|
+
current_records_note: s.currentRecordsNote ?? null,
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* `resolve` is a test seam only: the registry carries no ambiguous city name
|
|
71
|
+
* today (Columbus is one city), so the ambiguous branch is exercised by handing
|
|
72
|
+
* in a finder over a fixture list. The server never passes it.
|
|
73
|
+
*/
|
|
74
|
+
export function getCityDatasets(args, resolve = findCity) {
|
|
75
|
+
const cityRef = String(args.city ?? "").trim();
|
|
76
|
+
const stateRef = String(args.state ?? "").trim();
|
|
77
|
+
const kindRaw = args.kind === undefined || args.kind === null ? "" : String(args.kind).trim().toLowerCase();
|
|
78
|
+
const streetRaw = String(args.street ?? "").trim();
|
|
79
|
+
if (cityRef.length > CITY_REF_MAX_LEN)
|
|
80
|
+
return fail(`city must be at most ${CITY_REF_MAX_LEN} characters`);
|
|
81
|
+
if (stateRef.length > CITY_STATE_MAX_LEN)
|
|
82
|
+
return fail(`state must be at most ${CITY_STATE_MAX_LEN} characters`);
|
|
83
|
+
if (streetRaw.length > CITY_STREET_MAX_LEN)
|
|
84
|
+
return fail(`street must be at most ${CITY_STREET_MAX_LEN} characters`);
|
|
85
|
+
for (const [name, value] of [["city", cityRef], ["state", stateRef], ["street", streetRaw]]) {
|
|
86
|
+
if (!isWellFormedText(value))
|
|
87
|
+
return fail(`${name} must be well-formed text (no unpaired surrogate)`);
|
|
88
|
+
}
|
|
89
|
+
if (kindRaw && !CITY_KINDS.includes(kindRaw)) {
|
|
90
|
+
return fail("kind must be 'violations', 'permits' or 'zoning'");
|
|
91
|
+
}
|
|
92
|
+
const kind = (kindRaw || undefined);
|
|
93
|
+
// The street line only: "600 Commerce St, Dallas, TX" is cut at the comma,
|
|
94
|
+
// because the city is the city argument and the substring match would
|
|
95
|
+
// otherwise look for the literal ", Dallas, TX" inside the address column.
|
|
96
|
+
const street = streetRaw.split(",")[0].trim();
|
|
97
|
+
if (!cityRef) {
|
|
98
|
+
const list = listCities({ state: stateRef || undefined, kind });
|
|
99
|
+
return ok({
|
|
100
|
+
total_cities: list.length,
|
|
101
|
+
cities: list.map(citySummaryOut),
|
|
102
|
+
note: "kinds are the dataset kinds UrbanKit has verified for the city: 'violations' and 'permits' are the city's own code-enforcement and permit tables, 'zoning' its rezoning docket or current zoning map. Call again with city (and optionally kind and street) for the endpoint and a ready query URL. Scope is the city's limits, not the county; parcel owners are the county tools.",
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
const matches = resolve(cityRef, stateRef || undefined);
|
|
106
|
+
if (matches.length === 0) {
|
|
107
|
+
const covered = listCities();
|
|
108
|
+
const comma = cityRef.indexOf(",");
|
|
109
|
+
const stateHint = stateRef || (comma >= 0 ? cityRef.slice(comma + 1).trim() : "");
|
|
110
|
+
const refSlug = slugify(comma >= 0 ? cityRef.slice(0, comma) : cityRef);
|
|
111
|
+
const inState = stateHint ? listCities({ state: stateHint }) : [];
|
|
112
|
+
// A county reference ("orange-county", "Orange County"): the covered cities
|
|
113
|
+
// inside it, per state, since several states share county names.
|
|
114
|
+
const inCounty = refSlug
|
|
115
|
+
? covered.filter((c) => c.countySlug === refSlug || c.countySlug === `${refSlug}-county`)
|
|
116
|
+
: [];
|
|
117
|
+
return ok({
|
|
118
|
+
found: false,
|
|
119
|
+
city: cityRef,
|
|
120
|
+
...(stateHint ? { state: stateHint } : {}),
|
|
121
|
+
message: `No covered city matches '${cityRef}'${stateHint ? ` in ${stateHint}` : ""}. UrbanKit covers ${covered.length} cities' code-violation, building-permit or zoning-case datasets; a city outside them has no dataset here, and its county may still be in the parcel atlas (find_county).`,
|
|
122
|
+
...(inState.length ? { cities_in_state: inState.map(citySummaryOut) } : {}),
|
|
123
|
+
...(inCounty.length ? { cities_in_county: inCounty.map(citySummaryOut) } : {}),
|
|
124
|
+
hint: "Call get_city_datasets with no city (optionally with state or kind) to list every covered city.",
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (matches.length > 1) {
|
|
128
|
+
return ok({
|
|
129
|
+
found: false,
|
|
130
|
+
ambiguous: true,
|
|
131
|
+
city: cityRef,
|
|
132
|
+
matches: matches.map(citySummaryOut),
|
|
133
|
+
hint: "Repeat with state ('TX' or 'Texas'), or pass the slug as city.",
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
const entry = matches[0];
|
|
137
|
+
// The slug comes from the registry's own summary, never from the caller's
|
|
138
|
+
// text. Which records to read follows registry MEMBERSHIP, not the summary's
|
|
139
|
+
// kinds, as on the hosted tool: the kinds a file declares are read from the file.
|
|
140
|
+
const property = kind !== "zoning" ? getCityProperty(entry.slug) : undefined;
|
|
141
|
+
const zoning = !kind || kind === "zoning" ? getCityZoning(entry.slug) : undefined;
|
|
142
|
+
const descriptors = cityDatasets(entry.slug, kind);
|
|
143
|
+
const record = property ?? zoning;
|
|
144
|
+
if (!record || descriptors.length === 0) {
|
|
145
|
+
const known = Array.from(new Set([
|
|
146
|
+
...entry.kinds,
|
|
147
|
+
...(property ? Object.keys(property.datasets) : []),
|
|
148
|
+
...(getCityZoning(entry.slug) ? ["zoning"] : []),
|
|
149
|
+
]));
|
|
150
|
+
return ok({
|
|
151
|
+
found: true,
|
|
152
|
+
city: { ...citySummaryOut(entry), name: entry.city, state: entry.state },
|
|
153
|
+
datasets: [],
|
|
154
|
+
note: `${entry.city} has no${kind ? ` ${kind}` : ""} dataset in the registry; its kinds are ${known.join(", ")}.`,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
const datasets = descriptors.map((d) => {
|
|
158
|
+
const used = streetForDataset(d, street);
|
|
159
|
+
return {
|
|
160
|
+
...snakeKeys(d),
|
|
161
|
+
freshness: snakeKeys(d.freshness),
|
|
162
|
+
...(used !== street ? { query_note: `${d.queryNote} ${SPLIT_ADDRESS_UNMAPPED_NOTE}` } : {}),
|
|
163
|
+
// The exact URL the site sends for this street (street_used is what the
|
|
164
|
+
// match runs on). Null when the lookup needs a geocoded point first:
|
|
165
|
+
// query_template then carries the request with its {LON},{LAT}
|
|
166
|
+
// placeholder. A street never appears in a template, because it has to be
|
|
167
|
+
// escaped: query_url is the escaped form.
|
|
168
|
+
...(street ? { street_used: used, query_url: buildCityQuery(d, street) } : {}),
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
const stateSlug = slugify(record.state);
|
|
172
|
+
const countySlug = record.countySlug ?? entry.countySlug;
|
|
173
|
+
return ok({
|
|
174
|
+
found: true,
|
|
175
|
+
city: {
|
|
176
|
+
slug: entry.slug,
|
|
177
|
+
name: record.city,
|
|
178
|
+
state: record.state,
|
|
179
|
+
state_abbrev: record.stateAbbrev,
|
|
180
|
+
county_name: record.countyName ?? entry.countyName ?? null,
|
|
181
|
+
county_slug: countySlug ?? null,
|
|
182
|
+
atlas_county_page: countySlug ? `${CITY_BASE_URL}/parcel-atlas/${stateSlug}/${countySlug}` : null,
|
|
183
|
+
},
|
|
184
|
+
scope_note: property?.scopeNote ??
|
|
185
|
+
`Records cover the city of ${record.city}, not the whole county; a county parcel's owner is a county-tool question.`,
|
|
186
|
+
...(street ? { street } : {}),
|
|
187
|
+
datasets,
|
|
188
|
+
source: sourceOut(record.source),
|
|
189
|
+
...(property && zoning && zoning.source.url !== property.source.url
|
|
190
|
+
? { zoning_source: sourceOut(zoning.source) }
|
|
191
|
+
: {}),
|
|
192
|
+
urbankit_pages: {
|
|
193
|
+
property_report: property ? `${CITY_BASE_URL}${cityPath(entry.slug, "permits")}` : null,
|
|
194
|
+
zoning_cases: zoning ? `${CITY_BASE_URL}${cityPath(entry.slug, "zoning")}` : null,
|
|
195
|
+
},
|
|
196
|
+
registry_urls: {
|
|
197
|
+
property: property ? `${CITY_BASE_URL}/data/city-property/${entry.slug}.json` : null,
|
|
198
|
+
zoning: zoning ? `${CITY_BASE_URL}/data/city-zoning/${entry.slug}.json` : null,
|
|
199
|
+
},
|
|
200
|
+
note: "Run query_url (or sample_query) yourself against the city's server: it answers with CORS and needs no key from UrbanKit. The registry JSON above is served with Access-Control-Allow-Origin: * too. This server runs no query itself.",
|
|
201
|
+
});
|
|
202
|
+
}
|
package/dist/server.d.ts
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* find_county – fuzzy-match a county, return endpoints + searchable fields
|
|
11
11
|
* get_parcel_endpoint – return the full REST service URL + ready sample query
|
|
12
12
|
* build_owner_query – construct exact ArcGIS REST query for an owner name
|
|
13
|
+
* get_city_datasets – a city's code-violation, building-permit and zoning-case
|
|
14
|
+
* datasets, with a ready query URL for a street
|
|
13
15
|
*/
|
|
14
16
|
import { escapeSqlLiteral } from "./search-policy.js";
|
|
15
17
|
export { escapeSqlLiteral };
|
package/dist/server.js
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* find_county – fuzzy-match a county, return endpoints + searchable fields
|
|
11
11
|
* get_parcel_endpoint – return the full REST service URL + ready sample query
|
|
12
12
|
* build_owner_query – construct exact ArcGIS REST query for an owner name
|
|
13
|
+
* get_city_datasets – a city's code-violation, building-permit and zoning-case
|
|
14
|
+
* datasets, with a ready query URL for a street
|
|
13
15
|
*/
|
|
14
16
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
15
17
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -19,6 +21,7 @@ import { fileURLToPath } from "node:url";
|
|
|
19
21
|
import { resolve, dirname } from "node:path";
|
|
20
22
|
import { atlas, atlasIndex, slugify, countySlugFromName, } from "@urbankitstudio/atlas";
|
|
21
23
|
import { ownerSearchPolicy, ownerWhereClause, ownerCoverageLabel, buildArcgisOwnerQuery, ownerQueryRowsNote, escapeSqlLiteral, } from "./search-policy.js";
|
|
24
|
+
import { getCityDatasets, CITY_REF_MAX_LEN, CITY_STATE_MAX_LEN, CITY_STREET_MAX_LEN, } from "./city-datasets.js";
|
|
22
25
|
// Re-exported so the package's public surface is unchanged by the move.
|
|
23
26
|
export { escapeSqlLiteral };
|
|
24
27
|
const PKG_VERSION = JSON.parse(readFileSync(resolve(dirname(fileURLToPath(import.meta.url)), "../package.json"), "utf8")).version;
|
|
@@ -95,7 +98,7 @@ const server = new McpServer(
|
|
|
95
98
|
// while the package was 0.1.6 - six releases of drift, and every MCP client
|
|
96
99
|
// that asked the server its version got the wrong answer.
|
|
97
100
|
{ name: "mcp-atlas", version: PKG_VERSION }, {
|
|
98
|
-
instructions: "UrbanKit Atlas MCP server. Use list_counties to discover coverage, find_county or get_parcel_endpoint to get the ArcGIS REST URL, and build_owner_query to construct a ready-to-fire owner-name lookup URL.",
|
|
101
|
+
instructions: "UrbanKit Atlas MCP server. Use list_counties to discover coverage, find_county or get_parcel_endpoint to get the ArcGIS REST URL, and build_owner_query to construct a ready-to-fire owner-name lookup URL. get_city_datasets describes a covered city's code-violation, building-permit and zoning-case datasets and returns a ready query URL for a street; it holds no owner data.",
|
|
99
102
|
});
|
|
100
103
|
// ---------------------------------------------------------------------------
|
|
101
104
|
// Tool: list_counties
|
|
@@ -449,6 +452,40 @@ server.registerTool("build_owner_query", {
|
|
|
449
452
|
};
|
|
450
453
|
});
|
|
451
454
|
// ---------------------------------------------------------------------------
|
|
455
|
+
// Tool: get_city_datasets
|
|
456
|
+
// ---------------------------------------------------------------------------
|
|
457
|
+
// The twin of the hosted MCP tool of the same name: same inputs and caps, same
|
|
458
|
+
// answers. The logic is in ./city-datasets.ts, which reads only the package's
|
|
459
|
+
// city exports and never fetches, so this server stays network-free.
|
|
460
|
+
server.registerTool("get_city_datasets", {
|
|
461
|
+
title: "Find a city's violation, permit and zoning datasets",
|
|
462
|
+
description: "Find the public code-violation, building-permit and zoning-case datasets UrbanKit has verified for a U.S. city, and how to query them by street. Give a city slug or name (state optional), optionally a kind ('violations', 'permits' or 'zoning') and a street; omit city to list every covered city. Returns each dataset's endpoint (Socrata, ArcGIS, CKAN or CARTO), the address column it searches, its date field and filter, coverage notes, and a ready query URL you run yourself against the city's server. This server does not execute the query and returns no city records: fetch the returned URL yourself. Returns no owner data: for a parcel's owner use get_parcel_endpoint or build_owner_query.",
|
|
463
|
+
inputSchema: {
|
|
464
|
+
city: z
|
|
465
|
+
.string()
|
|
466
|
+
.max(CITY_REF_MAX_LEN)
|
|
467
|
+
.optional()
|
|
468
|
+
.describe("City slug ('fort-worth') or name ('Fort Worth', 'Fort Worth, TX'). Omit to list covered cities."),
|
|
469
|
+
state: z
|
|
470
|
+
.string()
|
|
471
|
+
.max(CITY_STATE_MAX_LEN)
|
|
472
|
+
.optional()
|
|
473
|
+
.describe("Optional 2-letter code or state name, for a name used in two states."),
|
|
474
|
+
kind: z.enum(["violations", "permits", "zoning"]).optional(),
|
|
475
|
+
street: z
|
|
476
|
+
.string()
|
|
477
|
+
.max(CITY_STREET_MAX_LEN)
|
|
478
|
+
.optional()
|
|
479
|
+
.describe("Optional street line only, e.g. 'Commerce' or '600 Commerce St'. A street name alone returns the most."),
|
|
480
|
+
},
|
|
481
|
+
}, ({ city, state, kind, street }) => {
|
|
482
|
+
const result = getCityDatasets({ city, state, kind, street });
|
|
483
|
+
return {
|
|
484
|
+
content: [{ type: "text", text: result.text }],
|
|
485
|
+
...(result.isError ? { isError: true } : {}),
|
|
486
|
+
};
|
|
487
|
+
});
|
|
488
|
+
// ---------------------------------------------------------------------------
|
|
452
489
|
// Connect and run
|
|
453
490
|
// ---------------------------------------------------------------------------
|
|
454
491
|
async function main() {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@urbankitstudio/mcp-atlas",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"mcpName": "io.github.urbankitstudio/mcp-atlas",
|
|
5
|
-
"description": "Query the parcel ArcGIS REST endpoints of
|
|
5
|
+
"description": "Query the parcel ArcGIS REST endpoints of 314 counties across 51 US states (50 states plus DC), 331 endpoints total, for owner, APN and address lookup via the Model Context Protocol (MCP), plus verified city code-violation, building-permit and zoning-case datasets.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"mcp",
|
|
8
8
|
"mcp-server",
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
"address-to-parcel",
|
|
15
15
|
"property-data",
|
|
16
16
|
"real-estate",
|
|
17
|
-
"esri"
|
|
17
|
+
"esri",
|
|
18
|
+
"code-violations",
|
|
19
|
+
"building-permits",
|
|
20
|
+
"zoning"
|
|
18
21
|
],
|
|
19
22
|
"homepage": "https://urbankitstudio.com/parcel-atlas",
|
|
20
23
|
"repository": {
|
|
@@ -43,12 +46,12 @@
|
|
|
43
46
|
"typecheck": "tsc --noEmit",
|
|
44
47
|
"smoke": "node test/smoke.mjs",
|
|
45
48
|
"test:currency": "node --test test/atlas-currency.test.mjs",
|
|
46
|
-
"test:policy": "node --test test/search-policy.test.mjs",
|
|
49
|
+
"test:policy": "node --test test/search-policy.test.mjs test/city-datasets.test.mjs",
|
|
47
50
|
"prepublishOnly": "npm run typecheck && npm run build && npm run smoke && npm run test:policy"
|
|
48
51
|
},
|
|
49
52
|
"dependencies": {
|
|
50
53
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
51
|
-
"@urbankitstudio/atlas": "^0.6.
|
|
54
|
+
"@urbankitstudio/atlas": "^0.6.32"
|
|
52
55
|
},
|
|
53
56
|
"devDependencies": {
|
|
54
57
|
"@types/node": "^26.0.0",
|