@pipeworx/mcp-arcgis-glynncounty 0.1.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 +21 -0
- package/README.md +58 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +149 -0
- package/tsconfig.json +14 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pipeworx
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# mcp-arcgis-glynncounty
|
|
2
|
+
|
|
3
|
+
Glynn County GIS — Glynn County, Georgia open geospatial data (ArcGIS).
|
|
4
|
+
|
|
5
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1037+ live data sources.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
| `search_datasets` | Search Glynn County GIS open geospatial datasets (parcels, zoning, addresses & public works) by keyword. Returns each dataset\'s name, summary, record_count, owner/org, and its Feature Service `url` — pass that url to query_layer / layer_info. |
|
|
12
|
+
| `query_layer` | Query an ArcGIS Feature Service / Map Service layer by its url (from search_datasets). SQL-like `where`, comma-separated `out_fields`, `order_by`, `limit`, `offset`. Returns attribute rows (and geometry). Use where="1=1" + out_fields="*" to sample. |
|
|
13
|
+
| `layer_info` | Get an ArcGIS Feature/Map Service layer\'s schema by url: fields (name + type), geometry type, total record count, and capabilities. |
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"mcpServers": {
|
|
22
|
+
"arcgis-glynncounty": {
|
|
23
|
+
"url": "https://gateway.pipeworx.io/arcgis-glynncounty/mcp"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Or connect to the full Pipeworx gateway for access to all 1037+ data sources:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"mcpServers": {
|
|
34
|
+
"pipeworx": {
|
|
35
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Using with ask_pipeworx
|
|
42
|
+
|
|
43
|
+
Instead of calling tools directly, you can ask questions in plain English:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
ask_pipeworx({ question: "your question about Arcgis Glynncounty data" })
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
50
|
+
|
|
51
|
+
## More
|
|
52
|
+
|
|
53
|
+
- [All tools and guides](https://github.com/pipeworx-io/examples)
|
|
54
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
55
|
+
|
|
56
|
+
## License
|
|
57
|
+
|
|
58
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-arcgis-glynncounty",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Glynn County GIS — Glynn County, Georgia open geospatial data (ArcGIS).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "arcgis-glynncounty"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-arcgis-glynncounty"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"typecheck": "tsc --noEmit"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^5.7.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.pipeworx-io/arcgis-glynncounty",
|
|
4
|
+
"title": "Arcgis Glynncounty",
|
|
5
|
+
"description": "Glynn County GIS — Glynn County, Georgia open geospatial data (ArcGIS).",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/arcgis-glynncounty",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-arcgis-glynncounty",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/arcgis-glynncounty/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
interface McpToolDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: 'object';
|
|
6
|
+
properties: Record<string, unknown>;
|
|
7
|
+
required?: string[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface McpToolExport {
|
|
12
|
+
tools: McpToolDefinition[];
|
|
13
|
+
callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
14
|
+
meter?: { credits: number };
|
|
15
|
+
cost?: Record<string, unknown>;
|
|
16
|
+
provider?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Glynn County GIS — Glynn County, Georgia open geospatial data (ArcGIS).
|
|
21
|
+
*
|
|
22
|
+
* Glynn County GIS (ArcGIS org 5iWzb1srkjPDXmpL): parcels, zoning, addresses & public works. search_datasets finds layers (each
|
|
23
|
+
* with a Feature Service url) -> query_layer runs SQL-like queries -> layer_info
|
|
24
|
+
* returns the schema. Keyless.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
const HUB = 'https://hub.arcgis.com/api/v3/datasets';
|
|
29
|
+
const UA = 'pipeworx-mcp-arcgis-glynncounty/1.0 (+https://pipeworx.io)';
|
|
30
|
+
|
|
31
|
+
const tools: McpToolExport['tools'] = [
|
|
32
|
+
{
|
|
33
|
+
name: 'search_datasets',
|
|
34
|
+
description: 'Search Glynn County GIS open geospatial datasets (parcels, zoning, addresses & public works) by keyword. Returns each dataset\'s name, summary, record_count, owner/org, and its Feature Service `url` — pass that url to query_layer / layer_info.',
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: {
|
|
38
|
+
query: { type: 'string', description: 'Keyword(s), e.g. "parcels", "crime", "flood zones".' },
|
|
39
|
+
org_id: { type: 'string', description: 'Optional ArcGIS orgId to override the default (Glynn County GIS).' },
|
|
40
|
+
limit: { type: 'number', description: 'Max datasets (1-50, default 20).' },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'query_layer',
|
|
46
|
+
description: 'Query an ArcGIS Feature Service / Map Service layer by its url (from search_datasets). SQL-like `where`, comma-separated `out_fields`, `order_by`, `limit`, `offset`. Returns attribute rows (and geometry). Use where="1=1" + out_fields="*" to sample.',
|
|
47
|
+
inputSchema: {
|
|
48
|
+
type: 'object',
|
|
49
|
+
properties: {
|
|
50
|
+
url: { type: 'string', description: 'Feature/Map Service layer url ending in /FeatureServer/<n> or /MapServer/<n>.' },
|
|
51
|
+
where: { type: 'string', description: 'SQL where clause, e.g. "STATE = \'CA\' AND YEAR >= 2020". Default "1=1".' },
|
|
52
|
+
out_fields: { type: 'string', description: 'Comma-separated field names, or "*" for all (default).' },
|
|
53
|
+
order_by: { type: 'string', description: 'e.g. "POP DESC".' },
|
|
54
|
+
limit: { type: 'number', description: 'Max features (1-2000, default 50).' },
|
|
55
|
+
offset: { type: 'number', description: 'Pagination offset.' },
|
|
56
|
+
},
|
|
57
|
+
required: ['url'],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'layer_info',
|
|
62
|
+
description: 'Get an ArcGIS Feature/Map Service layer\'s schema by url: fields (name + type), geometry type, total record count, and capabilities.',
|
|
63
|
+
inputSchema: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
properties: { url: { type: 'string', description: 'Feature/Map Service layer url, e.g. ".../FeatureServer/0".' } },
|
|
66
|
+
required: ['url'],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
const ORG = '5iWzb1srkjPDXmpL';
|
|
72
|
+
|
|
73
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
74
|
+
switch (name) {
|
|
75
|
+
case 'search_datasets': {
|
|
76
|
+
const q = typeof args.query === 'string' ? args.query.trim() : '';
|
|
77
|
+
const org = (typeof args.org_id === 'string' && args.org_id.trim()) || ORG;
|
|
78
|
+
const size = clamp(numArg(args.limit, 20), 1, 50);
|
|
79
|
+
const p = new URLSearchParams({ 'page[size]': String(size) });
|
|
80
|
+
if (q) p.set('q', q);
|
|
81
|
+
if (org) p.set('filter[orgId]', org);
|
|
82
|
+
const res = await fetch(`${HUB}?${p}`, { headers: { Accept: 'application/json', 'User-Agent': UA } });
|
|
83
|
+
if (!res.ok) throw new Error(`ArcGIS Hub: ${res.status}`);
|
|
84
|
+
const body = (await res.json()) as { data?: Array<{ id?: string; attributes?: Record<string, unknown> }>; meta?: { stats?: { totalCount?: number } } };
|
|
85
|
+
return {
|
|
86
|
+
total: body.meta?.stats?.totalCount ?? null,
|
|
87
|
+
count: body.data?.length ?? 0,
|
|
88
|
+
datasets: (body.data ?? []).map((d) => {
|
|
89
|
+
const a = d.attributes ?? {};
|
|
90
|
+
return {
|
|
91
|
+
id: d.id,
|
|
92
|
+
name: a.name,
|
|
93
|
+
summary: typeof a.snippet === 'string' ? a.snippet : (typeof a.description === 'string' ? a.description.slice(0, 200) : undefined),
|
|
94
|
+
org: a.source,
|
|
95
|
+
org_id: a.orgId,
|
|
96
|
+
record_count: a.recordCount,
|
|
97
|
+
type: a.type,
|
|
98
|
+
url: a.url,
|
|
99
|
+
};
|
|
100
|
+
}),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
case 'query_layer': {
|
|
104
|
+
const url = layerUrl(args.url);
|
|
105
|
+
const p = new URLSearchParams({
|
|
106
|
+
where: typeof args.where === 'string' && args.where.trim() ? String(args.where) : '1=1',
|
|
107
|
+
outFields: typeof args.out_fields === 'string' && args.out_fields.trim() ? String(args.out_fields) : '*',
|
|
108
|
+
resultRecordCount: String(clamp(numArg(args.limit, 50), 1, 2000)),
|
|
109
|
+
f: 'json',
|
|
110
|
+
});
|
|
111
|
+
if (args.order_by) p.set('orderByFields', String(args.order_by));
|
|
112
|
+
if (args.offset != null) p.set('resultOffset', String(Math.max(0, numArg(args.offset, 0))));
|
|
113
|
+
const res = await fetch(`${url}/query?${p}`, { headers: { Accept: 'application/json', 'User-Agent': UA } });
|
|
114
|
+
if (!res.ok) throw new Error(`ArcGIS query: ${res.status}`);
|
|
115
|
+
return res.json();
|
|
116
|
+
}
|
|
117
|
+
case 'layer_info': {
|
|
118
|
+
const url = layerUrl(args.url);
|
|
119
|
+
const res = await fetch(`${url}?f=json`, { headers: { Accept: 'application/json', 'User-Agent': UA } });
|
|
120
|
+
if (!res.ok) throw new Error(`ArcGIS layer_info: ${res.status}`);
|
|
121
|
+
return res.json();
|
|
122
|
+
}
|
|
123
|
+
default:
|
|
124
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Restrict to public https ArcGIS Feature/Map Service layer URLs (a light SSRF
|
|
129
|
+
// guard — only lets the tool hit real Esri layer-query endpoints, not arbitrary
|
|
130
|
+
// hosts/ports/IPs).
|
|
131
|
+
function layerUrl(v: unknown): string {
|
|
132
|
+
const url = String(v ?? '').trim();
|
|
133
|
+
let u: URL;
|
|
134
|
+
try { u = new URL(url); } catch { throw new Error('Pass a valid Feature/Map Service layer url (https).'); }
|
|
135
|
+
if (u.protocol !== 'https:') throw new Error('url must be https.');
|
|
136
|
+
if (/^(\d+\.\d+\.\d+\.\d+|localhost|\[)/.test(u.hostname) || u.port) throw new Error('url must be a public ArcGIS host.');
|
|
137
|
+
if (!/\/(FeatureServer|MapServer)\/\d+\/?$/i.test(u.pathname)) throw new Error('url must end in /FeatureServer/<n> or /MapServer/<n>.');
|
|
138
|
+
return url.replace(/\/$/, '');
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function numArg(v: unknown, dflt: number): number {
|
|
142
|
+
const n = typeof v === 'number' ? v : typeof v === 'string' ? Number(v) : NaN;
|
|
143
|
+
return Number.isFinite(n) ? n : dflt;
|
|
144
|
+
}
|
|
145
|
+
function clamp(n: number, lo: number, hi: number): number {
|
|
146
|
+
return Math.max(lo, Math.min(hi, Math.trunc(n)));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export default { tools, callTool, meter: { credits: 1 } } satisfies McpToolExport;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"rootDir": "src",
|
|
11
|
+
"declaration": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
|
+
}
|