@modelcontextprotocol/server-sheet-music 1.2.2 → 1.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/dist/mcp-app.html +27 -27
- package/dist/server.js +41 -37
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -51678,8 +51678,8 @@ class j {
|
|
|
51678
51678
|
sessionId;
|
|
51679
51679
|
setProtocolVersion;
|
|
51680
51680
|
}
|
|
51681
|
-
var
|
|
51682
|
-
var
|
|
51681
|
+
var g = exports_external.union([exports_external.literal("light"), exports_external.literal("dark")]).describe("Color theme preference for the host environment.");
|
|
51682
|
+
var G = exports_external.union([exports_external.literal("inline"), exports_external.literal("fullscreen"), exports_external.literal("pip")]).describe("Display mode for UI presentation.");
|
|
51683
51683
|
var i = exports_external.union([exports_external.literal("--color-background-primary"), exports_external.literal("--color-background-secondary"), exports_external.literal("--color-background-tertiary"), exports_external.literal("--color-background-inverse"), exports_external.literal("--color-background-ghost"), exports_external.literal("--color-background-info"), exports_external.literal("--color-background-danger"), exports_external.literal("--color-background-success"), exports_external.literal("--color-background-warning"), exports_external.literal("--color-background-disabled"), exports_external.literal("--color-text-primary"), exports_external.literal("--color-text-secondary"), exports_external.literal("--color-text-tertiary"), exports_external.literal("--color-text-inverse"), exports_external.literal("--color-text-ghost"), exports_external.literal("--color-text-info"), exports_external.literal("--color-text-danger"), exports_external.literal("--color-text-success"), exports_external.literal("--color-text-warning"), exports_external.literal("--color-text-disabled"), exports_external.literal("--color-border-primary"), exports_external.literal("--color-border-secondary"), exports_external.literal("--color-border-tertiary"), exports_external.literal("--color-border-inverse"), exports_external.literal("--color-border-ghost"), exports_external.literal("--color-border-info"), exports_external.literal("--color-border-danger"), exports_external.literal("--color-border-success"), exports_external.literal("--color-border-warning"), exports_external.literal("--color-border-disabled"), exports_external.literal("--color-ring-primary"), exports_external.literal("--color-ring-secondary"), exports_external.literal("--color-ring-inverse"), exports_external.literal("--color-ring-info"), exports_external.literal("--color-ring-danger"), exports_external.literal("--color-ring-success"), exports_external.literal("--color-ring-warning"), exports_external.literal("--font-sans"), exports_external.literal("--font-mono"), exports_external.literal("--font-weight-normal"), exports_external.literal("--font-weight-medium"), exports_external.literal("--font-weight-semibold"), exports_external.literal("--font-weight-bold"), exports_external.literal("--font-text-xs-size"), exports_external.literal("--font-text-sm-size"), exports_external.literal("--font-text-md-size"), exports_external.literal("--font-text-lg-size"), exports_external.literal("--font-heading-xs-size"), exports_external.literal("--font-heading-sm-size"), exports_external.literal("--font-heading-md-size"), exports_external.literal("--font-heading-lg-size"), exports_external.literal("--font-heading-xl-size"), exports_external.literal("--font-heading-2xl-size"), exports_external.literal("--font-heading-3xl-size"), exports_external.literal("--font-text-xs-line-height"), exports_external.literal("--font-text-sm-line-height"), exports_external.literal("--font-text-md-line-height"), exports_external.literal("--font-text-lg-line-height"), exports_external.literal("--font-heading-xs-line-height"), exports_external.literal("--font-heading-sm-line-height"), exports_external.literal("--font-heading-md-line-height"), exports_external.literal("--font-heading-lg-line-height"), exports_external.literal("--font-heading-xl-line-height"), exports_external.literal("--font-heading-2xl-line-height"), exports_external.literal("--font-heading-3xl-line-height"), exports_external.literal("--border-radius-xs"), exports_external.literal("--border-radius-sm"), exports_external.literal("--border-radius-md"), exports_external.literal("--border-radius-lg"), exports_external.literal("--border-radius-xl"), exports_external.literal("--border-radius-full"), exports_external.literal("--border-width-regular"), exports_external.literal("--shadow-hairline"), exports_external.literal("--shadow-sm"), exports_external.literal("--shadow-md"), exports_external.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming.");
|
|
51684
51684
|
var o = exports_external.record(i.describe(`Style variables for theming MCP apps.
|
|
51685
51685
|
|
|
@@ -51714,15 +51714,16 @@ var t = exports_external.object({ method: exports_external.literal("ui/notificat
|
|
|
51714
51714
|
var A = exports_external.object({ method: exports_external.literal("ui/notifications/tool-input"), params: exports_external.object({ arguments: exports_external.record(exports_external.string(), exports_external.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.") }) });
|
|
51715
51715
|
var P = exports_external.object({ method: exports_external.literal("ui/notifications/tool-input-partial"), params: exports_external.object({ arguments: exports_external.record(exports_external.string(), exports_external.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).") }) });
|
|
51716
51716
|
var H = exports_external.object({ method: exports_external.literal("ui/notifications/tool-cancelled"), params: exports_external.object({ reason: exports_external.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").') }) });
|
|
51717
|
-
var
|
|
51718
|
-
var
|
|
51717
|
+
var S = exports_external.object({ fonts: exports_external.string().optional() });
|
|
51718
|
+
var y = exports_external.object({ variables: o.optional().describe("CSS variables for theming the app."), css: S.optional().describe("CSS blocks that apps can inject.") });
|
|
51719
51719
|
var _ = exports_external.object({ method: exports_external.literal("ui/resource-teardown"), params: exports_external.object({}) });
|
|
51720
51720
|
var e = exports_external.record(exports_external.string(), exports_external.unknown());
|
|
51721
51721
|
var q = exports_external.object({ text: exports_external.object({}).optional().describe("Host supports text content blocks."), image: exports_external.object({}).optional().describe("Host supports image content blocks."), audio: exports_external.object({}).optional().describe("Host supports audio content blocks."), resource: exports_external.object({}).optional().describe("Host supports resource content blocks."), resourceLink: exports_external.object({}).optional().describe("Host supports resource link content blocks."), structuredContent: exports_external.object({}).optional().describe("Host supports structured content.") });
|
|
51722
|
-
var
|
|
51723
|
-
var
|
|
51724
|
-
var
|
|
51725
|
-
var ZQ = exports_external.object({
|
|
51722
|
+
var QQ = exports_external.object({ method: exports_external.literal("ui/notifications/request-teardown"), params: exports_external.object({}).optional() });
|
|
51723
|
+
var C = exports_external.object({ experimental: exports_external.object({}).optional().describe("Experimental features (structure TBD)."), openLinks: exports_external.object({}).optional().describe("Host supports opening external URLs."), downloadFile: exports_external.object({}).optional().describe("Host supports file downloads via ui/download-file."), serverTools: exports_external.object({ listChanged: exports_external.boolean().optional().describe("Host supports tools/list_changed notifications.") }).optional().describe("Host can proxy tool calls to the MCP server."), serverResources: exports_external.object({ listChanged: exports_external.boolean().optional().describe("Host supports resources/list_changed notifications.") }).optional().describe("Host can proxy resource reads to the MCP server."), logging: exports_external.object({}).optional().describe("Host accepts log messages."), sandbox: exports_external.object({ permissions: K.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."), csp: B.optional().describe("CSP domains approved by the host.") }).optional().describe("Sandbox configuration applied by the host."), updateModelContext: q.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."), message: q.optional().describe("Host supports receiving content messages (ui/message) from the view.") });
|
|
51724
|
+
var f = exports_external.object({ experimental: exports_external.object({}).optional().describe("Experimental features (structure TBD)."), tools: exports_external.object({ listChanged: exports_external.boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."), availableDisplayModes: exports_external.array(G).optional().describe("Display modes the app supports.") });
|
|
51725
|
+
var ZQ = exports_external.object({ method: exports_external.literal("ui/notifications/initialized"), params: exports_external.object({}).optional() });
|
|
51726
|
+
var $Q = exports_external.object({ csp: B.optional().describe("Content Security Policy configuration for UI resources."), permissions: K.optional().describe("Sandbox permissions requested by the UI resource."), domain: exports_external.string().optional().describe(`Dedicated origin for view sandbox.
|
|
51726
51727
|
|
|
51727
51728
|
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
|
|
51728
51729
|
|
|
@@ -51737,27 +51738,27 @@ Boolean requesting whether a visible border and background is provided by the ho
|
|
|
51737
51738
|
- \`true\`: request visible border + background
|
|
51738
51739
|
- \`false\`: request no visible border + background
|
|
51739
51740
|
- omitted: host decides border`) });
|
|
51740
|
-
var
|
|
51741
|
-
var T = exports_external.object({ mode:
|
|
51742
|
-
var
|
|
51743
|
-
var
|
|
51741
|
+
var JQ = exports_external.object({ method: exports_external.literal("ui/request-display-mode"), params: exports_external.object({ mode: G.describe("The display mode being requested.") }) });
|
|
51742
|
+
var T = exports_external.object({ mode: G.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough();
|
|
51743
|
+
var u = exports_external.union([exports_external.literal("model"), exports_external.literal("app")]).describe("Tool visibility scope - who can access the tool.");
|
|
51744
|
+
var XQ = exports_external.object({ resourceUri: exports_external.string().optional(), visibility: exports_external.array(u).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
51744
51745
|
- "model": Tool visible to and callable by the agent
|
|
51745
51746
|
- "app": Tool callable by the app from this server only`) });
|
|
51746
|
-
var
|
|
51747
|
-
var
|
|
51748
|
-
var
|
|
51749
|
-
var
|
|
51750
|
-
var
|
|
51751
|
-
var k = exports_external.object({ toolInfo: exports_external.object({ id: RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."), tool: ToolSchema.describe("Tool definition including name, inputSchema, etc.") }).optional().describe("Metadata of the tool call that instantiated this App."), theme:
|
|
51747
|
+
var RQ = exports_external.object({ mimeTypes: exports_external.array(exports_external.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.') });
|
|
51748
|
+
var VQ = exports_external.object({ method: exports_external.literal("ui/download-file"), params: exports_external.object({ contents: exports_external.array(exports_external.union([EmbeddedResourceSchema, ResourceLinkSchema])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.") }) });
|
|
51749
|
+
var DQ = exports_external.object({ method: exports_external.literal("ui/message"), params: exports_external.object({ role: exports_external.literal("user").describe('Message role, currently only "user" is supported.'), content: exports_external.array(ContentBlockSchema).describe("Message content blocks (text, image, etc.).") }) });
|
|
51750
|
+
var GQ = exports_external.object({ method: exports_external.literal("ui/notifications/sandbox-resource-ready"), params: exports_external.object({ html: exports_external.string().describe("HTML content to load into the inner iframe."), sandbox: exports_external.string().optional().describe("Optional override for the inner iframe's sandbox attribute."), csp: B.optional().describe("CSP configuration from resource metadata."), permissions: K.optional().describe("Sandbox permissions from resource metadata.") }) });
|
|
51751
|
+
var E = exports_external.object({ method: exports_external.literal("ui/notifications/tool-result"), params: CallToolResultSchema.describe("Standard MCP tool execution result.") });
|
|
51752
|
+
var k = exports_external.object({ toolInfo: exports_external.object({ id: RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."), tool: ToolSchema.describe("Tool definition including name, inputSchema, etc.") }).optional().describe("Metadata of the tool call that instantiated this App."), theme: g.optional().describe("Current color theme preference."), styles: y.optional().describe("Style configuration for theming the app."), displayMode: G.optional().describe("How the UI is currently displayed."), availableDisplayModes: exports_external.array(G).optional().describe("Display modes the host supports."), containerDimensions: exports_external.union([exports_external.object({ height: exports_external.number().describe("Fixed container height in pixels.") }), exports_external.object({ maxHeight: exports_external.union([exports_external.number(), exports_external.undefined()]).optional().describe("Maximum container height in pixels.") })]).and(exports_external.union([exports_external.object({ width: exports_external.number().describe("Fixed container width in pixels.") }), exports_external.object({ maxWidth: exports_external.union([exports_external.number(), exports_external.undefined()]).optional().describe("Maximum container width in pixels.") })])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
51752
51753
|
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`), locale: exports_external.string().optional().describe("User's language and region preference in BCP 47 format."), timeZone: exports_external.string().optional().describe("User's timezone in IANA format."), userAgent: exports_external.string().optional().describe("Host application identifier."), platform: exports_external.union([exports_external.literal("web"), exports_external.literal("desktop"), exports_external.literal("mobile")]).optional().describe("Platform type for responsive design decisions."), deviceCapabilities: exports_external.object({ touch: exports_external.boolean().optional().describe("Whether the device supports touch input."), hover: exports_external.boolean().optional().describe("Whether the device supports hover interactions.") }).optional().describe("Device input capabilities."), safeAreaInsets: exports_external.object({ top: exports_external.number().describe("Top safe area inset in pixels."), right: exports_external.number().describe("Right safe area inset in pixels."), bottom: exports_external.number().describe("Bottom safe area inset in pixels."), left: exports_external.number().describe("Left safe area inset in pixels.") }).optional().describe("Mobile safe area boundaries in pixels.") }).passthrough();
|
|
51753
|
-
var
|
|
51754
|
+
var R = exports_external.object({ method: exports_external.literal("ui/notifications/host-context-changed"), params: k.describe("Partial context update containing only changed fields.") });
|
|
51754
51755
|
var LQ = exports_external.object({ method: exports_external.literal("ui/update-model-context"), params: exports_external.object({ content: exports_external.array(ContentBlockSchema).optional().describe("Context content blocks (text, image, etc.)."), structuredContent: exports_external.record(exports_external.string(), exports_external.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.") }) });
|
|
51755
|
-
var
|
|
51756
|
-
var
|
|
51756
|
+
var WQ = exports_external.object({ method: exports_external.literal("ui/initialize"), params: exports_external.object({ appInfo: ImplementationSchema.describe("App identification (name and version)."), appCapabilities: f.describe("Features and capabilities this app provides."), protocolVersion: exports_external.string().describe("Protocol version this app supports.") }) });
|
|
51757
|
+
var U = exports_external.object({ protocolVersion: exports_external.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'), hostInfo: ImplementationSchema.describe("Host application identification and version."), hostCapabilities: C.describe("Features and capabilities provided by the host."), hostContext: k.describe("Rich context about the host environment.") }).passthrough();
|
|
51757
51758
|
var v = "ui/resourceUri";
|
|
51758
51759
|
var d = "text/html;profile=mcp-app";
|
|
51759
51760
|
|
|
51760
|
-
class
|
|
51761
|
+
class OQ extends Protocol {
|
|
51761
51762
|
_appInfo;
|
|
51762
51763
|
_capabilities;
|
|
51763
51764
|
options;
|
|
@@ -51789,13 +51790,13 @@ class qQ extends Protocol {
|
|
|
51789
51790
|
this.setNotificationHandler(P, ($) => Z($.params));
|
|
51790
51791
|
}
|
|
51791
51792
|
set ontoolresult(Z) {
|
|
51792
|
-
this.setNotificationHandler(
|
|
51793
|
+
this.setNotificationHandler(E, ($) => Z($.params));
|
|
51793
51794
|
}
|
|
51794
51795
|
set ontoolcancelled(Z) {
|
|
51795
51796
|
this.setNotificationHandler(H, ($) => Z($.params));
|
|
51796
51797
|
}
|
|
51797
51798
|
set onhostcontextchanged(Z) {
|
|
51798
|
-
this.setNotificationHandler(
|
|
51799
|
+
this.setNotificationHandler(R, ($) => {
|
|
51799
51800
|
this._hostContext = { ...this._hostContext, ...$.params }, Z($.params);
|
|
51800
51801
|
});
|
|
51801
51802
|
}
|
|
@@ -51857,6 +51858,9 @@ class qQ extends Protocol {
|
|
|
51857
51858
|
downloadFile(Z, $) {
|
|
51858
51859
|
return this.request({ method: "ui/download-file", params: Z }, I, $);
|
|
51859
51860
|
}
|
|
51861
|
+
requestTeardown(Z = {}) {
|
|
51862
|
+
return this.notification({ method: "ui/notifications/request-teardown", params: Z });
|
|
51863
|
+
}
|
|
51860
51864
|
requestDisplayMode(Z, $) {
|
|
51861
51865
|
return this.request({ method: "ui/request-display-mode", params: Z }, T, $);
|
|
51862
51866
|
}
|
|
@@ -51869,11 +51873,11 @@ class qQ extends Protocol {
|
|
|
51869
51873
|
return;
|
|
51870
51874
|
Z = true, requestAnimationFrame(() => {
|
|
51871
51875
|
Z = false;
|
|
51872
|
-
let V = document.documentElement,
|
|
51876
|
+
let V = document.documentElement, L = V.style.width, W = V.style.height;
|
|
51873
51877
|
V.style.width = "fit-content", V.style.height = "max-content";
|
|
51874
|
-
let
|
|
51875
|
-
V.style.width =
|
|
51876
|
-
let h = window.innerWidth - V.clientWidth, N = Math.ceil(
|
|
51878
|
+
let x = V.getBoundingClientRect();
|
|
51879
|
+
V.style.width = L, V.style.height = W;
|
|
51880
|
+
let h = window.innerWidth - V.clientWidth, N = Math.ceil(x.width + h), Y = Math.ceil(x.height);
|
|
51877
51881
|
if (N !== $ || Y !== J)
|
|
51878
51882
|
$ = N, J = Y, this.sendSizeChanged({ width: N, height: Y });
|
|
51879
51883
|
});
|
|
@@ -51887,7 +51891,7 @@ class qQ extends Protocol {
|
|
|
51887
51891
|
throw Error("App is already connected. Call close() before connecting again.");
|
|
51888
51892
|
await super.connect(Z);
|
|
51889
51893
|
try {
|
|
51890
|
-
let J = await this.request({ method: "ui/initialize", params: { appCapabilities: this._capabilities, appInfo: this._appInfo, protocolVersion: F } },
|
|
51894
|
+
let J = await this.request({ method: "ui/initialize", params: { appCapabilities: this._capabilities, appInfo: this._appInfo, protocolVersion: F } }, U, $);
|
|
51891
51895
|
if (J === undefined)
|
|
51892
51896
|
throw Error(`Server sent invalid initialize result: ${J}`);
|
|
51893
51897
|
if (this._hostCapabilities = J.hostCapabilities, this._hostInfo = J.hostInfo, this._hostContext = J.hostContext, await this.notification({ method: "ui/notifications/initialized" }), this.options?.autoResize)
|
|
@@ -51897,15 +51901,15 @@ class qQ extends Protocol {
|
|
|
51897
51901
|
}
|
|
51898
51902
|
}
|
|
51899
51903
|
}
|
|
51900
|
-
function
|
|
51901
|
-
let D = J._meta, V = D.ui,
|
|
51902
|
-
if (V?.resourceUri && !
|
|
51904
|
+
function hZ(Z, $, J, X) {
|
|
51905
|
+
let D = J._meta, V = D.ui, L = D[v], W = D;
|
|
51906
|
+
if (V?.resourceUri && !L)
|
|
51903
51907
|
W = { ...D, [v]: V.resourceUri };
|
|
51904
|
-
else if (
|
|
51905
|
-
W = { ...D, ui: { ...V, resourceUri:
|
|
51908
|
+
else if (L && !V?.resourceUri)
|
|
51909
|
+
W = { ...D, ui: { ...V, resourceUri: L } };
|
|
51906
51910
|
return Z.registerTool($, { ...J, _meta: W }, X);
|
|
51907
51911
|
}
|
|
51908
|
-
function
|
|
51912
|
+
function mZ(Z, $, J, X, D) {
|
|
51909
51913
|
return Z.registerResource($, J, { mimeType: d, ...X }, D);
|
|
51910
51914
|
}
|
|
51911
51915
|
|
|
@@ -51925,7 +51929,7 @@ function createServer() {
|
|
|
51925
51929
|
version: "1.0.0"
|
|
51926
51930
|
});
|
|
51927
51931
|
const resourceUri = "ui://sheet-music/mcp-app.html";
|
|
51928
|
-
|
|
51932
|
+
hZ(server, "play-sheet-music", {
|
|
51929
51933
|
title: "Play Sheet Music",
|
|
51930
51934
|
description: "Plays music from ABC notation with audio playback and visual sheet music. " + "Use this to compose original songs (for birthdays, holidays, or any occasion) " + "or perform well-known tunes (folk songs, nursery rhymes, hymns, classical melodies). " + "For accurate renditions of well-known tunes, look up the ABC notation from " + "abcnotation.com or thesession.org rather than recalling from memory.",
|
|
51931
51935
|
inputSchema: exports_external.object({
|
|
@@ -51948,7 +51952,7 @@ ${messages.join(`
|
|
|
51948
51952
|
content: [{ type: "text", text: "Input parsed successfully." }]
|
|
51949
51953
|
};
|
|
51950
51954
|
});
|
|
51951
|
-
|
|
51955
|
+
mZ(server, resourceUri, resourceUri, { mimeType: d, description: "Sheet Music Viewer UI" }, async () => {
|
|
51952
51956
|
const html = await fs.readFile(path.join(DIST_DIR, "mcp-app.html"), "utf-8");
|
|
51953
51957
|
return {
|
|
51954
51958
|
contents: [
|