@cyanheads/wikidata-mcp-server 0.1.7 → 0.1.9
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/CLAUDE.md +19 -40
- package/README.md +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/resources/definitions/entity.resource.js +2 -2
- package/dist/mcp-server/resources/definitions/entity.resource.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-entity.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/get-entity.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-labels.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/get-labels.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-sitelinks.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/get-sitelinks.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-statements.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/get-statements.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/resolve-external-id.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/resolve-external-id.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts +7 -11
- package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-entities.tool.js +19 -29
- package/dist/mcp-server/tools/definitions/search-entities.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/sparql-query.tool.d.ts +4 -2
- package/dist/mcp-server/tools/definitions/sparql-query.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/sparql-query.tool.js +18 -8
- package/dist/mcp-server/tools/definitions/sparql-query.tool.js.map +1 -1
- package/package.json +5 -4
- package/server.json +3 -3
package/CLAUDE.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** @cyanheads/wikidata-mcp-server
|
|
4
|
-
**Version:** 0.1.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.
|
|
4
|
+
**Version:** 0.1.9
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.16`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
|
|
8
8
|
**Zod:** ^4.4.3
|
|
@@ -47,7 +47,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
47
47
|
- **Use `ctx.state`** for tenant-scoped storage. Never access persistence directly.
|
|
48
48
|
- **Check `ctx.elicit` / `ctx.sample`** for presence before calling.
|
|
49
49
|
- **Secrets in env vars only** — never hardcoded.
|
|
50
|
-
- **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed
|
|
50
|
+
- **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed and close it. Do both — a comment without a close leaves stale issues open; a close without a comment leaves no record of what shipped. The comment is for future readers — state the concrete changes, not the conversation that produced them.
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
@@ -175,6 +175,8 @@ Handlers throw — the framework catches, classifies, and formats.
|
|
|
175
175
|
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required descriptive metadata for the agent's next move (≥ 5 words, lint-validated); for the wire `data.recovery.hint` (mirrored into `content[]` text), pass explicitly at the throw site when dynamic context matters: `ctx.fail('reason', msg, { recovery: { hint: '...' } })`. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
|
|
176
176
|
|
|
177
177
|
```ts
|
|
178
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
179
|
+
|
|
178
180
|
errors: [
|
|
179
181
|
{ reason: 'no_match', code: JsonRpcErrorCode.NotFound,
|
|
180
182
|
when: 'No item matched the query',
|
|
@@ -262,10 +264,13 @@ Available skills:
|
|
|
262
264
|
| `add-service` | Scaffold a new service integration |
|
|
263
265
|
| `add-test` | Scaffold test file for a tool, resource, or service |
|
|
264
266
|
| `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
|
|
267
|
+
| `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
|
|
265
268
|
| `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
|
|
269
|
+
| `code-simplifier` | Post-session cleanup against `git diff` — modernize syntax, consolidate duplication, align with the codebase |
|
|
266
270
|
| `devcheck` | Lint, format, typecheck, audit |
|
|
267
|
-
| `git-wrapup` | Version bump, changelog, commit, and annotated tag workflow |
|
|
268
271
|
| `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
|
|
272
|
+
| `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
|
|
273
|
+
| `release-and-publish` | Push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
|
|
269
274
|
| `maintenance` | Investigate changelogs, adopt upstream changes, sync skills to agent dirs |
|
|
270
275
|
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
271
276
|
| `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
|
|
@@ -274,6 +279,7 @@ Available skills:
|
|
|
274
279
|
| `api-config` | AppConfig, parseConfig, env vars |
|
|
275
280
|
| `api-context` | Context interface, logger, state, progress |
|
|
276
281
|
| `api-errors` | McpError, JsonRpcErrorCode, error patterns |
|
|
282
|
+
| `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
|
|
277
283
|
| `api-services` | LLM, Speech, Graph services |
|
|
278
284
|
| `api-testing` | createMockContext, test patterns |
|
|
279
285
|
| `api-utils` | Formatting, parsing, security, pagination, scheduling, telemetry helpers |
|
|
@@ -294,9 +300,10 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
294
300
|
| `npm run rebuild` | Clean + build |
|
|
295
301
|
| `npm run clean` | Remove build artifacts |
|
|
296
302
|
| `npm run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
297
|
-
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, re-audit
|
|
303
|
+
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, and re-run `bun audit`. Use when `devcheck` flags a transitive advisory — Bun's `update` is sticky on transitive resolutions, so the advisory may be a stale-lockfile false positive. If it survives the refresh, it's real. |
|
|
298
304
|
| `npm run tree` | Generate directory structure doc |
|
|
299
|
-
| `npm run format` | Auto-fix formatting |
|
|
305
|
+
| `npm run format` | Auto-fix formatting (safe fixes only) |
|
|
306
|
+
| `npm run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
|
|
300
307
|
| `npm test` | Run tests |
|
|
301
308
|
| `npm run start:stdio` | Production mode (stdio) |
|
|
302
309
|
| `npm run start:http` | Production mode (HTTP) |
|
|
@@ -312,40 +319,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
312
319
|
|
|
313
320
|
**Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match.
|
|
314
321
|
|
|
315
|
-
**README install badges
|
|
316
|
-
|
|
317
|
-
| Client | Mechanism |
|
|
318
|
-
|:-------|:----------|
|
|
319
|
-
| Claude Desktop | Browser downloads the `.mcpb` from the latest GitHub Release; OS file handler routes it to Claude Desktop, which opens the install dialog. No deep-link URL scheme yet — this is the canonical path. |
|
|
320
|
-
| Cursor | Official `https://cursor.com/en/install-mcp` endpoint with base64 JSON config. |
|
|
321
|
-
| VS Code / Insiders | Official `vscode:mcp/install?...` deep link, wrapped in `https://vscode.dev/redirect?url=` so GitHub-rendered markdown doesn't strip the non-HTTP scheme. |
|
|
322
|
-
| Claude Code / Codex | CLI only (`claude mcp add` / `codex mcp add`); no URL scheme. |
|
|
323
|
-
|
|
324
|
-
```markdown
|
|
325
|
-
[](https://github.com/<OWNER>/<REPO>/releases/latest/download/<PACKAGE_NAME>.mcpb)
|
|
326
|
-
[](https://cursor.com/en/install-mcp?name=<PACKAGE_NAME>&config=<BASE64_CONFIG>)
|
|
327
|
-
[](https://vscode.dev/redirect?url=vscode:mcp/install?<URLENCODED_JSON>)
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
Both install links route through HTTPS endpoints (`cursor.com/en/install-mcp` and `vscode.dev/redirect`) — GitHub-rendered markdown strips non-HTTP URL schemes from anchors, so a raw `cursor://` or `vscode:` link won't click through from github.com.
|
|
331
|
-
|
|
332
|
-
Generate the encoded configs (replace `<PACKAGE_NAME>` and add env vars for any required API keys):
|
|
333
|
-
|
|
334
|
-
```bash
|
|
335
|
-
# Cursor: base64-encoded JSON. Split command/args, add env when keys are needed.
|
|
336
|
-
echo -n '{"command":"npx","args":["-y","<PACKAGE_NAME>"],"env":{"API_KEY":"your-api-key"}}' | base64
|
|
337
|
-
# Without env (no required keys):
|
|
338
|
-
echo -n '{"command":"npx","args":["-y","<PACKAGE_NAME>"]}' | base64
|
|
339
|
-
|
|
340
|
-
# VS Code: URL-encoded JSON. Same shape plus a `name` field.
|
|
341
|
-
node -p 'encodeURIComponent(JSON.stringify({name:"<SHORT_NAME>",command:"npx",args:["-y","<PACKAGE_NAME>"],env:{API_KEY:"your-api-key"}}))'
|
|
342
|
-
# Without env:
|
|
343
|
-
node -p 'encodeURIComponent(JSON.stringify({name:"<SHORT_NAME>",command:"npx",args:["-y","<PACKAGE_NAME>"]}))'
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
Both clients use the same `{command, args, env}` shape (matching `mcp.json` schema). VS Code adds a top-level `name` field. Omit `env` entirely when no API keys are needed — don't include empty objects or framework-only vars like `MCP_TRANSPORT_TYPE`.
|
|
347
|
-
|
|
348
|
-
The Claude Desktop badge requires the bundle to ship with a stable filename — `bun run bundle` outputs `dist/<PACKAGE_NAME>.mcpb`, and `release-and-publish` attaches that file to the GitHub Release. `releases/latest/download/<PACKAGE_NAME>.mcpb` then redirects to the most recent release.
|
|
322
|
+
**README install badges** (Claude Desktop `.mcpb`, Cursor, VS Code) and the `base64` / `encodeURIComponent` config-generation commands are ship-time concerns — run the `polish-docs-meta` skill, which carries the badge format, layout, and generation snippets in `skills/polish-docs-meta/references/readme.md`.
|
|
349
323
|
|
|
350
324
|
---
|
|
351
325
|
|
|
@@ -368,6 +342,8 @@ security: false # optional — true flags security fi
|
|
|
368
342
|
|
|
369
343
|
`breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section. When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
|
|
370
344
|
|
|
345
|
+
`agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections: new files to create, fields to populate, one-time migration steps. Omit entirely when there's nothing to say.
|
|
346
|
+
|
|
371
347
|
**Section order** (Keep a Changelog): Added, Changed, Deprecated, Removed, Fixed, Security. Include only sections with entries — don't ship empty headers.
|
|
372
348
|
|
|
373
349
|
**Tag annotations** render as GitHub Release bodies via `--notes-from-tag`. They must be structured markdown — never a flat comma-separated string. Subject omits the version number (GitHub prepends it). See `changelog/template.md` for the full format reference.
|
|
@@ -400,4 +376,7 @@ import { getMyService } from '@/services/my-domain/my-service.js';
|
|
|
400
376
|
- [ ] If wrapping external API: tests include at least one sparse payload case with omitted upstream fields
|
|
401
377
|
- [ ] Registered in `createApp()` arrays (directly or via barrel exports)
|
|
402
378
|
- [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
|
|
379
|
+
- [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = package name; `interface.shortDescription` from `package.json` description
|
|
380
|
+
- [ ] `.codex-plugin/mcp.json` updated — server name key matches `package.json` name; env vars added for any required API keys
|
|
381
|
+
- [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; inline `mcpServers` entry with server name key, env vars for any required API keys
|
|
403
382
|
- [ ] `npm run devcheck` passes
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/wikidata-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/wikidata-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,9 @@ await createApp({
|
|
|
26
26
|
],
|
|
27
27
|
resources: [wikidataEntityResource],
|
|
28
28
|
prompts: [],
|
|
29
|
+
// Public hosted-catalog server — serve full inventory to unauthenticated callers
|
|
30
|
+
// even when MCP_AUTH_MODE is jwt/oauth (0.9.13: default flipped to require auth).
|
|
31
|
+
landing: { requireAuth: false },
|
|
29
32
|
setup(core) {
|
|
30
33
|
initWikidataRestService(core.config, core.storage);
|
|
31
34
|
initWikidataSparqlService(core.config, core.storage);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB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mDAAmD,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AACvG,OAAO,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAE3F,MAAM,SAAS,CAAC;IACd,KAAK,EAAE;QACL,sBAAsB;QACtB,iBAAiB;QACjB,iBAAiB;QACjB,qBAAqB;QACrB,oBAAoB;QACpB,mBAAmB;QACnB,yBAAyB;KAC1B;IACD,SAAS,EAAE,CAAC,sBAAsB,CAAC;IACnC,OAAO,EAAE,EAAE;IACX,iFAAiF;IACjF,kFAAkF;IAClF,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAC/B,KAAK,CAAC,IAAI;QACR,uBAAuB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACnD,yBAAyB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @module mcp-server/resources/definitions/entity.resource
|
|
4
4
|
*/
|
|
5
5
|
import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
-
import {
|
|
6
|
+
import { notFound, validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { getWikidataRestService, isPId, isQId, normalizeId, } from '../../../services/wikidata/wikidata-rest-service.js';
|
|
8
8
|
export const wikidataEntityResource = resource('wikidata://entity/{id}', {
|
|
9
9
|
name: 'wikidata-entity',
|
|
@@ -17,7 +17,7 @@ export const wikidataEntityResource = resource('wikidata://entity/{id}', {
|
|
|
17
17
|
async handler(params, ctx) {
|
|
18
18
|
const id = normalizeId(params.id);
|
|
19
19
|
if (!isQId(id) && !isPId(id)) {
|
|
20
|
-
throw
|
|
20
|
+
throw validationError(`"${params.id}" is not a valid Wikidata ID. Expected Q+digits (e.g., Q76) or P+digits (e.g., P31).`, { id: params.id });
|
|
21
21
|
}
|
|
22
22
|
const svc = getWikidataRestService();
|
|
23
23
|
ctx.log.info('Fetching entity resource', { id });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/entity.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"entity.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/entity.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,sBAAsB,EACtB,KAAK,EACL,KAAK,EACL,WAAW,GACZ,MAAM,8CAA8C,CAAC;AAEtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC,wBAAwB,EAAE;IACvE,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,+EAA+E;QAC/E,iFAAiF;QACjF,wFAAwF;IAC1F,QAAQ,EAAE,eAAe;IACzB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yDAAyD,CAAC;KACnF,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,MAA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S,GAAG,CAAC,EAAE,CAAC;YAClB,KAAK,CAAC,IAAI,CAAC,mBAAmB,SAAS,aAAa,CAAC,CAAC;QACxD,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,mDAAmD,EAAE,EAAE,CAAC,CAAC;QAEpE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QACX,SAAS,EAAE;YACT;gBACE,GAAG,EAAE,uBAAuB;gBAC5B,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EAAE,2CAA2C;gBACxD,QAAQ,EAAE,eAAe;aAC1B;YACD;gBACE,GAAG,EAAE,uBAAuB;gBAC5B,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EAAE,4CAA4C;gBACzD,QAAQ,EAAE,eAAe;aAC1B;YACD;gBACE,GAAG,EAAE,uBAAuB;gBAC5B,IAAI,EAAE,mBAAmB;gBACzB,WAAW,EAAE,0CAA0C;gBACvD,QAAQ,EAAE,eAAe;aAC1B;SACF;KACF,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -34,5 +34,5 @@ export declare const wikidataGetEntity: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
34
34
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
35
35
|
readonly when: "ID format is not recognized as a Q-ID or P-ID.";
|
|
36
36
|
readonly recovery: "Supply a valid Q-ID (Q followed by digits, e.g. Q76) or P-ID (P followed by digits, e.g. P31).";
|
|
37
|
-
}]>;
|
|
37
|
+
}], undefined>;
|
|
38
38
|
//# sourceMappingURL=get-entity.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-entity.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-entity.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAUjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"get-entity.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-entity.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAUjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoP5B,CAAC"}
|
|
@@ -20,5 +20,5 @@ export declare const wikidataGetLabels: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
20
20
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
21
21
|
readonly when: "One or more IDs in the array are not valid Q-IDs or P-IDs.";
|
|
22
22
|
readonly recovery: "All IDs must match Q+digits or P+digits format (e.g., Q76, P31). Use wikidata_search_entities to find valid IDs.";
|
|
23
|
-
}]>;
|
|
23
|
+
}], undefined>;
|
|
24
24
|
//# sourceMappingURL=get-labels.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-labels.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-labels.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"get-labels.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-labels.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;cA6G5B,CAAC"}
|
|
@@ -27,5 +27,5 @@ export declare const wikidataGetSitelinks: import("@cyanheads/mcp-ts-core").Tool
|
|
|
27
27
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
28
28
|
readonly when: "A P-ID was supplied — only items (Q-IDs) have sitelinks.";
|
|
29
29
|
readonly recovery: "Supply a Q-ID (Q followed by digits). Properties do not have Wikipedia sitelinks.";
|
|
30
|
-
}]>;
|
|
30
|
+
}], undefined>;
|
|
31
31
|
//# sourceMappingURL=get-sitelinks.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-sitelinks.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-sitelinks.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"get-sitelinks.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-sitelinks.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;cAiK/B,CAAC"}
|
|
@@ -25,5 +25,5 @@ export declare const wikidataGetStatements: import("@cyanheads/mcp-ts-core").Too
|
|
|
25
25
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
26
26
|
readonly when: "ID is not a valid Q-ID or P-ID format.";
|
|
27
27
|
readonly recovery: "Supply a valid Q-ID (Q followed by digits) or P-ID (P followed by digits).";
|
|
28
|
-
}]>;
|
|
28
|
+
}], undefined>;
|
|
29
29
|
//# sourceMappingURL=get-statements.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-statements.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-statements.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAUjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"get-statements.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-statements.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAUjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;cAqLhC,CAAC"}
|
|
@@ -26,5 +26,5 @@ export declare const wikidataResolveExternalId: import("@cyanheads/mcp-ts-core")
|
|
|
26
26
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
27
27
|
readonly when: "Property ID is not in P+digits format.";
|
|
28
28
|
readonly recovery: "Supply a valid P-ID (P followed by digits, e.g. P356 for DOI).";
|
|
29
|
-
}]>;
|
|
29
|
+
}], undefined>;
|
|
30
30
|
//# sourceMappingURL=resolve-external-id.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-external-id.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/resolve-external-id.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA0BjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"resolve-external-id.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/resolve-external-id.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA0BjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;cAgMpC,CAAC"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* @module mcp-server/tools/definitions/search-entities.tool
|
|
4
4
|
*/
|
|
5
5
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
-
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
6
|
export declare const wikidataSearchEntities: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
7
|
query: z.ZodString;
|
|
9
8
|
type: z.ZodDefault<z.ZodEnum<{
|
|
@@ -23,14 +22,11 @@ export declare const wikidataSearchEntities: import("@cyanheads/mcp-ts-core").To
|
|
|
23
22
|
language: z.ZodString;
|
|
24
23
|
}, z.core.$strip>;
|
|
25
24
|
}, z.core.$strip>>;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
readonly
|
|
32
|
-
|
|
33
|
-
readonly when: "Search query returned zero matches.";
|
|
34
|
-
readonly recovery: "Try broader terms, alternate spellings, or switch between \"item\" and \"property\" types.";
|
|
35
|
-
}]>;
|
|
25
|
+
}, z.core.$strip>, undefined, {
|
|
26
|
+
readonly effectiveQuery: z.ZodString;
|
|
27
|
+
readonly searchType: z.ZodString;
|
|
28
|
+
readonly language: z.ZodString;
|
|
29
|
+
readonly resultCount: z.ZodNumber;
|
|
30
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}>;
|
|
36
32
|
//# sourceMappingURL=search-entities.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-entities.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-entities.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"search-entities.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-entities.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGjD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;EAkJjC,CAAC"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* @module mcp-server/tools/definitions/search-entities.tool
|
|
4
4
|
*/
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
-
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
6
|
import { getWikidataRestService } from '../../../services/wikidata/wikidata-rest-service.js';
|
|
8
7
|
export const wikidataSearchEntities = tool('wikidata_search_entities', {
|
|
9
8
|
title: 'Search Wikidata Entities',
|
|
@@ -61,22 +60,19 @@ export const wikidataSearchEntities = tool('wikidata_search_entities', {
|
|
|
61
60
|
})
|
|
62
61
|
.describe('A single search result with entity ID, label, description, and match metadata.'))
|
|
63
62
|
.describe('Ranked list of matching entities. Empty when no results found.'),
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
}),
|
|
64
|
+
// Agent-facing search context — the query as executed, type, language, pagination counts,
|
|
65
|
+
// and recovery guidance for empty results. Reaches both structuredContent and content[].
|
|
66
|
+
enrichment: {
|
|
67
|
+
effectiveQuery: z.string().describe('The search query that was executed.'),
|
|
68
|
+
searchType: z.string().describe('The entity type that was searched ("item" or "property").'),
|
|
66
69
|
language: z.string().describe('The language used for label and description display.'),
|
|
67
|
-
|
|
70
|
+
resultCount: z.number().describe('Number of results returned on this page.'),
|
|
71
|
+
notice: z
|
|
68
72
|
.string()
|
|
69
73
|
.optional()
|
|
70
|
-
.describe('Recovery hint when results are empty — suggests how to broaden
|
|
71
|
-
}
|
|
72
|
-
errors: [
|
|
73
|
-
{
|
|
74
|
-
reason: 'no_results',
|
|
75
|
-
code: JsonRpcErrorCode.NotFound,
|
|
76
|
-
when: 'Search query returned zero matches.',
|
|
77
|
-
recovery: 'Try broader terms, alternate spellings, or switch between "item" and "property" types.',
|
|
78
|
-
},
|
|
79
|
-
],
|
|
74
|
+
.describe('Recovery hint when results are empty — echoes filters and suggests how to broaden. Absent when results are present.'),
|
|
75
|
+
},
|
|
80
76
|
async handler(input, ctx) {
|
|
81
77
|
const svc = getWikidataRestService();
|
|
82
78
|
ctx.log.info('Searching Wikidata entities', {
|
|
@@ -96,25 +92,19 @@ export const wikidataSearchEntities = tool('wikidata_search_entities', {
|
|
|
96
92
|
language: r.match?.language ?? input.language,
|
|
97
93
|
},
|
|
98
94
|
}));
|
|
95
|
+
ctx.enrich({
|
|
96
|
+
effectiveQuery: input.query,
|
|
97
|
+
searchType: input.type,
|
|
98
|
+
language: input.language,
|
|
99
|
+
resultCount: results.length,
|
|
100
|
+
});
|
|
99
101
|
if (results.length === 0) {
|
|
100
|
-
|
|
101
|
-
results: [],
|
|
102
|
-
query: input.query,
|
|
103
|
-
type: input.type,
|
|
104
|
-
language: input.language,
|
|
105
|
-
message: `No ${input.type}s matched "${input.query}" in language "${input.language}". Try broader terms or a different language code.`,
|
|
106
|
-
};
|
|
102
|
+
ctx.enrich.notice(`No ${input.type}s matched "${input.query}" in language "${input.language}". Try broader terms or a different language code.`);
|
|
107
103
|
}
|
|
108
|
-
return { results
|
|
104
|
+
return { results };
|
|
109
105
|
},
|
|
110
106
|
format: (result) => {
|
|
111
|
-
const lines = [
|
|
112
|
-
`**Query:** ${result.query} | **Type:** ${result.type} | **Language:** ${result.language}`,
|
|
113
|
-
`**Results:** ${result.results.length}`,
|
|
114
|
-
];
|
|
115
|
-
if (result.message) {
|
|
116
|
-
lines.push(`\n> ${result.message}`);
|
|
117
|
-
}
|
|
107
|
+
const lines = [`**Results:** ${result.results.length}`];
|
|
118
108
|
for (const item of result.results) {
|
|
119
109
|
lines.push('');
|
|
120
110
|
lines.push(`## ${item.label || item.id}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-entities.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-entities.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"search-entities.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-entities.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AAEtF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,0BAA0B,EAAE;IACrE,KAAK,EAAE,0BAA0B;IACjC,WAAW,EACT,yGAAyG;QACzG,yEAAyE;QACzE,+GAA+G;QAC/G,+FAA+F;IACjG,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAExD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,yEAAyE,CAAC;QACtF,IAAI,EAAE,CAAC;aACJ,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;aAC1B,OAAO,CAAC,MAAM,CAAC;aACf,QAA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,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -11,7 +11,6 @@ export declare const wikidataSparqlQuery: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
11
11
|
}, z.core.$strip>, z.ZodObject<{
|
|
12
12
|
results: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodObject<{}, z.core.$loose>>>;
|
|
13
13
|
variables: z.ZodArray<z.ZodString>;
|
|
14
|
-
rowCount: z.ZodNumber;
|
|
15
14
|
truncated: z.ZodBoolean;
|
|
16
15
|
}, z.core.$strip>, readonly [{
|
|
17
16
|
readonly reason: "parse_error";
|
|
@@ -30,5 +29,8 @@ export declare const wikidataSparqlQuery: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
30
29
|
readonly when: "Wikidata SPARQL endpoint is rate-limited (60 req/min, 5 concurrent per IP).";
|
|
31
30
|
readonly retryable: true;
|
|
32
31
|
readonly recovery: "Wait 30–60 seconds before retrying. Reduce concurrent queries if running parallel requests.";
|
|
33
|
-
}]
|
|
32
|
+
}], {
|
|
33
|
+
readonly totalCount: z.ZodNumber;
|
|
34
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}>;
|
|
34
36
|
//# sourceMappingURL=sparql-query.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sparql-query.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/sparql-query.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"sparql-query.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/sparql-query.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2L9B,CAAC"}
|
|
@@ -45,12 +45,20 @@ export const wikidataSparqlQuery = tool('wikidata_sparql_query', {
|
|
|
45
45
|
z.record(z.string(), z.object({}).passthrough()))
|
|
46
46
|
.describe('Array of result bindings. Each row maps variable names to binding objects with { type, value, "xml:lang"?, datatype? } fields.'),
|
|
47
47
|
variables: z.array(z.string()).describe('Variable names returned by the SELECT clause.'),
|
|
48
|
-
rowCount: z.number().describe('Number of result rows.'),
|
|
49
48
|
truncated: z
|
|
50
49
|
.boolean()
|
|
51
50
|
.describe('True when the endpoint returned a partial result set due to server-side memory limits. ' +
|
|
52
51
|
'False when the full result was returned. Add a LIMIT clause to avoid truncation on large queries.'),
|
|
53
52
|
}),
|
|
53
|
+
// Agent-facing query context — row count and empty-result guidance. Reaches both
|
|
54
|
+
// structuredContent and content[] without consuming a format() entry.
|
|
55
|
+
enrichment: {
|
|
56
|
+
totalCount: z.number().describe('Number of result rows returned.'),
|
|
57
|
+
notice: z
|
|
58
|
+
.string()
|
|
59
|
+
.optional()
|
|
60
|
+
.describe('Recovery hint when no results returned — suggests checking query logic or broadening filters. Absent on non-empty results.'),
|
|
61
|
+
},
|
|
54
62
|
errors: [
|
|
55
63
|
{
|
|
56
64
|
reason: 'parse_error',
|
|
@@ -106,23 +114,25 @@ export const wikidataSparqlQuery = tool('wikidata_sparql_query', {
|
|
|
106
114
|
}
|
|
107
115
|
const bindings = response.results.bindings;
|
|
108
116
|
const variables = response.head.vars;
|
|
117
|
+
ctx.enrich.total(bindings.length);
|
|
118
|
+
if (bindings.length === 0) {
|
|
119
|
+
ctx.enrich.notice('No results returned. Check query logic or broaden filters.');
|
|
120
|
+
}
|
|
109
121
|
return {
|
|
110
122
|
results: bindings,
|
|
111
123
|
variables,
|
|
112
|
-
rowCount: bindings.length,
|
|
113
124
|
truncated: false,
|
|
114
125
|
};
|
|
115
126
|
},
|
|
116
127
|
format: (result) => {
|
|
117
128
|
const lines = [
|
|
118
|
-
`**Variables:** ${result.variables.join(', ')} | **
|
|
129
|
+
`**Variables:** ${result.variables.join(', ')} | **Truncated:** ${result.truncated}`,
|
|
119
130
|
];
|
|
120
|
-
if (result.
|
|
121
|
-
lines.push('\n> No results returned. Check query logic or broaden filters.');
|
|
131
|
+
if (result.results.length === 0) {
|
|
122
132
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
123
133
|
}
|
|
124
134
|
// Render as a simple table (first 20 rows)
|
|
125
|
-
const cap = Math.min(result.
|
|
135
|
+
const cap = Math.min(result.results.length, 20);
|
|
126
136
|
const header = result.variables.join(' | ');
|
|
127
137
|
const separator = result.variables.map(() => '---').join(' | ');
|
|
128
138
|
lines.push('');
|
|
@@ -142,8 +152,8 @@ export const wikidataSparqlQuery = tool('wikidata_sparql_query', {
|
|
|
142
152
|
});
|
|
143
153
|
lines.push(`| ${row.join(' | ')} |`);
|
|
144
154
|
}
|
|
145
|
-
if (result.
|
|
146
|
-
lines.push(`\n… ${result.
|
|
155
|
+
if (result.results.length > 20) {
|
|
156
|
+
lines.push(`\n… ${result.results.length - 20} more rows not shown.`);
|
|
147
157
|
}
|
|
148
158
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
149
159
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sparql-query.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/sparql-query.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAE1F,MAAM,CAAC,MAAM,mBAAmB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OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;gBACnC,IAAI,CAAC,GAAG;oBAAE,OAAO,EAAE,CAAC;gBACpB,MAAM,OAAO,GAAG,GAKf,CAAC;gBACF,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;qBAC9B,OAAO,CAAC,iCAAiC,EAAE,KAAK,CAAC;qBACjD,OAAO,CAAC,sCAAsC,EAAE,MAAM,CAAC,CAAC;gBAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnE,OAAO,GAAG,GAAG,GAAG,IAAI,EAAE,CAAC;YACzB,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;QAED,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE,uBAAuB,CAAC,CAAC;QACvE,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/wikidata-mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"mcpName": "io.github.cyanheads/wikidata-mcp-server",
|
|
5
5
|
"description": "Search and fetch Wikidata entities, execute SPARQL queries, and resolve external identifiers via MCP. STDIO or Streamable HTTP.",
|
|
6
6
|
"type": "module",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"audit:refresh": "rm -f bun.lock && bun install && bun audit",
|
|
19
19
|
"tree": "bun run scripts/tree.ts",
|
|
20
20
|
"list-skills": "bun run scripts/list-skills.ts",
|
|
21
|
-
"format": "biome check --write
|
|
21
|
+
"format": "biome check --write .",
|
|
22
|
+
"format:unsafe": "biome check --write --unsafe .",
|
|
22
23
|
"lint:mcp": "bun run scripts/lint-mcp.ts",
|
|
23
24
|
"lint:packaging": "bun run scripts/lint-packaging.ts",
|
|
24
25
|
"bundle": "bun run build && npx -y @anthropic-ai/mcpb pack . dist/wikidata-mcp-server.mcpb",
|
|
@@ -73,12 +74,12 @@
|
|
|
73
74
|
"access": "public"
|
|
74
75
|
},
|
|
75
76
|
"dependencies": {
|
|
76
|
-
"@cyanheads/mcp-ts-core": "^0.9.
|
|
77
|
+
"@cyanheads/mcp-ts-core": "^0.9.16",
|
|
77
78
|
"pino-pretty": "^13.1.3",
|
|
78
79
|
"zod": "^4.4.3"
|
|
79
80
|
},
|
|
80
81
|
"devDependencies": {
|
|
81
|
-
"@biomejs/biome": "^2.4.
|
|
82
|
+
"@biomejs/biome": "^2.4.16",
|
|
82
83
|
"@types/node": "^25.9.1",
|
|
83
84
|
"depcheck": "^1.4.7",
|
|
84
85
|
"ignore": "^7.0.5",
|
package/server.json
CHANGED
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"url": "https://wikidata.caseyjhand.com/mcp"
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
|
-
"version": "0.1.
|
|
15
|
+
"version": "0.1.9",
|
|
16
16
|
"packages": [
|
|
17
17
|
{
|
|
18
18
|
"registryType": "npm",
|
|
19
19
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
20
20
|
"identifier": "@cyanheads/wikidata-mcp-server",
|
|
21
21
|
"runtimeHint": "bun",
|
|
22
|
-
"version": "0.1.
|
|
22
|
+
"version": "0.1.9",
|
|
23
23
|
"packageArguments": [
|
|
24
24
|
{
|
|
25
25
|
"type": "positional",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
70
70
|
"identifier": "@cyanheads/wikidata-mcp-server",
|
|
71
71
|
"runtimeHint": "bun",
|
|
72
|
-
"version": "0.1.
|
|
72
|
+
"version": "0.1.9",
|
|
73
73
|
"packageArguments": [
|
|
74
74
|
{
|
|
75
75
|
"type": "positional",
|