mikser-io-mcp 11.2.0 → 11.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +22 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -118,7 +118,13 @@ const ICON_URL = 'https://raw.githubusercontent.com/almero-digital-marketing/mik
|
|
|
118
118
|
// What this server calls itself in the initialize response. Exported so it
|
|
119
119
|
// can be asserted on without reaching into the SDK's private state — the
|
|
120
120
|
// values are ours; that they survive the SDK is what the live check covers.
|
|
121
|
-
|
|
121
|
+
// Who a client thinks it is talking to. `overrides` exists because not every
|
|
122
|
+
// route is mikser talking to a developer: an endpoint serving a SITE's apps to
|
|
123
|
+
// that site's visitors should show the site's name and the site's icon, not
|
|
124
|
+
// mikser's mark — the engine is not the brand on that surface. Overriding
|
|
125
|
+
// `icons` REPLACES the list rather than adding to it, so a caller can also say
|
|
126
|
+
// "no icon" with `icons: []` and not inherit ours.
|
|
127
|
+
export function serverImplementation(overrides = {}) {
|
|
122
128
|
return {
|
|
123
129
|
name: 'mikser-io',
|
|
124
130
|
// `name` is the programmatic identifier; `title` is what a UI shows.
|
|
@@ -130,6 +136,7 @@ export function serverImplementation() {
|
|
|
130
136
|
{ src: ICON_DATA_URI, mimeType: 'image/svg+xml', sizes: ['any'] },
|
|
131
137
|
],
|
|
132
138
|
websiteUrl: 'https://github.com/almero-digital-marketing/mikser-io',
|
|
139
|
+
...overrides,
|
|
133
140
|
}
|
|
134
141
|
}
|
|
135
142
|
|
|
@@ -420,7 +427,15 @@ export function createMcpSubstrate() {
|
|
|
420
427
|
// Filter on the URI since that's the addressable identifier
|
|
421
428
|
// (`mikser://lifecycle` reads more naturally as the filter
|
|
422
429
|
// target than the short `mikser-lifecycle` name).
|
|
423
|
-
|
|
430
|
+
// A ResourceTemplate registration has an object here, not a
|
|
431
|
+
// string, and its addressable identity is the PATTERN — the same
|
|
432
|
+
// thing a client sees in resources/templates/list. Falling back to
|
|
433
|
+
// the registration's name meant a URI-shaped filter silently
|
|
434
|
+
// dropped every template, which is how mikser-io-mcp-app's data
|
|
435
|
+
// surface came out missing from its own endpoint.
|
|
436
|
+
const uri = typeof args[1] === 'string'
|
|
437
|
+
? args[1]
|
|
438
|
+
: (args[1]?.uriTemplate?.toString?.() ?? args[0])
|
|
424
439
|
if (!matchesAny(uri, allowedResources)) continue
|
|
425
440
|
// Metadata sits at args[2] only in the 4-argument static-URI
|
|
426
441
|
// form, which is the one a scoped registration uses.
|
|
@@ -587,9 +602,9 @@ export function createMcpSubstrate() {
|
|
|
587
602
|
// allowedResources: ['mikser://lifecycle', 'mikser://logs/*']
|
|
588
603
|
// Omit a filter (or pass '*') to allow everything in that
|
|
589
604
|
// category — that's the backward-compat default.
|
|
590
|
-
createServer({ allowedTools, allowedResources, allowedPrompts, endpoint = null } = {}) {
|
|
605
|
+
createServer({ allowedTools, allowedResources, allowedPrompts, endpoint = null, serverInfo } = {}) {
|
|
591
606
|
const server = new McpServer(
|
|
592
|
-
serverImplementation(),
|
|
607
|
+
serverImplementation(serverInfo),
|
|
593
608
|
{ capabilities: { tools: {}, resources: {}, logging: {} } },
|
|
594
609
|
)
|
|
595
610
|
serverEndpoints.set(server, endpoint)
|
|
@@ -623,7 +638,7 @@ export function createMcpSubstrate() {
|
|
|
623
638
|
// `endpoints: ['<name>']` matches, so the caller's tools bind here and
|
|
624
639
|
// nowhere else. Pass `tools` / `resources` / `prompts` to additionally
|
|
625
640
|
// filter what of the SHARED surface this route exposes.
|
|
626
|
-
mountEndpoint({ name, path, auth, token, allowRemote, tools, resources, prompts } = {}) {
|
|
641
|
+
mountEndpoint({ name, path, auth, token, allowRemote, tools, resources, prompts, serverInfo } = {}) {
|
|
627
642
|
if (!name) {
|
|
628
643
|
throw new Error('mountEndpoint: `name` is required — it is what endpoint-scoped registrations match and what the route is labelled with.')
|
|
629
644
|
}
|
|
@@ -635,7 +650,7 @@ export function createMcpSubstrate() {
|
|
|
635
650
|
throw new Error(`mountEndpoint(${name}): requires runtime.options.app — run mikser with --server.`)
|
|
636
651
|
}
|
|
637
652
|
const at = path ?? `/${name}`
|
|
638
|
-
mountEndpointOn(app, this, at, { auth, token, allowRemote, tools, resources, prompts }, name)
|
|
653
|
+
mountEndpointOn(app, this, at, { auth, token, allowRemote, tools, resources, prompts, serverInfo }, name)
|
|
639
654
|
return { name, path: at }
|
|
640
655
|
},
|
|
641
656
|
attach(server) {
|
|
@@ -1518,6 +1533,7 @@ function mountEndpointOn(app, substrate, path, ep, endpointName) {
|
|
|
1518
1533
|
allowedResources: ep.resources,
|
|
1519
1534
|
allowedPrompts: ep.prompts,
|
|
1520
1535
|
endpoint: endpointName,
|
|
1536
|
+
serverInfo: ep.serverInfo,
|
|
1521
1537
|
})
|
|
1522
1538
|
const transport = new StreamableHTTPServerTransport({
|
|
1523
1539
|
sessionIdGenerator: () => randomUUID(),
|
package/package.json
CHANGED