@pipeworx/mcp-datagov-ie 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 +56 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +161 -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,56 @@
|
|
|
1
|
+
# mcp-datagov-ie
|
|
2
|
+
|
|
3
|
+
data.gov.ie MCP — Ireland's national open-data portal (CKAN API).
|
|
4
|
+
|
|
5
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 705+ live data sources.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
| `list_groups` | List thematic groups/categories on data.gov.ie (CKAN group_list). |
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"datagov-ie": {
|
|
21
|
+
"url": "https://gateway.pipeworx.io/datagov-ie/mcp"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or connect to the full Pipeworx gateway for access to all 705+ data sources:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"mcpServers": {
|
|
32
|
+
"pipeworx": {
|
|
33
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Using with ask_pipeworx
|
|
40
|
+
|
|
41
|
+
Instead of calling tools directly, you can ask questions in plain English:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
ask_pipeworx({ question: "your question about Datagov Ie data" })
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
48
|
+
|
|
49
|
+
## More
|
|
50
|
+
|
|
51
|
+
- [All tools and guides](https://github.com/pipeworx-io/examples)
|
|
52
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
53
|
+
|
|
54
|
+
## License
|
|
55
|
+
|
|
56
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-datagov-ie",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "data.gov.ie MCP — Ireland's national open-data portal (CKAN API).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "datagov-ie"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-datagov-ie"
|
|
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/datagov-ie",
|
|
4
|
+
"title": "Datagov Ie",
|
|
5
|
+
"description": "data.gov.ie MCP — Ireland's national open-data portal (CKAN API).",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/datagov-ie",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-datagov-ie",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/datagov-ie/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
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
|
+
* data.gov.ie MCP — Ireland's national open-data portal (CKAN API).
|
|
21
|
+
*
|
|
22
|
+
* Auth: none (keyless). Docs: https://docs.ckan.org/en/latest/api/
|
|
23
|
+
*
|
|
24
|
+
* What's here: datasets published by Irish government departments, state
|
|
25
|
+
* agencies, and local authorities (county/city councils) — e.g. council
|
|
26
|
+
* budgets, election/referendum results, charities register, transport,
|
|
27
|
+
* health, planning. Metadata and values are in English.
|
|
28
|
+
*
|
|
29
|
+
* Notes for callers:
|
|
30
|
+
* - Many resources are documents (PDF/XLSX) linked by a download `url`;
|
|
31
|
+
* surface that url to the user.
|
|
32
|
+
* - Resources with `datastore_active: true` expose row-level table data —
|
|
33
|
+
* read those rows with `datastore_query`, passing the resource `id`
|
|
34
|
+
* (resource_id) found in `dataset_details`.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
const BASE = 'https://data.gov.ie/api/3/action';
|
|
39
|
+
const UA = 'pipeworx-mcp-datagov-ie/1.0 (+https://pipeworx.io)';
|
|
40
|
+
|
|
41
|
+
const tools: McpToolExport['tools'] = [
|
|
42
|
+
{
|
|
43
|
+
name: 'search_datasets',
|
|
44
|
+
description:
|
|
45
|
+
"Search Ireland's national open-data catalogue (data.gov.ie, CKAN package_search). Returns matching datasets from government departments, state agencies, and local councils, with titles/descriptions and their resources (English).",
|
|
46
|
+
inputSchema: {
|
|
47
|
+
type: 'object',
|
|
48
|
+
properties: {
|
|
49
|
+
query: { type: 'string', description: 'Search terms in English. e.g. "budget", "referendum", "housing", "transport".' },
|
|
50
|
+
fq: { type: 'string', description: 'Solr filter query, e.g. "organization:kildarecoco-ckan" or "res_format:CSV".' },
|
|
51
|
+
rows: { type: 'number', description: 'Max results, 1-1000 (default 25).' },
|
|
52
|
+
start: { type: 'number', description: '0-based offset for paging.' },
|
|
53
|
+
sort: { type: 'string', description: 'Sort spec, e.g. "metadata_modified desc".' },
|
|
54
|
+
},
|
|
55
|
+
required: ['query'],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'dataset_details',
|
|
60
|
+
description:
|
|
61
|
+
'Full dataset record by id or slug (CKAN package_show), including its resources. Each resource has a download "url" (often PDF/CSV/XLSX) and a "datastore_active" flag; resources with datastore_active=true can be read row-by-row via datastore_query using the resource "id".',
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: 'object',
|
|
64
|
+
properties: { id: { type: 'string', description: 'Dataset id or slug, e.g. "budget" or "1968fourthamendmentcsv".' } },
|
|
65
|
+
required: ['id'],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'datastore_query',
|
|
70
|
+
description:
|
|
71
|
+
'Read actual table rows from a resource via CKAN datastore_search. Works only for resources with datastore_active=true (get the resource_id from dataset_details).',
|
|
72
|
+
inputSchema: {
|
|
73
|
+
type: 'object',
|
|
74
|
+
properties: {
|
|
75
|
+
resource_id: { type: 'string', description: 'Resource UUID from dataset_details, e.g. "a51e4cf1-733d-4ed6-9ab5-01251a4348f7".' },
|
|
76
|
+
q: { type: 'string', description: 'Full-text filter across the table.' },
|
|
77
|
+
filters: { type: 'object', description: 'Exact-match column filters, e.g. {"Constituency":"Cork"}.' },
|
|
78
|
+
limit: { type: 'number', description: 'Max rows, 1-32000 (default 100).' },
|
|
79
|
+
offset: { type: 'number', description: '0-based row offset for paging.' },
|
|
80
|
+
},
|
|
81
|
+
required: ['resource_id'],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'list_organizations',
|
|
86
|
+
description:
|
|
87
|
+
'List publishing organizations (government departments, state agencies, county/city councils) on data.gov.ie (CKAN organization_list).',
|
|
88
|
+
inputSchema: {
|
|
89
|
+
type: 'object',
|
|
90
|
+
properties: { limit: { type: 'number', description: 'Max orgs, 1-1000 (default 100).' } },
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'list_groups',
|
|
95
|
+
description: 'List thematic groups/categories on data.gov.ie (CKAN group_list).',
|
|
96
|
+
inputSchema: {
|
|
97
|
+
type: 'object',
|
|
98
|
+
properties: { limit: { type: 'number', description: 'Max groups, 1-1000 (default 100).' } },
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
];
|
|
102
|
+
|
|
103
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
104
|
+
switch (name) {
|
|
105
|
+
case 'search_datasets': {
|
|
106
|
+
const params = new URLSearchParams({
|
|
107
|
+
q: reqStr(args, 'query', '"budget" or "referendum"'),
|
|
108
|
+
rows: String(clamp(args.rows, 25, 1, 1000)),
|
|
109
|
+
start: String(Math.max(0, (args.start as number) ?? 0)),
|
|
110
|
+
});
|
|
111
|
+
if (args.fq) params.set('fq', String(args.fq));
|
|
112
|
+
if (args.sort) params.set('sort', String(args.sort));
|
|
113
|
+
return ckanGet(`/package_search?${params}`);
|
|
114
|
+
}
|
|
115
|
+
case 'dataset_details':
|
|
116
|
+
return ckanGet(`/package_show?id=${encodeURIComponent(reqStr(args, 'id', '"budget"'))}`);
|
|
117
|
+
case 'datastore_query': {
|
|
118
|
+
const params = new URLSearchParams({
|
|
119
|
+
resource_id: reqStr(args, 'resource_id', '"a51e4cf1-733d-4ed6-9ab5-01251a4348f7"'),
|
|
120
|
+
limit: String(clamp(args.limit, 100, 1, 32000)),
|
|
121
|
+
offset: String(Math.max(0, (args.offset as number) ?? 0)),
|
|
122
|
+
});
|
|
123
|
+
if (args.q) params.set('q', String(args.q));
|
|
124
|
+
if (args.filters && typeof args.filters === 'object') params.set('filters', JSON.stringify(args.filters));
|
|
125
|
+
return ckanGet(`/datastore_search?${params}`);
|
|
126
|
+
}
|
|
127
|
+
case 'list_organizations': {
|
|
128
|
+
const params = new URLSearchParams({ all_fields: 'true', limit: String(clamp(args.limit, 100, 1, 1000)) });
|
|
129
|
+
return ckanGet(`/organization_list?${params}`);
|
|
130
|
+
}
|
|
131
|
+
case 'list_groups': {
|
|
132
|
+
const params = new URLSearchParams({ all_fields: 'true', limit: String(clamp(args.limit, 100, 1, 1000)) });
|
|
133
|
+
return ckanGet(`/group_list?${params}`);
|
|
134
|
+
}
|
|
135
|
+
default:
|
|
136
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
async function ckanGet(path: string): Promise<unknown> {
|
|
141
|
+
const res = await fetch(`${BASE}${path}`, { headers: { Accept: 'application/json', 'User-Agent': UA } });
|
|
142
|
+
if (!res.ok) throw new Error(`data.gov.ie: ${res.status} ${await res.text().then((t) => t.slice(0, 200))}`);
|
|
143
|
+
const json = (await res.json()) as { success?: boolean; error?: { message?: string }; result?: unknown };
|
|
144
|
+
if (json.success === false) throw new Error(`data.gov.ie: ${json.error?.message ?? 'request failed'}`);
|
|
145
|
+
return json.result ?? json;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function clamp(v: unknown, dflt: number, lo: number, hi: number): number {
|
|
149
|
+
const n = typeof v === 'number' ? v : dflt;
|
|
150
|
+
return Math.min(hi, Math.max(lo, n));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function reqStr(args: Record<string, unknown>, key: string, example: string): string {
|
|
154
|
+
const v = args[key];
|
|
155
|
+
if (typeof v !== 'string' || !v.trim()) {
|
|
156
|
+
throw new Error(`Required argument "${key}" is missing. Pass a string like ${example}.`);
|
|
157
|
+
}
|
|
158
|
+
return v;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
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
|
+
}
|