@cyanheads/geonames-mcp-server 0.1.2 → 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.
- package/AGENTS.md +12 -12
- package/CLAUDE.md +12 -12
- package/Dockerfile +16 -7
- package/README.md +24 -20
- package/changelog/0.1.x/0.1.3.md +45 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/find-postal-codes.tool.d.ts +8 -5
- package/dist/mcp-server/tools/definitions/find-postal-codes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/find-postal-codes.tool.js +76 -39
- package/dist/mcp-server/tools/definitions/find-postal-codes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-children.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-children.tool.js +18 -12
- package/dist/mcp-server/tools/definitions/get-children.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-countries.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-countries.tool.js +20 -12
- package/dist/mcp-server/tools/definitions/get-countries.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-hierarchy.tool.js +3 -3
- package/dist/mcp-server/tools/definitions/get-hierarchy.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-place.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-place.tool.js +18 -9
- package/dist/mcp-server/tools/definitions/get-place.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +16 -4
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/list-reference.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/list-reference.tool.js +22 -12
- package/dist/mcp-server/tools/definitions/list-reference.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/reverse-geocode.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/reverse-geocode.tool.js +40 -26
- package/dist/mcp-server/tools/definitions/reverse-geocode.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-places.tool.d.ts +12 -2
- package/dist/mcp-server/tools/definitions/search-places.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-places.tool.js +107 -26
- package/dist/mcp-server/tools/definitions/search-places.tool.js.map +1 -1
- package/dist/mcp-server/tools/shared-inputs.d.ts +56 -18
- package/dist/mcp-server/tools/shared-inputs.d.ts.map +1 -1
- package/dist/mcp-server/tools/shared-inputs.js +86 -27
- package/dist/mcp-server/tools/shared-inputs.js.map +1 -1
- package/dist/services/geonames/country-codes.d.ts +7 -1
- package/dist/services/geonames/country-codes.d.ts.map +1 -1
- package/dist/services/geonames/country-codes.js +15 -1
- package/dist/services/geonames/country-codes.js.map +1 -1
- package/dist/services/geonames/geonames-service.d.ts +7 -3
- package/dist/services/geonames/geonames-service.d.ts.map +1 -1
- package/dist/services/geonames/geonames-service.js +85 -35
- package/dist/services/geonames/geonames-service.js.map +1 -1
- package/dist/services/geonames/response-parsers.d.ts +9 -5
- package/dist/services/geonames/response-parsers.d.ts.map +1 -1
- package/dist/services/geonames/response-parsers.js +102 -22
- package/dist/services/geonames/response-parsers.js.map +1 -1
- package/dist/services/geonames/types.d.ts +30 -13
- package/dist/services/geonames/types.d.ts.map +1 -1
- package/dist/services/geonames/types.js +4 -3
- package/dist/services/geonames/types.js.map +1 -1
- package/dist/utils/inline-text.d.ts +52 -12
- package/dist/utils/inline-text.d.ts.map +1 -1
- package/dist/utils/inline-text.js +129 -14
- package/dist/utils/inline-text.js.map +1 -1
- package/package.json +12 -12
- package/server.json +10 -24
|
@@ -1,25 +1,65 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Markdown-safe rendering of upstream-authored and caller-echoed text.
|
|
3
|
-
* GeoNames names, labels, and status text are community-edited, so `format()` and
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* GeoNames names, labels, and status text are community-edited, so `format()` and each
|
|
4
|
+
* `enrichmentTrailer` render print them, and the caller text echoed beside them, only
|
|
5
|
+
* through these helpers. Three mechanisms keep that text from opening a link, autolink,
|
|
6
|
+
* HTML tag, emphasis, code span, strikethrough, or character reference, or a block where it
|
|
7
|
+
* opens a line: a backslash before the markdown punctuation that would start one, `<` and
|
|
8
|
+
* `>` for `<` and `>`, and brackets around a bare URL's trigger (`https[:]//`,
|
|
9
|
+
* `www[.]`). The framework trailer prints enrichment verbatim, so a notice or
|
|
10
|
+
* `effectiveQuery` reaches `structuredContent` raw and is escaped only by its render. An
|
|
11
|
+
* error message is one string on both surfaces: the GeoNames text an
|
|
12
|
+
* `upstream_rejected_parameter` message forwards goes through {@link inlineText} as the
|
|
13
|
+
* message is composed, and the caller values other error messages echo are enum members,
|
|
14
|
+
* codes, and numbers that the schema has already limited to characters markdown does not
|
|
15
|
+
* read inside a line. Every other string reaches `structuredContent` as received, less the
|
|
16
|
+
* Unicode tag characters the service drops when it decodes a response.
|
|
17
|
+
*
|
|
18
|
+
* A slot takes its helper by where the text stands in its line:
|
|
19
|
+
* - after server-written text on the same line (a bold label's value, a value inside a
|
|
20
|
+
* composed sentence): {@link inlineText}; a markdown table cell: {@link tableCell};
|
|
21
|
+
* - at the start of a line's content (a heading, a list item, a block-quote line, a
|
|
22
|
+
* line of its own): {@link blockStartText};
|
|
23
|
+
* - a URL, in either position: {@link plainUrl}.
|
|
7
24
|
* @module utils/inline-text
|
|
8
25
|
*/
|
|
9
26
|
/**
|
|
10
|
-
* Renders text for
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
27
|
+
* Renders text for a slot inside a line, after server-written text: a bold label's value
|
|
28
|
+
* (`**Toponym name:** …`, and the `**effectiveQuery:** …` an `enrichmentTrailer` render
|
|
29
|
+
* writes) or a value inside a composed sentence. Line breaks become spaces, control and
|
|
30
|
+
* format characters are dropped, a bare URL's `://` or `www.` is bracketed
|
|
31
|
+
* (`https[:]//`, `www[.]`) so no renderer autolinks it, backslash is escaped, then a
|
|
32
|
+
* character reference's `&`, `[` `]`, `*`, `` ` ``, `~`, and every `_` not between two
|
|
33
|
+
* letters, digits, or marks, and `<` / `>` become entities. A block opens only at the
|
|
34
|
+
* start of a line, so `#`, `+`, `-`, ordinals, and spaces print as written (`#####`,
|
|
35
|
+
* `4. Wiener Gemeindebezirk`).
|
|
15
36
|
*/
|
|
16
37
|
export declare function inlineText(value: string): string;
|
|
17
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* {@link inlineText} for text that opens a line's content: a heading (`## …`), a list
|
|
40
|
+
* item (`- …`), a block-quote line (`> …`, the slot a notice's `enrichmentTrailer`
|
|
41
|
+
* render writes), or a line of its own. On top of the inline rules it drops the leading
|
|
42
|
+
* spaces, escapes a leading block marker (a `#` heading run, a `+` or `-` bullet, a line
|
|
43
|
+
* of dashes, or the `.` / `)` of a one-to-nine-digit ordinal), and escapes a closing `#`
|
|
44
|
+
* run, which a heading drops. `Route 4. North`, `4.5 Mile Creek`, and `#5 Mine` open no
|
|
45
|
+
* block and print as written.
|
|
46
|
+
*/
|
|
47
|
+
export declare function blockStartText(value: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* The `enrichmentTrailer` render for a `notice`: a block-quote line. The framework trailer
|
|
50
|
+
* prints values verbatim and `structuredContent` keeps the text as sent, so a notice that
|
|
51
|
+
* carries caller or GeoNames text is escaped here.
|
|
52
|
+
*/
|
|
53
|
+
export declare const renderNotice: (value: unknown) => string;
|
|
54
|
+
/** {@link inlineText} plus `|` escaped, for a markdown table cell, whose content is inline. */
|
|
18
55
|
export declare function tableCell(value: string): string;
|
|
19
56
|
/**
|
|
20
57
|
* Renders a URL as plain text, never as a markdown link. A scheme-less value
|
|
21
|
-
* (GeoNames' `wikipediaURL`) gets `https://`; an `http`/`https` URL prints with
|
|
22
|
-
*
|
|
58
|
+
* (GeoNames' `wikipediaURL`) gets `https://`; an `http`/`https` URL prints with unsafe
|
|
59
|
+
* characters, `*`, `~`, and underscores that could pair into emphasis percent-encoded, so
|
|
60
|
+
* it renders as written and still names the same resource; any other scheme prints as
|
|
61
|
+
* escaped text. The result starts with a scheme's first letter, so it takes no
|
|
62
|
+
* line-start escape at the start of a list item.
|
|
23
63
|
*/
|
|
24
64
|
export declare function plainUrl(value: string): string;
|
|
25
65
|
//# sourceMappingURL=inline-text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-text.d.ts","sourceRoot":"","sources":["../../src/utils/inline-text.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"inline-text.d.ts","sourceRoot":"","sources":["../../src/utils/inline-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAyGH;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAWhD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMpD;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,UAAW,OAAO,KAAG,MAA8C,CAAC;AAE7F,+FAA+F;AAC/F,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAY9C"}
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Markdown-safe rendering of upstream-authored and caller-echoed text.
|
|
3
|
-
* GeoNames names, labels, and status text are community-edited, so `format()` and
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* GeoNames names, labels, and status text are community-edited, so `format()` and each
|
|
4
|
+
* `enrichmentTrailer` render print them, and the caller text echoed beside them, only
|
|
5
|
+
* through these helpers. Three mechanisms keep that text from opening a link, autolink,
|
|
6
|
+
* HTML tag, emphasis, code span, strikethrough, or character reference, or a block where it
|
|
7
|
+
* opens a line: a backslash before the markdown punctuation that would start one, `<` and
|
|
8
|
+
* `>` for `<` and `>`, and brackets around a bare URL's trigger (`https[:]//`,
|
|
9
|
+
* `www[.]`). The framework trailer prints enrichment verbatim, so a notice or
|
|
10
|
+
* `effectiveQuery` reaches `structuredContent` raw and is escaped only by its render. An
|
|
11
|
+
* error message is one string on both surfaces: the GeoNames text an
|
|
12
|
+
* `upstream_rejected_parameter` message forwards goes through {@link inlineText} as the
|
|
13
|
+
* message is composed, and the caller values other error messages echo are enum members,
|
|
14
|
+
* codes, and numbers that the schema has already limited to characters markdown does not
|
|
15
|
+
* read inside a line. Every other string reaches `structuredContent` as received, less the
|
|
16
|
+
* Unicode tag characters the service drops when it decodes a response.
|
|
17
|
+
*
|
|
18
|
+
* A slot takes its helper by where the text stands in its line:
|
|
19
|
+
* - after server-written text on the same line (a bold label's value, a value inside a
|
|
20
|
+
* composed sentence): {@link inlineText}; a markdown table cell: {@link tableCell};
|
|
21
|
+
* - at the start of a line's content (a heading, a list item, a block-quote line, a
|
|
22
|
+
* line of its own): {@link blockStartText};
|
|
23
|
+
* - a URL, in either position: {@link plainUrl}.
|
|
7
24
|
* @module utils/inline-text
|
|
8
25
|
*/
|
|
9
26
|
/** CR, LF, tab, and the Unicode line and paragraph separators: flattened to a space. */
|
|
@@ -20,13 +37,83 @@ const AUTOLINK_TRIGGER = /(?<=https?|ftp):(?=\/\/)|(?<=www)\./giu;
|
|
|
20
37
|
const CHARACTER_REFERENCE = /&(?=#\d+;|#x[\da-f]+;|[a-z][a-z\d]*;)/giu;
|
|
21
38
|
/** Characters a plain-text URL percent-encodes so it cannot break out of its slot. */
|
|
22
39
|
const URL_UNSAFE = /[\s\p{Cc}\p{Cf}<>[\]\\|`"]/gu;
|
|
40
|
+
/** `*` and `~`, which emphasis and strikethrough read even inside a bare URL. */
|
|
41
|
+
const URL_DELIMITERS = /[*~]/g;
|
|
23
42
|
const SCHEME = /^([a-z][a-z0-9+.-]*):/i;
|
|
43
|
+
/** Link brackets and the emphasis, code-span, and strikethrough delimiters, escaped wherever they stand. */
|
|
44
|
+
const DELIMITERS = /[[\]*`~]/g;
|
|
45
|
+
/** A letter, digit, or combining mark. */
|
|
46
|
+
const WORD_CHAR = /[\p{L}\p{N}\p{M}]/u;
|
|
47
|
+
/** CommonMark punctuation: the Unicode P and S categories. */
|
|
48
|
+
const PUNCTUATION = /[\p{P}\p{S}]/u;
|
|
49
|
+
/** CommonMark whitespace, where the edge of the text (`''`) counts as whitespace. */
|
|
50
|
+
const isSpace = (char) => char === '' || /\s/u.test(char);
|
|
51
|
+
const isPunctuation = (char) => PUNCTUATION.test(char);
|
|
52
|
+
/** Spaces at the start: four or more open an indented code block, and fewer never render. */
|
|
53
|
+
const LEADING_SPACES = /^ +/;
|
|
24
54
|
/**
|
|
25
|
-
*
|
|
26
|
-
* line
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
55
|
+
* At the start: an ATX heading `#` run, a `+` or `-` bullet or empty item marker, or a
|
|
56
|
+
* line of dashes (a thematic break or setext underline).
|
|
57
|
+
*/
|
|
58
|
+
const LEADING_MARKER = /^(?=(?:#{1,6}|[+-])(?: |$)|-[- ]*$)/;
|
|
59
|
+
/** At the start: an ordered-list marker, one to nine digits then `.` or `)`. */
|
|
60
|
+
const LEADING_ORDINAL = /^(\d{1,9})([.)])(?= |$)/;
|
|
61
|
+
/** A run of `#` at the end, alone or after a space, which an ATX heading drops as its closing sequence. */
|
|
62
|
+
const CLOSING_HASHES = /(?<=^| )#+(?= *$)/;
|
|
63
|
+
/**
|
|
64
|
+
* The code points just before `start` and at `end`, each taken whole, so a letter
|
|
65
|
+
* outside the BMP counts as one (V8 misses a trailing astral code point under `[…]$`).
|
|
66
|
+
* The edge of the text reads as `''`.
|
|
67
|
+
*/
|
|
68
|
+
function neighbors(text, start, end) {
|
|
69
|
+
return [
|
|
70
|
+
[...text.slice(Math.max(0, start - 2), start)].at(-1) ?? '',
|
|
71
|
+
[...text.slice(end, end + 2)][0] ?? '',
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Escapes a run of underscores unless it stands between two letters, digits, or marks,
|
|
76
|
+
* where CommonMark never reads it as emphasis (`W14_01`, `America/Los_Angeles`).
|
|
77
|
+
*/
|
|
78
|
+
function escapeUnderscoreRun(run, offset, text) {
|
|
79
|
+
const [before, after] = neighbors(text, offset, offset + run.length);
|
|
80
|
+
return WORD_CHAR.test(before) && WORD_CHAR.test(after) ? run : run.replaceAll('_', '\\_');
|
|
81
|
+
}
|
|
82
|
+
/** Whether an underscore run between `before` and `after` can open or close emphasis, by CommonMark's flanking rules. */
|
|
83
|
+
function underscoreFlanking(before, after) {
|
|
84
|
+
const left = !isSpace(after) && (!isPunctuation(after) || isSpace(before) || isPunctuation(before));
|
|
85
|
+
const right = !isSpace(before) && (!isPunctuation(before) || isSpace(after) || isPunctuation(after));
|
|
86
|
+
return {
|
|
87
|
+
opens: left && (!right || isPunctuation(before)),
|
|
88
|
+
closes: right && (!left || isPunctuation(after)),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Percent-encodes a URL's underscore runs when one can open emphasis and a later one can
|
|
93
|
+
* close it, the only way they render as emphasis; otherwise every underscore stays
|
|
94
|
+
* (`Springfield,_Illinois`, `Paris_(Texas)`). `%5F` names the same resource as `_`.
|
|
95
|
+
*/
|
|
96
|
+
function encodeEmphasisUnderscores(url) {
|
|
97
|
+
const runs = [...url.matchAll(/_+/g)].map(({ 0: run, index }) => underscoreFlanking(...neighbors(url, index, index + run.length)));
|
|
98
|
+
const opener = runs.findIndex(({ opens }) => opens);
|
|
99
|
+
if (opener === -1 || !runs.slice(opener + 1).some(({ closes }) => closes))
|
|
100
|
+
return url;
|
|
101
|
+
let next = 0;
|
|
102
|
+
return url.replace(/_+/g, (run) => {
|
|
103
|
+
const flanking = runs[next++];
|
|
104
|
+
return flanking?.opens || flanking?.closes ? '%5F'.repeat(run.length) : run;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Renders text for a slot inside a line, after server-written text: a bold label's value
|
|
109
|
+
* (`**Toponym name:** …`, and the `**effectiveQuery:** …` an `enrichmentTrailer` render
|
|
110
|
+
* writes) or a value inside a composed sentence. Line breaks become spaces, control and
|
|
111
|
+
* format characters are dropped, a bare URL's `://` or `www.` is bracketed
|
|
112
|
+
* (`https[:]//`, `www[.]`) so no renderer autolinks it, backslash is escaped, then a
|
|
113
|
+
* character reference's `&`, `[` `]`, `*`, `` ` ``, `~`, and every `_` not between two
|
|
114
|
+
* letters, digits, or marks, and `<` / `>` become entities. A block opens only at the
|
|
115
|
+
* start of a line, so `#`, `+`, `-`, ordinals, and spaces print as written (`#####`,
|
|
116
|
+
* `4. Wiener Gemeindebezirk`).
|
|
30
117
|
*/
|
|
31
118
|
export function inlineText(value) {
|
|
32
119
|
return value
|
|
@@ -35,18 +122,44 @@ export function inlineText(value) {
|
|
|
35
122
|
.replace(AUTOLINK_TRIGGER, '[$&]')
|
|
36
123
|
.replace(/\\/g, '\\\\')
|
|
37
124
|
.replace(CHARACTER_REFERENCE, '\\&')
|
|
38
|
-
.replace(
|
|
125
|
+
.replace(DELIMITERS, '\\$&')
|
|
126
|
+
.replace(/_+/g, escapeUnderscoreRun)
|
|
39
127
|
.replace(/</g, '<')
|
|
40
128
|
.replace(/>/g, '>');
|
|
41
129
|
}
|
|
42
|
-
/**
|
|
130
|
+
/**
|
|
131
|
+
* {@link inlineText} for text that opens a line's content: a heading (`## …`), a list
|
|
132
|
+
* item (`- …`), a block-quote line (`> …`, the slot a notice's `enrichmentTrailer`
|
|
133
|
+
* render writes), or a line of its own. On top of the inline rules it drops the leading
|
|
134
|
+
* spaces, escapes a leading block marker (a `#` heading run, a `+` or `-` bullet, a line
|
|
135
|
+
* of dashes, or the `.` / `)` of a one-to-nine-digit ordinal), and escapes a closing `#`
|
|
136
|
+
* run, which a heading drops. `Route 4. North`, `4.5 Mile Creek`, and `#5 Mine` open no
|
|
137
|
+
* block and print as written.
|
|
138
|
+
*/
|
|
139
|
+
export function blockStartText(value) {
|
|
140
|
+
return inlineText(value)
|
|
141
|
+
.replace(LEADING_SPACES, '')
|
|
142
|
+
.replace(LEADING_MARKER, '\\')
|
|
143
|
+
.replace(LEADING_ORDINAL, '$1\\$2')
|
|
144
|
+
.replace(CLOSING_HASHES, '\\$&');
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The `enrichmentTrailer` render for a `notice`: a block-quote line. The framework trailer
|
|
148
|
+
* prints values verbatim and `structuredContent` keeps the text as sent, so a notice that
|
|
149
|
+
* carries caller or GeoNames text is escaped here.
|
|
150
|
+
*/
|
|
151
|
+
export const renderNotice = (value) => `> ${blockStartText(String(value))}`;
|
|
152
|
+
/** {@link inlineText} plus `|` escaped, for a markdown table cell, whose content is inline. */
|
|
43
153
|
export function tableCell(value) {
|
|
44
154
|
return inlineText(value).replace(/\|/g, '\\|');
|
|
45
155
|
}
|
|
46
156
|
/**
|
|
47
157
|
* Renders a URL as plain text, never as a markdown link. A scheme-less value
|
|
48
|
-
* (GeoNames' `wikipediaURL`) gets `https://`; an `http`/`https` URL prints with
|
|
49
|
-
*
|
|
158
|
+
* (GeoNames' `wikipediaURL`) gets `https://`; an `http`/`https` URL prints with unsafe
|
|
159
|
+
* characters, `*`, `~`, and underscores that could pair into emphasis percent-encoded, so
|
|
160
|
+
* it renders as written and still names the same resource; any other scheme prints as
|
|
161
|
+
* escaped text. The result starts with a scheme's first letter, so it takes no
|
|
162
|
+
* line-start escape at the start of a list item.
|
|
50
163
|
*/
|
|
51
164
|
export function plainUrl(value) {
|
|
52
165
|
const trimmed = value.trim();
|
|
@@ -55,6 +168,8 @@ export function plainUrl(value) {
|
|
|
55
168
|
return tableCell(trimmed);
|
|
56
169
|
}
|
|
57
170
|
const url = scheme === undefined ? `https://${trimmed}` : trimmed;
|
|
58
|
-
return url
|
|
171
|
+
return encodeEmphasisUnderscores(url
|
|
172
|
+
.replace(URL_UNSAFE, (char) => encodeURIComponent(char))
|
|
173
|
+
.replace(URL_DELIMITERS, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`));
|
|
59
174
|
}
|
|
60
175
|
//# sourceMappingURL=inline-text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-text.js","sourceRoot":"","sources":["../../src/utils/inline-text.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"inline-text.js","sourceRoot":"","sources":["../../src/utils/inline-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,wFAAwF;AACxF,MAAM,WAAW,GAAG,4BAA4B,CAAC;AAEjD;;;;GAIG;AACH,MAAM,SAAS,GAAG,wCAAwC,CAAC;AAE3D,mGAAmG;AACnG,MAAM,gBAAgB,GAAG,wCAAwC,CAAC;AAElE,wFAAwF;AACxF,MAAM,mBAAmB,GAAG,0CAA0C,CAAC;AAEvE,sFAAsF;AACtF,MAAM,UAAU,GAAG,8BAA8B,CAAC;AAElD,iFAAiF;AACjF,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,MAAM,MAAM,GAAG,wBAAwB,CAAC;AAExC,4GAA4G;AAC5G,MAAM,UAAU,GAAG,WAAW,CAAC;AAE/B,0CAA0C;AAC1C,MAAM,SAAS,GAAG,oBAAoB,CAAC;AAEvC,8DAA8D;AAC9D,MAAM,WAAW,GAAG,eAAe,CAAC;AAEpC,qFAAqF;AACrF,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClE,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAE/D,6FAA6F;AAC7F,MAAM,cAAc,GAAG,K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IAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IACxD,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACpE,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IAClE,OAAO,yBAAyB,CAC9B,GAAG;SACA,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;SACvD,OAAO,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAC1F,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/geonames-mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"mcpName": "io.github.cyanheads/geonames-mcp-server",
|
|
5
5
|
"description": "Search GeoNames places, walk admin hierarchies, reverse geocode, get postal codes and country info via MCP. STDIO or Streamable HTTP.",
|
|
6
6
|
"type": "module",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"url": "https://github.com/cyanheads/geonames-mcp-server/issues"
|
|
71
71
|
},
|
|
72
72
|
"license": "Apache-2.0",
|
|
73
|
-
"packageManager": "bun@1.4.
|
|
73
|
+
"packageManager": "bun@1.4.3",
|
|
74
74
|
"engines": {
|
|
75
75
|
"bun": ">=1.4.0",
|
|
76
76
|
"node": ">=24.0.0"
|
|
@@ -79,22 +79,22 @@
|
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@cyanheads/mcp-ts-core": "^0.13.
|
|
83
|
-
"pino-pretty": "^13.
|
|
84
|
-
"zod": "^4.6.
|
|
82
|
+
"@cyanheads/mcp-ts-core": "^0.13.15",
|
|
83
|
+
"pino-pretty": "^13.2.0",
|
|
84
|
+
"zod": "^4.6.7"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@biomejs/biome": "2.5.
|
|
88
|
-
"@modelcontextprotocol/server": "^2.
|
|
87
|
+
"@biomejs/biome": "2.5.15",
|
|
88
|
+
"@modelcontextprotocol/server": "^2.3.1",
|
|
89
89
|
"@socketsecurity/bun-security-scanner": "^1.1.3",
|
|
90
|
-
"@types/node": "26.6.
|
|
91
|
-
"@vitest/coverage-istanbul": "5.0.
|
|
90
|
+
"@types/node": "26.6.5",
|
|
91
|
+
"@vitest/coverage-istanbul": "5.0.4",
|
|
92
92
|
"depcheck": "^1.4.7",
|
|
93
93
|
"fast-check": "^4.10.2",
|
|
94
|
-
"ignore": "^7.0.
|
|
95
|
-
"tsc-alias": "^1.9.
|
|
94
|
+
"ignore": "^7.0.12",
|
|
95
|
+
"tsc-alias": "^1.9.7",
|
|
96
96
|
"typescript": "^7.0.2",
|
|
97
|
-
"vitest": "^5.0.
|
|
97
|
+
"vitest": "^5.0.4"
|
|
98
98
|
},
|
|
99
99
|
"author": "Casey Hand <casey@caseyjhand.com> (https://caseyjhand.com)",
|
|
100
100
|
"funding": [
|
package/server.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"url": "https://github.com/cyanheads/geonames-mcp-server",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.1.
|
|
10
|
+
"version": "0.1.3",
|
|
11
11
|
"remotes": [
|
|
12
12
|
{
|
|
13
13
|
"type": "streamable-http",
|
|
@@ -19,18 +19,8 @@
|
|
|
19
19
|
"registryType": "npm",
|
|
20
20
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
21
21
|
"identifier": "@cyanheads/geonames-mcp-server",
|
|
22
|
-
"runtimeHint": "
|
|
23
|
-
"version": "0.1.
|
|
24
|
-
"packageArguments": [
|
|
25
|
-
{
|
|
26
|
-
"type": "positional",
|
|
27
|
-
"value": "run"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"type": "positional",
|
|
31
|
-
"value": "start:stdio"
|
|
32
|
-
}
|
|
33
|
-
],
|
|
22
|
+
"runtimeHint": "npx",
|
|
23
|
+
"version": "0.1.3",
|
|
34
24
|
"environmentVariables": [
|
|
35
25
|
{
|
|
36
26
|
"name": "GEONAMES_USERNAME",
|
|
@@ -55,19 +45,15 @@
|
|
|
55
45
|
"registryType": "npm",
|
|
56
46
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
57
47
|
"identifier": "@cyanheads/geonames-mcp-server",
|
|
58
|
-
"runtimeHint": "
|
|
59
|
-
"version": "0.1.
|
|
60
|
-
"
|
|
48
|
+
"runtimeHint": "npx",
|
|
49
|
+
"version": "0.1.3",
|
|
50
|
+
"environmentVariables": [
|
|
61
51
|
{
|
|
62
|
-
"
|
|
63
|
-
"
|
|
52
|
+
"name": "MCP_TRANSPORT_TYPE",
|
|
53
|
+
"description": "Selects the HTTP transport.",
|
|
54
|
+
"format": "string",
|
|
55
|
+
"value": "http"
|
|
64
56
|
},
|
|
65
|
-
{
|
|
66
|
-
"type": "positional",
|
|
67
|
-
"value": "start:http"
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"environmentVariables": [
|
|
71
57
|
{
|
|
72
58
|
"name": "GEONAMES_USERNAME",
|
|
73
59
|
"description": "GeoNames account used when a call passes no geonamesUsername. Free accounts must enable free web services on their geonames.org account page.",
|