@cyanheads/wikipedia-mcp-server 0.1.3

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.
Files changed (56) hide show
  1. package/AGENTS.md +394 -0
  2. package/CLAUDE.md +394 -0
  3. package/Dockerfile +99 -0
  4. package/LICENSE +201 -0
  5. package/README.md +294 -0
  6. package/changelog/0.1.x/0.1.0.md +18 -0
  7. package/changelog/0.1.x/0.1.1.md +22 -0
  8. package/changelog/0.1.x/0.1.2.md +13 -0
  9. package/changelog/0.1.x/0.1.3.md +31 -0
  10. package/changelog/template.md +119 -0
  11. package/dist/config/server-config.d.ts +13 -0
  12. package/dist/config/server-config.d.ts.map +1 -0
  13. package/dist/config/server-config.js +25 -0
  14. package/dist/config/server-config.js.map +1 -0
  15. package/dist/index.d.ts +7 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +25 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/mcp-server/tools/definitions/index.d.ts +168 -0
  20. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
  21. package/dist/mcp-server/tools/definitions/index.js +19 -0
  22. package/dist/mcp-server/tools/definitions/index.js.map +1 -0
  23. package/dist/mcp-server/tools/definitions/wikipedia-get-article.tool.d.ts +34 -0
  24. package/dist/mcp-server/tools/definitions/wikipedia-get-article.tool.d.ts.map +1 -0
  25. package/dist/mcp-server/tools/definitions/wikipedia-get-article.tool.js +153 -0
  26. package/dist/mcp-server/tools/definitions/wikipedia-get-article.tool.js.map +1 -0
  27. package/dist/mcp-server/tools/definitions/wikipedia-get-languages.tool.d.ts +35 -0
  28. package/dist/mcp-server/tools/definitions/wikipedia-get-languages.tool.d.ts.map +1 -0
  29. package/dist/mcp-server/tools/definitions/wikipedia-get-languages.tool.js +105 -0
  30. package/dist/mcp-server/tools/definitions/wikipedia-get-languages.tool.js.map +1 -0
  31. package/dist/mcp-server/tools/definitions/wikipedia-get-sections.tool.d.ts +37 -0
  32. package/dist/mcp-server/tools/definitions/wikipedia-get-sections.tool.d.ts.map +1 -0
  33. package/dist/mcp-server/tools/definitions/wikipedia-get-sections.tool.js +109 -0
  34. package/dist/mcp-server/tools/definitions/wikipedia-get-sections.tool.js.map +1 -0
  35. package/dist/mcp-server/tools/definitions/wikipedia-get-summary.tool.d.ts +30 -0
  36. package/dist/mcp-server/tools/definitions/wikipedia-get-summary.tool.d.ts.map +1 -0
  37. package/dist/mcp-server/tools/definitions/wikipedia-get-summary.tool.js +107 -0
  38. package/dist/mcp-server/tools/definitions/wikipedia-get-summary.tool.js.map +1 -0
  39. package/dist/mcp-server/tools/definitions/wikipedia-search-nearby.tool.d.ts +42 -0
  40. package/dist/mcp-server/tools/definitions/wikipedia-search-nearby.tool.d.ts.map +1 -0
  41. package/dist/mcp-server/tools/definitions/wikipedia-search-nearby.tool.js +127 -0
  42. package/dist/mcp-server/tools/definitions/wikipedia-search-nearby.tool.js.map +1 -0
  43. package/dist/mcp-server/tools/definitions/wikipedia-search.tool.d.ts +32 -0
  44. package/dist/mcp-server/tools/definitions/wikipedia-search.tool.d.ts.map +1 -0
  45. package/dist/mcp-server/tools/definitions/wikipedia-search.tool.js +91 -0
  46. package/dist/mcp-server/tools/definitions/wikipedia-search.tool.js.map +1 -0
  47. package/dist/services/wikipedia/types.d.ts +110 -0
  48. package/dist/services/wikipedia/types.d.ts.map +1 -0
  49. package/dist/services/wikipedia/types.js +6 -0
  50. package/dist/services/wikipedia/types.js.map +1 -0
  51. package/dist/services/wikipedia/wikipedia-service.d.ts +81 -0
  52. package/dist/services/wikipedia/wikipedia-service.d.ts.map +1 -0
  53. package/dist/services/wikipedia/wikipedia-service.js +577 -0
  54. package/dist/services/wikipedia/wikipedia-service.js.map +1 -0
  55. package/package.json +86 -0
  56. package/server.json +99 -0
@@ -0,0 +1,119 @@
1
+ ---
2
+ # FORMAT REFERENCE — do not edit. Copy this file to
3
+ # `changelog/<major.minor>.x/<version>.md` (e.g. `changelog/0.8.x/0.8.6.md`)
4
+ # to author a new release. Set that file's H1 to `# <version> — YYYY-MM-DD`
5
+ # with a concrete date.
6
+
7
+ # Required. One-line GitHub Release-style headline. 350 character cap.
8
+ # Default short and scannable. Don't pad, don't stitch unrelated changes with
9
+ # semicolons — pick the headline. Quotes required: unquoted YAML treats `: `
10
+ # inside the value as a key separator and fails GitHub's strict parser.
11
+ summary: ""
12
+
13
+ # Set `true` when consumers must change code to upgrade: API removals,
14
+ # signature changes, config renames, behavior changes that break existing
15
+ # usage. Flagged as `Breaking` in the rollup.
16
+ breaking: false
17
+
18
+ # Set `true` if this release contains any security fix. Pairs with the
19
+ # `## Security` section below. Flagged as `Security` in the rollup so
20
+ # users can triage upgrade urgency at a glance.
21
+ security: false
22
+ ---
23
+
24
+ # <version> — YYYY-MM-DD
25
+
26
+ <!--
27
+ AUTHORING GUIDE — applies to the new per-version file you create from this
28
+ template.
29
+
30
+ Audience: someone scanning release notes to decide what affects them. Lead
31
+ each bullet with the symbol or concept name in **bold** so they can skip
32
+ what's irrelevant and zoom in on what's not.
33
+
34
+ Tone: terse, fact-dense, not verbose. Default to one sentence per bullet —
35
+ name the symbol, state what changed, stop. Use a second sentence only when
36
+ it carries weight. If a bullet feels long, it is.
37
+
38
+ Cut: mechanism walkthroughs (those belong in JSDoc, AGENTS.md, or the
39
+ relevant skill), ceremonial framings ("This release introduces…",
40
+ backwards-compat paragraphs), file-by-file test enumerations, internal
41
+ implementation notes. Prefer code/symbol names over English re-explanations.
42
+
43
+ Narrative intro: skip by default. Add one short sentence only when the
44
+ release theme genuinely needs framing the bullets can't carry.
45
+
46
+ Sections: Keep a Changelog order — Added, Changed, Deprecated, Removed,
47
+ Fixed, Security. Include only sections with entries; delete the rest
48
+ (including the commented-out scaffolding below). Don't ship empty headers.
49
+
50
+ Include: every distinct fact a reader needs to adopt or audit the release —
51
+ new exports, signatures, lint rule IDs, env vars, breaking changes, version
52
+ bumps on shipped skills. Nothing more.
53
+
54
+ Links: link issues, PRs, docs, or skills where they help a reader jump to
55
+ context. Once per item per entry — don't re-link the same issue in summary,
56
+ narrative, and bullet. Skip links for inline symbol names; code spans speak
57
+ for themselves.
58
+
59
+ Issue/PR URLs: use full URLs. GitHub's bare `#NN` auto-link only resolves
60
+ inside its own UI, not in npm reads or local editors.
61
+
62
+ [#38](https://github.com/cyanheads/mcp-ts-core/issues/38) ← issue
63
+ [#42](https://github.com/cyanheads/mcp-ts-core/pull/42) ← PR
64
+
65
+ Verify numbers exist before linking (`gh issue view NN`, `gh pr view NN`).
66
+ Never speculate on a future number — `#42` for an upcoming PR silently
67
+ resolves to whatever real item already owns 42, and timeline previews pull
68
+ in that unrelated item's metadata.
69
+
70
+ TAG ANNOTATIONS — the annotated tag body renders as the GitHub Release body
71
+ via `gh release create --notes-from-tag`. The tag is a derivative of this
72
+ changelog entry — a condensed, scannable version, not a copy. Format:
73
+
74
+ <theme — omit version number, GitHub prepends it>
75
+ ← blank line
76
+ <1-2 sentence context: what this release does>
77
+ ← blank line
78
+ Dependency bumps: ← section header
79
+ ← blank line
80
+ - `@cyanheads/mcp-ts-core` ^0.9.1 → ^0.9.6 ← bullet
81
+ ← blank line
82
+ Changed: ← only sections with entries
83
+ ← blank line
84
+ - `format()` output includes `query` in text mode
85
+ ← blank line
86
+ Added:
87
+ ← blank line
88
+ - `manifest.json` scaffolded for MCPB bundle support
89
+ - Install badges (Claude Desktop, Cursor, VS Code)
90
+ ← blank line
91
+ <N> tests pass; `bun run devcheck` clean. ← footer
92
+
93
+ Never a flat comma-separated string. Always structured markdown with
94
+ sections. The tag must scan well as a rendered GitHub Release page.
95
+ -->
96
+
97
+ ## Added
98
+
99
+ -
100
+
101
+ ## Changed
102
+
103
+ -
104
+
105
+ <!-- ## Deprecated
106
+
107
+ - -->
108
+
109
+ <!-- ## Removed
110
+
111
+ - -->
112
+
113
+ ## Fixed
114
+
115
+ -
116
+
117
+ <!-- ## Security
118
+
119
+ - -->
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @fileoverview Server-specific configuration for wikipedia-mcp-server.
3
+ * @module config/server-config
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ declare const ServerConfigSchema: z.ZodObject<{
7
+ baseUrl: z.ZodDefault<z.ZodString>;
8
+ userAgent: z.ZodDefault<z.ZodString>;
9
+ }, z.core.$strip>;
10
+ export type ServerConfig = z.infer<typeof ServerConfigSchema>;
11
+ export declare function getServerConfig(): ServerConfig;
12
+ export {};
13
+ //# sourceMappingURL=server-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;;iBAStB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,wBAAgB,eAAe,IAAI,YAAY,CAM9C"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @fileoverview Server-specific configuration for wikipedia-mcp-server.
3
+ * @module config/server-config
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
7
+ const ServerConfigSchema = z.object({
8
+ baseUrl: z
9
+ .string()
10
+ .default('https://en.wikipedia.org')
11
+ .describe('Base Wikipedia URL — language selection is per-call, not global'),
12
+ userAgent: z
13
+ .string()
14
+ .default('wikipedia-mcp-server/0.1.3 (https://github.com/cyanheads/wikipedia-mcp-server)')
15
+ .describe('User-Agent header sent with every request per Wikimedia policy'),
16
+ });
17
+ let _config;
18
+ export function getServerConfig() {
19
+ _config ??= parseEnvConfig(ServerConfigSchema, {
20
+ baseUrl: 'WIKIPEDIA_BASE_URL',
21
+ userAgent: 'WIKIPEDIA_USER_AGENT',
22
+ });
23
+ return _config;
24
+ }
25
+ //# sourceMappingURL=server-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,OAAO,CAAC,0BAA0B,CAAC;SACnC,QAAQ,CAAC,iEAAiE,CAAC;IAC9E,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,OAAO,CAAC,gFAAgF,CAAC;SACzF,QAAQ,CAAC,gEAAgE,CAAC;CAC9E,CAAC,CAAC;AAIH,IAAI,OAAiC,CAAC;AAEtC,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,OAAO,EAAE,oBAAoB;QAC7B,SAAS,EAAE,sBAAsB;KAClC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @fileoverview wikipedia-mcp-server MCP server entry point.
4
+ * @module index
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG"}
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @fileoverview wikipedia-mcp-server MCP server entry point.
4
+ * @module index
5
+ */
6
+ import { createApp } from '@cyanheads/mcp-ts-core';
7
+ import { getServerConfig } from './config/server-config.js';
8
+ import { allToolDefinitions } from './mcp-server/tools/definitions/index.js';
9
+ import { initWikipediaService } from './services/wikipedia/wikipedia-service.js';
10
+ await createApp({
11
+ tools: allToolDefinitions,
12
+ resources: [],
13
+ prompts: [],
14
+ instructions: `Wikipedia MCP server providing encyclopedic context via the MediaWiki REST API and Action API.
15
+ - Use wikipedia_get_summary for "what is X?" lookups (90% of cases) — returns the lead section, Wikidata QID, and thumbnail.
16
+ - Use wikipedia_search when the exact article title is unknown.
17
+ - Use wikipedia_get_sections then wikipedia_get_article with section_index for targeted section reads — much smaller than full articles.
18
+ - All tools support a language parameter (default "en") for multi-language workflows.
19
+ - wikipedia_get_summary returns page_type: "disambiguation" for disambiguation pages — follow up with wikipedia_search.`,
20
+ setup(core) {
21
+ const serverConfig = getServerConfig();
22
+ initWikipediaService(core.config, core.storage, serverConfig.userAgent);
23
+ },
24
+ });
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,MAAM,SAAS,CAAC;IACd,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,YAAY,EAAE;;;;;wHAKwG;IACtH,KAAK,CAAC,IAAI;QACR,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;QACvC,oBAAoB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAC1E,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,168 @@
1
+ /**
2
+ * @fileoverview Barrel export for all tool definitions.
3
+ * @module mcp-server/tools/definitions/index
4
+ */
5
+ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
6
+ title: import("zod").ZodString;
7
+ section_index: import("zod").ZodOptional<import("zod").ZodNumber>;
8
+ language: import("zod").ZodDefault<import("zod").ZodString>;
9
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
10
+ title: import("zod").ZodString;
11
+ pageid: import("zod").ZodOptional<import("zod").ZodNumber>;
12
+ content: import("zod").ZodString;
13
+ section_title: import("zod").ZodOptional<import("zod").ZodString>;
14
+ content_type: import("zod").ZodString;
15
+ language: import("zod").ZodString;
16
+ }, import("zod/v4/core").$strip>, readonly [{
17
+ readonly reason: "not_found";
18
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
19
+ readonly when: "No Wikipedia article exists for the given title.";
20
+ readonly recovery: "Use wikipedia_search to discover the correct article title and try again.";
21
+ }, {
22
+ readonly reason: "invalid_section";
23
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
24
+ readonly when: "The section_index is out of range for this article.";
25
+ readonly recovery: "Call wikipedia_get_sections first to obtain valid section_index values.";
26
+ }, {
27
+ readonly reason: "invalid_language";
28
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
29
+ readonly when: "The language code is not a valid BCP 47 code.";
30
+ readonly recovery: "Use a valid BCP 47 language code such as \"fr\", \"de\", or \"ja\".";
31
+ }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
32
+ title: import("zod").ZodString;
33
+ language: import("zod").ZodDefault<import("zod").ZodString>;
34
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
35
+ source_title: import("zod").ZodString;
36
+ source_language: import("zod").ZodString;
37
+ languages: import("zod").ZodArray<import("zod").ZodObject<{
38
+ language_code: import("zod").ZodString;
39
+ title: import("zod").ZodString;
40
+ url: import("zod").ZodString;
41
+ }, import("zod/v4/core").$strip>>;
42
+ total_languages: import("zod").ZodNumber;
43
+ }, import("zod/v4/core").$strip>, readonly [{
44
+ readonly reason: "not_found";
45
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
46
+ readonly when: "No Wikipedia article exists for the title in the specified language.";
47
+ readonly recovery: "Use wikipedia_search to discover the correct article title and try again.";
48
+ }, {
49
+ readonly reason: "no_other_languages";
50
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
51
+ readonly when: "Article exists but has no other language editions.";
52
+ readonly recovery: "The article may be too new or too regional to have been translated yet.";
53
+ }, {
54
+ readonly reason: "invalid_language";
55
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
56
+ readonly when: "The language code is not a valid BCP 47 code.";
57
+ readonly recovery: "Use a valid BCP 47 language code such as \"fr\", \"de\", or \"ja\".";
58
+ }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
59
+ title: import("zod").ZodString;
60
+ language: import("zod").ZodDefault<import("zod").ZodString>;
61
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
62
+ title: import("zod").ZodString;
63
+ pageid: import("zod").ZodOptional<import("zod").ZodNumber>;
64
+ sections: import("zod").ZodArray<import("zod").ZodObject<{
65
+ index: import("zod").ZodNumber;
66
+ number: import("zod").ZodString;
67
+ title: import("zod").ZodString;
68
+ level: import("zod").ZodNumber;
69
+ }, import("zod/v4/core").$strip>>;
70
+ total_sections: import("zod").ZodNumber;
71
+ language: import("zod").ZodString;
72
+ }, import("zod/v4/core").$strip>, readonly [{
73
+ readonly reason: "not_found";
74
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
75
+ readonly when: "No Wikipedia article exists for the given title.";
76
+ readonly recovery: "Use wikipedia_search to discover the correct article title and try again.";
77
+ }, {
78
+ readonly reason: "no_sections";
79
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
80
+ readonly when: "Article exists but has no sections (stub or very short article).";
81
+ readonly recovery: "Use wikipedia_get_article without section_index to read the full short article.";
82
+ }, {
83
+ readonly reason: "invalid_language";
84
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
85
+ readonly when: "The language code is not a valid BCP 47 code.";
86
+ readonly recovery: "Use a valid BCP 47 language code such as \"fr\", \"de\", or \"ja\".";
87
+ }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
88
+ title: import("zod").ZodString;
89
+ language: import("zod").ZodDefault<import("zod").ZodString>;
90
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
91
+ title: import("zod").ZodString;
92
+ page_type: import("zod").ZodString;
93
+ pageid: import("zod").ZodOptional<import("zod").ZodNumber>;
94
+ wikibase_item: import("zod").ZodOptional<import("zod").ZodString>;
95
+ description: import("zod").ZodOptional<import("zod").ZodString>;
96
+ extract: import("zod").ZodString;
97
+ thumbnail_url: import("zod").ZodOptional<import("zod").ZodString>;
98
+ language: import("zod").ZodString;
99
+ }, import("zod/v4/core").$strip>, readonly [{
100
+ readonly reason: "not_found";
101
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
102
+ readonly when: "No Wikipedia article exists for the given title.";
103
+ readonly recovery: "Use wikipedia_search to discover the correct article title and try again.";
104
+ }, {
105
+ readonly reason: "invalid_language";
106
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
107
+ readonly when: "The language code is not a valid BCP 47 code.";
108
+ readonly recovery: "Use a valid BCP 47 language code such as \"fr\", \"de\", or \"ja\".";
109
+ }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
110
+ query: import("zod").ZodString;
111
+ limit: import("zod").ZodDefault<import("zod").ZodNumber>;
112
+ language: import("zod").ZodDefault<import("zod").ZodString>;
113
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
114
+ results: import("zod").ZodArray<import("zod").ZodObject<{
115
+ title: import("zod").ZodString;
116
+ pageid: import("zod").ZodNumber;
117
+ snippet: import("zod").ZodString;
118
+ wordcount: import("zod").ZodNumber;
119
+ }, import("zod/v4/core").$strip>>;
120
+ total_results: import("zod").ZodNumber;
121
+ query_used: import("zod").ZodString;
122
+ language: import("zod").ZodString;
123
+ }, import("zod/v4/core").$strip>, readonly [{
124
+ readonly reason: "no_results";
125
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
126
+ readonly when: "Search returned zero results for the query.";
127
+ readonly recovery: "Broaden the query or try different keywords and search again.";
128
+ }, {
129
+ readonly reason: "invalid_language";
130
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
131
+ readonly when: "The language code is not a valid BCP 47 code.";
132
+ readonly recovery: "Use a valid BCP 47 language code such as \"fr\", \"de\", or \"ja\".";
133
+ }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
134
+ latitude: import("zod").ZodNumber;
135
+ longitude: import("zod").ZodNumber;
136
+ radius_meters: import("zod").ZodDefault<import("zod").ZodNumber>;
137
+ limit: import("zod").ZodDefault<import("zod").ZodNumber>;
138
+ language: import("zod").ZodDefault<import("zod").ZodString>;
139
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
140
+ results: import("zod").ZodArray<import("zod").ZodObject<{
141
+ title: import("zod").ZodString;
142
+ pageid: import("zod").ZodNumber;
143
+ latitude: import("zod").ZodNumber;
144
+ longitude: import("zod").ZodNumber;
145
+ distance_meters: import("zod").ZodNumber;
146
+ }, import("zod/v4/core").$strip>>;
147
+ total_results: import("zod").ZodNumber;
148
+ query_latitude: import("zod").ZodNumber;
149
+ query_longitude: import("zod").ZodNumber;
150
+ radius_meters_used: import("zod").ZodNumber;
151
+ language: import("zod").ZodString;
152
+ }, import("zod/v4/core").$strip>, readonly [{
153
+ readonly reason: "no_results";
154
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
155
+ readonly when: "No geotagged articles found within the search radius.";
156
+ readonly recovery: "Increase radius_meters or verify the coordinates are correct and retry.";
157
+ }, {
158
+ readonly reason: "invalid_coordinates";
159
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
160
+ readonly when: "Latitude or longitude is outside valid WGS 84 range.";
161
+ readonly recovery: "Latitude must be between −90 and 90; longitude between −180 and 180.";
162
+ }, {
163
+ readonly reason: "invalid_language";
164
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
165
+ readonly when: "The language code is not a valid BCP 47 code.";
166
+ readonly recovery: "Use a valid BCP 47 language code such as \"fr\", \"de\", or \"ja\".";
167
+ }]>)[];
168
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAO9B,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @fileoverview Barrel export for all tool definitions.
3
+ * @module mcp-server/tools/definitions/index
4
+ */
5
+ import { wikipediaGetArticle } from './wikipedia-get-article.tool.js';
6
+ import { wikipediaGetLanguages } from './wikipedia-get-languages.tool.js';
7
+ import { wikipediaGetSections } from './wikipedia-get-sections.tool.js';
8
+ import { wikipediaGetSummary } from './wikipedia-get-summary.tool.js';
9
+ import { wikipediaSearch } from './wikipedia-search.tool.js';
10
+ import { wikipediaSearchNearby } from './wikipedia-search-nearby.tool.js';
11
+ export const allToolDefinitions = [
12
+ wikipediaSearch,
13
+ wikipediaGetSummary,
14
+ wikipediaGetArticle,
15
+ wikipediaGetSections,
16
+ wikipediaSearchNearby,
17
+ wikipediaGetLanguages,
18
+ ];
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,eAAe;IACf,mBAAmB;IACnB,mBAAmB;IACnB,oBAAoB;IACpB,qBAAqB;IACrB,qBAAqB;CACtB,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @fileoverview wikipedia_get_article tool — fetch article content as clean plain text.
3
+ * @module mcp-server/tools/definitions/wikipedia-get-article.tool
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
+ export declare const wikipediaGetArticle: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
8
+ title: z.ZodString;
9
+ section_index: z.ZodOptional<z.ZodNumber>;
10
+ language: z.ZodDefault<z.ZodString>;
11
+ }, z.core.$strip>, z.ZodObject<{
12
+ title: z.ZodString;
13
+ pageid: z.ZodOptional<z.ZodNumber>;
14
+ content: z.ZodString;
15
+ section_title: z.ZodOptional<z.ZodString>;
16
+ content_type: z.ZodString;
17
+ language: z.ZodString;
18
+ }, z.core.$strip>, readonly [{
19
+ readonly reason: "not_found";
20
+ readonly code: JsonRpcErrorCode.NotFound;
21
+ readonly when: "No Wikipedia article exists for the given title.";
22
+ readonly recovery: "Use wikipedia_search to discover the correct article title and try again.";
23
+ }, {
24
+ readonly reason: "invalid_section";
25
+ readonly code: JsonRpcErrorCode.InvalidParams;
26
+ readonly when: "The section_index is out of range for this article.";
27
+ readonly recovery: "Call wikipedia_get_sections first to obtain valid section_index values.";
28
+ }, {
29
+ readonly reason: "invalid_language";
30
+ readonly code: JsonRpcErrorCode.InvalidParams;
31
+ readonly when: "The language code is not a valid BCP 47 code.";
32
+ readonly recovery: "Use a valid BCP 47 language code such as \"fr\", \"de\", or \"ja\".";
33
+ }]>;
34
+ //# sourceMappingURL=wikipedia-get-article.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wikipedia-get-article.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/wikipedia-get-article.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAG3E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;GAkK9B,CAAC"}
@@ -0,0 +1,153 @@
1
+ /**
2
+ * @fileoverview wikipedia_get_article tool — fetch article content as clean plain text.
3
+ * @module mcp-server/tools/definitions/wikipedia-get-article.tool
4
+ */
5
+ import { tool, z } from '@cyanheads/mcp-ts-core';
6
+ import { JsonRpcErrorCode, McpError } from '@cyanheads/mcp-ts-core/errors';
7
+ import { getWikipediaService } from '../../../services/wikipedia/wikipedia-service.js';
8
+ export const wikipediaGetArticle = tool('wikipedia_get_article', {
9
+ title: 'Get Wikipedia Article',
10
+ description: 'Fetch article content as clean plain text. Without section_index: returns the full article with == Section == markers preserved for structure. With section_index (from wikipedia_get_sections): returns just that section as plain text. Section-targeted reads are faster and smaller when only part of the article is needed.',
11
+ annotations: { readOnlyHint: true, openWorldHint: true },
12
+ input: z.object({
13
+ title: z.string().describe('Article title (e.g. "Python (programming language)").'),
14
+ section_index: z
15
+ .number()
16
+ .optional()
17
+ .describe('Section index from wikipedia_get_sections. Omit for the full article. Providing this returns only the targeted section as plain text.'),
18
+ language: z
19
+ .string()
20
+ .default('en')
21
+ .describe('Wikipedia language edition code (default "en"). Examples: "fr", "de", "ja".'),
22
+ }),
23
+ output: z.object({
24
+ title: z.string().describe('Resolved article title.'),
25
+ pageid: z
26
+ .number()
27
+ .optional()
28
+ .describe('Wikipedia page ID. Absent on API parse responses that omit it.'),
29
+ content: z
30
+ .string()
31
+ .describe('Plain-text article content. Full articles include == Section == markers.'),
32
+ section_title: z
33
+ .string()
34
+ .optional()
35
+ .describe('Section title when section_index was provided. Absent for full-article reads.'),
36
+ content_type: z.string().describe('Content type: "full_article" or "section".'),
37
+ language: z.string().describe('Language edition queried.'),
38
+ }),
39
+ errors: [
40
+ {
41
+ reason: 'not_found',
42
+ code: JsonRpcErrorCode.NotFound,
43
+ when: 'No Wikipedia article exists for the given title.',
44
+ recovery: 'Use wikipedia_search to discover the correct article title and try again.',
45
+ },
46
+ {
47
+ reason: 'invalid_section',
48
+ code: JsonRpcErrorCode.InvalidParams,
49
+ when: 'The section_index is out of range for this article.',
50
+ recovery: 'Call wikipedia_get_sections first to obtain valid section_index values.',
51
+ },
52
+ {
53
+ reason: 'invalid_language',
54
+ code: JsonRpcErrorCode.InvalidParams,
55
+ when: 'The language code is not a valid BCP 47 code.',
56
+ recovery: 'Use a valid BCP 47 language code such as "fr", "de", or "ja".',
57
+ },
58
+ ],
59
+ async handler(input, ctx) {
60
+ const { language } = input;
61
+ // Validate language code eagerly so the contract reason appears in data.reason.
62
+ if (!/^[a-z]{2,3}(-[a-z0-9]+)*$/i.test(language)) {
63
+ throw ctx.fail('invalid_language', `Invalid language code "${language}". Use a BCP 47 language code such as "fr", "de", or "ja".`, { language, ...ctx.recoveryFor('invalid_language') });
64
+ }
65
+ // Reject section_index < 1 — indices start at 1 (wikipedia_get_sections output).
66
+ // Index 0 refers to the lead section (wikitext parsing returns templates/infoboxes, not
67
+ // readable text); negative values are nonsensical and leak a raw API error.
68
+ // Full-article reads handle the lead via the extracts API.
69
+ if (input.section_index != null && input.section_index < 1) {
70
+ throw ctx.fail('invalid_section', `section_index ${input.section_index} is not valid. Section indices start at 1 (use wikipedia_get_sections to discover valid values). To read the lead section, omit section_index entirely.`, {
71
+ sectionIndex: input.section_index,
72
+ recovery: {
73
+ hint: 'Use wikipedia_get_sections to get valid indices (starting at 1). Omit section_index to read the full article including its lead section.',
74
+ },
75
+ });
76
+ }
77
+ const svc = getWikipediaService();
78
+ if (input.section_index != null) {
79
+ // Section-targeted path: wikitext + stripping
80
+ ctx.log.info('Fetching article section', {
81
+ title: input.title,
82
+ sectionIndex: input.section_index,
83
+ language,
84
+ });
85
+ let result;
86
+ try {
87
+ result = await svc.getArticleSection(input.title, input.section_index, language, ctx);
88
+ }
89
+ catch (err) {
90
+ if (err instanceof McpError && err.code === JsonRpcErrorCode.NotFound) {
91
+ throw ctx.fail('not_found', err.message, {
92
+ title: input.title,
93
+ language,
94
+ recovery: { hint: 'Use wikipedia_search to find the correct article title.' },
95
+ });
96
+ }
97
+ throw err;
98
+ }
99
+ ctx.log.info('Section fetched', {
100
+ title: result.title,
101
+ sectionTitle: result.sectionTitle,
102
+ contentLength: result.content.length,
103
+ });
104
+ return {
105
+ title: result.title,
106
+ pageid: result.pageid,
107
+ content: result.content,
108
+ section_title: result.sectionTitle,
109
+ content_type: 'section',
110
+ language,
111
+ };
112
+ }
113
+ // Full-article path
114
+ ctx.log.info('Fetching full article', { title: input.title, language });
115
+ let result;
116
+ try {
117
+ result = await svc.getArticleFull(input.title, language, ctx);
118
+ }
119
+ catch (err) {
120
+ if (err instanceof McpError && err.code === JsonRpcErrorCode.NotFound) {
121
+ throw ctx.fail('not_found', err.message, {
122
+ title: input.title,
123
+ language,
124
+ recovery: { hint: 'Use wikipedia_search to find the correct article title.' },
125
+ });
126
+ }
127
+ throw err;
128
+ }
129
+ ctx.log.info('Article fetched', {
130
+ title: result.title,
131
+ contentLength: result.content.length,
132
+ });
133
+ return {
134
+ title: result.title,
135
+ pageid: result.pageid,
136
+ content: result.content,
137
+ content_type: 'full_article',
138
+ language,
139
+ };
140
+ },
141
+ format: (result) => {
142
+ const lines = [];
143
+ lines.push(`# ${result.title}`);
144
+ lines.push(`**Type:** ${result.content_type} | **Language:** ${result.language}` +
145
+ (result.pageid != null ? ` | **Page ID:** ${result.pageid}` : ''));
146
+ if (result.section_title)
147
+ lines.push(`**Section:** ${result.section_title}`);
148
+ lines.push('');
149
+ lines.push(result.content);
150
+ return [{ type: 'text', text: lines.join('\n') }];
151
+ },
152
+ });
153
+ //# sourceMappingURL=wikipedia-get-article.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wikipedia-get-article.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/wikipedia-get-article.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAEhF,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,uBAAuB,EAAE;IAC/D,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EACT,kUAAkU;IACpU,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IACxD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;QACnF,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,uIAAuI,CACxI;QACH,QAAQ,EAAE,CAAC;aACR,MAA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AAC,IAAI,CAAC,iBAAiB,EAAE;YAC9B,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM;SACrC,CAAC,CAAC;QACH,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,YAAY,EAAE,cAAc;YAC5B,QAAQ;SACT,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;QACjB,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAChC,KAAK,CAAC,IAAI,CACR,aAAa,MAAM,CAAC,YAAY,oBAAoB,MAAM,CAAC,QAAQ,EAAE;YACnE,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,mBAAmB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACpE,CAAC;QACF,IAAI,MAAM,CAAC,aAAa;YAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;QAC7E,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @fileoverview wikipedia_get_languages tool — list language editions available for a Wikipedia article.
3
+ * @module mcp-server/tools/definitions/wikipedia-get-languages.tool
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
+ export declare const wikipediaGetLanguages: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
8
+ title: z.ZodString;
9
+ language: z.ZodDefault<z.ZodString>;
10
+ }, z.core.$strip>, z.ZodObject<{
11
+ source_title: z.ZodString;
12
+ source_language: z.ZodString;
13
+ languages: z.ZodArray<z.ZodObject<{
14
+ language_code: z.ZodString;
15
+ title: z.ZodString;
16
+ url: z.ZodString;
17
+ }, z.core.$strip>>;
18
+ total_languages: z.ZodNumber;
19
+ }, z.core.$strip>, readonly [{
20
+ readonly reason: "not_found";
21
+ readonly code: JsonRpcErrorCode.NotFound;
22
+ readonly when: "No Wikipedia article exists for the title in the specified language.";
23
+ readonly recovery: "Use wikipedia_search to discover the correct article title and try again.";
24
+ }, {
25
+ readonly reason: "no_other_languages";
26
+ readonly code: JsonRpcErrorCode.NotFound;
27
+ readonly when: "Article exists but has no other language editions.";
28
+ readonly recovery: "The article may be too new or too regional to have been translated yet.";
29
+ }, {
30
+ readonly reason: "invalid_language";
31
+ readonly code: JsonRpcErrorCode.InvalidParams;
32
+ readonly when: "The language code is not a valid BCP 47 code.";
33
+ readonly recovery: "Use a valid BCP 47 language code such as \"fr\", \"de\", or \"ja\".";
34
+ }]>;
35
+ //# sourceMappingURL=wikipedia-get-languages.tool.d.ts.map