@pipeworx/mcp-ooni 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 +55 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +287 -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,55 @@
|
|
|
1
|
+
# mcp-ooni
|
|
2
|
+
|
|
3
|
+
Internet censorship and website reachability: OONI network measurements, keyless
|
|
4
|
+
|
|
5
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1302+ live data sources.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
|
|
12
|
+
## Quick Start
|
|
13
|
+
|
|
14
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"mcpServers": {
|
|
19
|
+
"ooni": {
|
|
20
|
+
"url": "https://gateway.pipeworx.io/ooni/mcp"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or connect to the full Pipeworx gateway for access to all 1302+ data sources:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"mcpServers": {
|
|
31
|
+
"pipeworx": {
|
|
32
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Using with ask_pipeworx
|
|
39
|
+
|
|
40
|
+
Instead of calling tools directly, you can ask questions in plain English:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
ask_pipeworx({ question: "your question about Ooni data" })
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
47
|
+
|
|
48
|
+
## More
|
|
49
|
+
|
|
50
|
+
- [All tools and guides](https://github.com/pipeworx-io/examples)
|
|
51
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-ooni",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Internet censorship and website reachability: OONI network measurements, keyless",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "ooni"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-ooni"
|
|
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/ooni",
|
|
4
|
+
"title": "Ooni",
|
|
5
|
+
"description": "Internet censorship and website reachability: OONI network measurements, keyless",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/ooni",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-ooni",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/ooni/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
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
|
+
* OONI MCP — internet censorship & website reachability measurements from the
|
|
21
|
+
* Open Observatory of Network Interference (api.ooni.io, keyless).
|
|
22
|
+
*
|
|
23
|
+
* Millions of volunteer-run probes worldwide test whether sites and apps are
|
|
24
|
+
* reachable; OONI aggregates anomaly/confirmed-blocking counts per country.
|
|
25
|
+
* "confirmed" = a known blocking fingerprint (e.g. a censor's blockpage);
|
|
26
|
+
* "anomaly" = the measurement deviated from control (possible blocking, DNS
|
|
27
|
+
* tampering, throttling) but wasn't fingerprint-confirmed.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
const BASE = 'https://api.ooni.io/api/v1';
|
|
32
|
+
const UA = 'pipeworx/1.0 (+https://pipeworx.io)';
|
|
33
|
+
|
|
34
|
+
const APPS: Record<string, string> = {
|
|
35
|
+
whatsapp: 'whatsapp',
|
|
36
|
+
telegram: 'telegram',
|
|
37
|
+
signal: 'signal',
|
|
38
|
+
facebook_messenger: 'facebook_messenger',
|
|
39
|
+
tor: 'tor',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const tools: McpToolExport['tools'] = [
|
|
43
|
+
{
|
|
44
|
+
name: 'ooni_site_reachability',
|
|
45
|
+
description:
|
|
46
|
+
'Check whether a website is blocked or censored in a specific country, using OONI network measurements from volunteer probes. Returns counts of OK, anomalous, confirmed-blocked, and failed measurements over the window plus a blocking assessment — e.g. is bbc.com blocked in China, is twitter.com blocked in Iran. Great-Firewall / national-censorship / internet-freedom research.',
|
|
47
|
+
inputSchema: {
|
|
48
|
+
type: 'object',
|
|
49
|
+
properties: {
|
|
50
|
+
domain: { type: 'string', description: 'Website domain, e.g. "www.bbc.com" or "twitter.com". A full URL is accepted (the host is extracted).' },
|
|
51
|
+
country: { type: 'string', description: '2-letter country code, e.g. "CN", "IR", "RU".' },
|
|
52
|
+
days: { type: ['number', 'string'], description: 'Lookback window in days (default 30, max 365).' },
|
|
53
|
+
},
|
|
54
|
+
required: ['domain', 'country'],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'ooni_blocking_trend',
|
|
59
|
+
description:
|
|
60
|
+
'Daily time series of OONI censorship measurements for a website in a country — shows when blocking started, stopped, or intensified (e.g. Twitter in Iran day by day). Returns per-day OK / anomaly / confirmed-blocked counts.',
|
|
61
|
+
inputSchema: {
|
|
62
|
+
type: 'object',
|
|
63
|
+
properties: {
|
|
64
|
+
domain: { type: 'string', description: 'Website domain, e.g. "twitter.com".' },
|
|
65
|
+
country: { type: 'string', description: '2-letter country code, e.g. "IR".' },
|
|
66
|
+
days: { type: ['number', 'string'], description: 'Lookback window in days (default 30, max 365).' },
|
|
67
|
+
},
|
|
68
|
+
required: ['domain', 'country'],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'ooni_app_blocking',
|
|
73
|
+
description:
|
|
74
|
+
'Check whether a messaging or circumvention app is blocked in a country using OONI app-specific tests: WhatsApp, Telegram, Signal, Facebook Messenger, or Tor. Returns measurement counts and a blocking assessment, e.g. "is Telegram blocked in Iran", "is Tor reachable from Russia".',
|
|
75
|
+
inputSchema: {
|
|
76
|
+
type: 'object',
|
|
77
|
+
properties: {
|
|
78
|
+
app: { type: 'string', description: `One of: ${Object.keys(APPS).join(' | ')}.` },
|
|
79
|
+
country: { type: 'string', description: '2-letter country code, e.g. "IR", "RU", "CN".' },
|
|
80
|
+
days: { type: ['number', 'string'], description: 'Lookback window in days (default 30, max 365).' },
|
|
81
|
+
},
|
|
82
|
+
required: ['app', 'country'],
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'ooni_measurements',
|
|
87
|
+
description:
|
|
88
|
+
'List recent raw OONI measurements for a domain and/or country — individual probe results with timestamp, network (ASN), anomaly/confirmed flags, and a link to the full measurement on OONI Explorer. Use after ooni_site_reachability to inspect specific blocking evidence.',
|
|
89
|
+
inputSchema: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
properties: {
|
|
92
|
+
domain: { type: 'string', description: 'Website domain, e.g. "twitter.com".' },
|
|
93
|
+
country: { type: 'string', description: '2-letter country code filter, e.g. "IR".' },
|
|
94
|
+
confirmed_only: { type: 'boolean', description: 'Only measurements with confirmed blocking fingerprints.' },
|
|
95
|
+
limit: { type: ['number', 'string'], description: 'Max results (1-50, default 10).' },
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
function cleanDomain(raw: unknown): string {
|
|
102
|
+
let d = typeof raw === 'string' ? raw.trim() : '';
|
|
103
|
+
d = d.replace(/^https?:\/\//i, '').replace(/\/.*$/, '');
|
|
104
|
+
return d;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function cleanCountry(raw: unknown): string {
|
|
108
|
+
return typeof raw === 'string' ? raw.trim().toUpperCase() : '';
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function window_(args: Record<string, unknown>): { since: string; until: string; days: number } {
|
|
112
|
+
const days = Math.min(Math.max(Number(args.days) || 30, 1), 365);
|
|
113
|
+
const until = new Date();
|
|
114
|
+
const since = new Date(until.getTime() - days * 86400_000);
|
|
115
|
+
const iso = (d: Date) => d.toISOString().slice(0, 10);
|
|
116
|
+
return { since: iso(since), until: iso(until), days };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
async function ooniGet(path: string, params: Record<string, string>): Promise<Record<string, unknown>> {
|
|
120
|
+
const qs = new URLSearchParams(params);
|
|
121
|
+
const res = await fetch(`${BASE}/${path}?${qs}`, { headers: { Accept: 'application/json', 'User-Agent': UA } });
|
|
122
|
+
if (!res.ok) {
|
|
123
|
+
throw new Error(`upstream_down: OONI API ${res.status} ${(await res.text()).slice(0, 150)}`);
|
|
124
|
+
}
|
|
125
|
+
return (await res.json()) as Record<string, unknown>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
interface AggCounts {
|
|
129
|
+
ok_count?: number;
|
|
130
|
+
anomaly_count?: number;
|
|
131
|
+
confirmed_count?: number;
|
|
132
|
+
failure_count?: number;
|
|
133
|
+
measurement_count?: number;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function assess(c: AggCounts): { assessment: string; blocked_share: number | null } {
|
|
137
|
+
const total = c.measurement_count ?? 0;
|
|
138
|
+
if (total === 0) return { assessment: 'no_data — no OONI measurements in this window (try a longer window or a more common domain spelling)', blocked_share: null };
|
|
139
|
+
const bad = (c.anomaly_count ?? 0) + (c.confirmed_count ?? 0);
|
|
140
|
+
const share = bad / total;
|
|
141
|
+
let assessment: string;
|
|
142
|
+
if ((c.confirmed_count ?? 0) > 0 && share > 0.5) assessment = 'blocked — confirmed blocking fingerprints and a majority of measurements anomalous';
|
|
143
|
+
else if (share > 0.7) assessment = 'likely_blocked — most measurements anomalous (no/few confirmed fingerprints; could also be heavy interference or throttling)';
|
|
144
|
+
else if (share > 0.3) assessment = 'partially_blocked_or_unstable — significant share of anomalous measurements (may vary by ISP/region)';
|
|
145
|
+
else assessment = 'mostly_reachable — anomalies within normal noise levels';
|
|
146
|
+
return { assessment, blocked_share: Math.round(share * 1000) / 1000 };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function shapeCounts(c: AggCounts) {
|
|
150
|
+
return {
|
|
151
|
+
measurements: c.measurement_count ?? 0,
|
|
152
|
+
ok: c.ok_count ?? 0,
|
|
153
|
+
anomalies: c.anomaly_count ?? 0,
|
|
154
|
+
confirmed_blocked: c.confirmed_count ?? 0,
|
|
155
|
+
failures: c.failure_count ?? 0,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
async function siteReachability(args: Record<string, unknown>): Promise<unknown> {
|
|
160
|
+
const domain = cleanDomain(args.domain);
|
|
161
|
+
const country = cleanCountry(args.country);
|
|
162
|
+
if (!domain || !/^[A-Z]{2}$/.test(country)) {
|
|
163
|
+
return { error: 'user_error', message: 'Pass domain (e.g. "www.bbc.com") and a 2-letter country code (e.g. "CN").' };
|
|
164
|
+
}
|
|
165
|
+
const { since, until, days } = window_(args);
|
|
166
|
+
const data = await ooniGet('aggregation', {
|
|
167
|
+
probe_cc: country, test_name: 'web_connectivity', domain, since, until,
|
|
168
|
+
});
|
|
169
|
+
const counts = (data.result ?? {}) as AggCounts;
|
|
170
|
+
const verdict = assess(counts);
|
|
171
|
+
return {
|
|
172
|
+
domain, country, window_days: days, since, until,
|
|
173
|
+
...shapeCounts(counts),
|
|
174
|
+
...verdict,
|
|
175
|
+
note: 'Source: OONI volunteer probes. "confirmed" = known censor blockpage fingerprint; "anomaly" = deviated from control (possible blocking/DNS tampering).',
|
|
176
|
+
explorer_url: `https://explorer.ooni.org/search?until=${until}&domain=${encodeURIComponent(domain)}&probe_cc=${country}`,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
async function blockingTrend(args: Record<string, unknown>): Promise<unknown> {
|
|
181
|
+
const domain = cleanDomain(args.domain);
|
|
182
|
+
const country = cleanCountry(args.country);
|
|
183
|
+
if (!domain || !/^[A-Z]{2}$/.test(country)) {
|
|
184
|
+
return { error: 'user_error', message: 'Pass domain (e.g. "twitter.com") and a 2-letter country code (e.g. "IR").' };
|
|
185
|
+
}
|
|
186
|
+
const { since, until, days } = window_(args);
|
|
187
|
+
const data = await ooniGet('aggregation', {
|
|
188
|
+
probe_cc: country, test_name: 'web_connectivity', domain, since, until,
|
|
189
|
+
axis_x: 'measurement_start_day',
|
|
190
|
+
});
|
|
191
|
+
const rows = Array.isArray(data.result) ? (data.result as Array<AggCounts & { measurement_start_day?: string }>) : [];
|
|
192
|
+
// Short windows come back as sub-day buckets sharing a day label (7-day
|
|
193
|
+
// query → 168 rows) — roll them up to one row per date.
|
|
194
|
+
const byDate = new Map<string, ReturnType<typeof shapeCounts>>();
|
|
195
|
+
for (const r of rows) {
|
|
196
|
+
const date = (r.measurement_start_day ?? '').slice(0, 10);
|
|
197
|
+
const c = shapeCounts(r);
|
|
198
|
+
const acc = byDate.get(date);
|
|
199
|
+
if (!acc) byDate.set(date, c);
|
|
200
|
+
else {
|
|
201
|
+
acc.measurements += c.measurements;
|
|
202
|
+
acc.ok += c.ok;
|
|
203
|
+
acc.anomalies += c.anomalies;
|
|
204
|
+
acc.confirmed_blocked += c.confirmed_blocked;
|
|
205
|
+
acc.failures += c.failures;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const series = [...byDate.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([date, c]) => ({ date, ...c }));
|
|
209
|
+
return {
|
|
210
|
+
domain, country, window_days: days, since, until,
|
|
211
|
+
days_with_data: series.length,
|
|
212
|
+
series,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
async function appBlocking(args: Record<string, unknown>): Promise<unknown> {
|
|
217
|
+
const app = typeof args.app === 'string' ? args.app.trim().toLowerCase().replace(/\s+/g, '_') : '';
|
|
218
|
+
const country = cleanCountry(args.country);
|
|
219
|
+
const testName = APPS[app];
|
|
220
|
+
if (!testName || !/^[A-Z]{2}$/.test(country)) {
|
|
221
|
+
return { error: 'user_error', message: `Pass app (one of: ${Object.keys(APPS).join(', ')}) and a 2-letter country code.` };
|
|
222
|
+
}
|
|
223
|
+
const { since, until, days } = window_(args);
|
|
224
|
+
const data = await ooniGet('aggregation', { probe_cc: country, test_name: testName, since, until });
|
|
225
|
+
const counts = (data.result ?? {}) as AggCounts;
|
|
226
|
+
const verdict = assess(counts);
|
|
227
|
+
return {
|
|
228
|
+
app, country, window_days: days, since, until,
|
|
229
|
+
...shapeCounts(counts),
|
|
230
|
+
...verdict,
|
|
231
|
+
note: `OONI ${testName} test: anomalies indicate interference with the app's endpoints/registration from probes in ${country}.`,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
async function measurements(args: Record<string, unknown>): Promise<unknown> {
|
|
236
|
+
const domain = cleanDomain(args.domain);
|
|
237
|
+
const country = cleanCountry(args.country);
|
|
238
|
+
if (!domain && !country) {
|
|
239
|
+
return { error: 'user_error', message: 'Pass at least one of domain or country.' };
|
|
240
|
+
}
|
|
241
|
+
const limit = Math.min(Math.max(Number(args.limit) || 10, 1), 50);
|
|
242
|
+
const params: Record<string, string> = { limit: String(limit) };
|
|
243
|
+
if (domain) params.domain = domain;
|
|
244
|
+
if (/^[A-Z]{2}$/.test(country)) params.probe_cc = country;
|
|
245
|
+
if (args.confirmed_only === true) params.confirmed = 'true';
|
|
246
|
+
const data = await ooniGet('measurements', params);
|
|
247
|
+
const rows = Array.isArray(data.results) ? (data.results as Array<Record<string, unknown>>) : [];
|
|
248
|
+
return {
|
|
249
|
+
domain: domain || null,
|
|
250
|
+
country: country || null,
|
|
251
|
+
count: rows.length,
|
|
252
|
+
measurements: rows.map((r) => ({
|
|
253
|
+
measured_at: r.measurement_start_time ?? null,
|
|
254
|
+
input: r.input ?? null,
|
|
255
|
+
country: r.probe_cc ?? null,
|
|
256
|
+
network_asn: r.probe_asn ?? null,
|
|
257
|
+
test: r.test_name ?? null,
|
|
258
|
+
anomaly: r.anomaly ?? null,
|
|
259
|
+
confirmed_blocked: r.confirmed ?? null,
|
|
260
|
+
failure: r.failure ?? null,
|
|
261
|
+
explorer_url: r.report_id
|
|
262
|
+
? `https://explorer.ooni.org/measurement/${r.report_id}${r.input ? `?input=${encodeURIComponent(String(r.input))}` : ''}`
|
|
263
|
+
: null,
|
|
264
|
+
})),
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
269
|
+
try {
|
|
270
|
+
switch (name) {
|
|
271
|
+
case 'ooni_site_reachability':
|
|
272
|
+
return await siteReachability(args);
|
|
273
|
+
case 'ooni_blocking_trend':
|
|
274
|
+
return await blockingTrend(args);
|
|
275
|
+
case 'ooni_app_blocking':
|
|
276
|
+
return await appBlocking(args);
|
|
277
|
+
case 'ooni_measurements':
|
|
278
|
+
return await measurements(args);
|
|
279
|
+
default:
|
|
280
|
+
return { error: `Unknown tool: ${name}` };
|
|
281
|
+
}
|
|
282
|
+
} catch (err) {
|
|
283
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
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
|
+
}
|