@modelcontextprotocol/server-sheet-music 1.2.1 → 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 -38
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -47447,7 +47447,6 @@ function date4(params) {
|
|
|
47447
47447
|
|
|
47448
47448
|
// ../../node_modules/zod/v4/classic/external.js
|
|
47449
47449
|
config(en_default2());
|
|
47450
|
-
|
|
47451
47450
|
// ../../node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
47452
47451
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
47453
47452
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
@@ -51679,8 +51678,8 @@ class j {
|
|
|
51679
51678
|
sessionId;
|
|
51680
51679
|
setProtocolVersion;
|
|
51681
51680
|
}
|
|
51682
|
-
var
|
|
51683
|
-
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.");
|
|
51684
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.");
|
|
51685
51684
|
var o = exports_external.record(i.describe(`Style variables for theming MCP apps.
|
|
51686
51685
|
|
|
@@ -51715,15 +51714,16 @@ var t = exports_external.object({ method: exports_external.literal("ui/notificat
|
|
|
51715
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.") }) });
|
|
51716
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).") }) });
|
|
51717
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").') }) });
|
|
51718
|
-
var
|
|
51719
|
-
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.") });
|
|
51720
51719
|
var _ = exports_external.object({ method: exports_external.literal("ui/resource-teardown"), params: exports_external.object({}) });
|
|
51721
51720
|
var e = exports_external.record(exports_external.string(), exports_external.unknown());
|
|
51722
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.") });
|
|
51723
|
-
var
|
|
51724
|
-
var
|
|
51725
|
-
var
|
|
51726
|
-
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.
|
|
51727
51727
|
|
|
51728
51728
|
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
|
|
51729
51729
|
|
|
@@ -51738,27 +51738,27 @@ Boolean requesting whether a visible border and background is provided by the ho
|
|
|
51738
51738
|
- \`true\`: request visible border + background
|
|
51739
51739
|
- \`false\`: request no visible border + background
|
|
51740
51740
|
- omitted: host decides border`) });
|
|
51741
|
-
var
|
|
51742
|
-
var T = exports_external.object({ mode:
|
|
51743
|
-
var
|
|
51744
|
-
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"]
|
|
51745
51745
|
- "model": Tool visible to and callable by the agent
|
|
51746
51746
|
- "app": Tool callable by the app from this server only`) });
|
|
51747
|
-
var
|
|
51748
|
-
var
|
|
51749
|
-
var
|
|
51750
|
-
var
|
|
51751
|
-
var
|
|
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:
|
|
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
|
|
51753
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();
|
|
51754
|
-
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.") });
|
|
51755
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.") }) });
|
|
51756
|
-
var
|
|
51757
|
-
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();
|
|
51758
51758
|
var v = "ui/resourceUri";
|
|
51759
51759
|
var d = "text/html;profile=mcp-app";
|
|
51760
51760
|
|
|
51761
|
-
class
|
|
51761
|
+
class OQ extends Protocol {
|
|
51762
51762
|
_appInfo;
|
|
51763
51763
|
_capabilities;
|
|
51764
51764
|
options;
|
|
@@ -51790,13 +51790,13 @@ class qQ extends Protocol {
|
|
|
51790
51790
|
this.setNotificationHandler(P, ($) => Z($.params));
|
|
51791
51791
|
}
|
|
51792
51792
|
set ontoolresult(Z) {
|
|
51793
|
-
this.setNotificationHandler(
|
|
51793
|
+
this.setNotificationHandler(E, ($) => Z($.params));
|
|
51794
51794
|
}
|
|
51795
51795
|
set ontoolcancelled(Z) {
|
|
51796
51796
|
this.setNotificationHandler(H, ($) => Z($.params));
|
|
51797
51797
|
}
|
|
51798
51798
|
set onhostcontextchanged(Z) {
|
|
51799
|
-
this.setNotificationHandler(
|
|
51799
|
+
this.setNotificationHandler(R, ($) => {
|
|
51800
51800
|
this._hostContext = { ...this._hostContext, ...$.params }, Z($.params);
|
|
51801
51801
|
});
|
|
51802
51802
|
}
|
|
@@ -51858,6 +51858,9 @@ class qQ extends Protocol {
|
|
|
51858
51858
|
downloadFile(Z, $) {
|
|
51859
51859
|
return this.request({ method: "ui/download-file", params: Z }, I, $);
|
|
51860
51860
|
}
|
|
51861
|
+
requestTeardown(Z = {}) {
|
|
51862
|
+
return this.notification({ method: "ui/notifications/request-teardown", params: Z });
|
|
51863
|
+
}
|
|
51861
51864
|
requestDisplayMode(Z, $) {
|
|
51862
51865
|
return this.request({ method: "ui/request-display-mode", params: Z }, T, $);
|
|
51863
51866
|
}
|
|
@@ -51870,11 +51873,11 @@ class qQ extends Protocol {
|
|
|
51870
51873
|
return;
|
|
51871
51874
|
Z = true, requestAnimationFrame(() => {
|
|
51872
51875
|
Z = false;
|
|
51873
|
-
let V = document.documentElement,
|
|
51876
|
+
let V = document.documentElement, L = V.style.width, W = V.style.height;
|
|
51874
51877
|
V.style.width = "fit-content", V.style.height = "max-content";
|
|
51875
|
-
let
|
|
51876
|
-
V.style.width =
|
|
51877
|
-
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);
|
|
51878
51881
|
if (N !== $ || Y !== J)
|
|
51879
51882
|
$ = N, J = Y, this.sendSizeChanged({ width: N, height: Y });
|
|
51880
51883
|
});
|
|
@@ -51888,7 +51891,7 @@ class qQ extends Protocol {
|
|
|
51888
51891
|
throw Error("App is already connected. Call close() before connecting again.");
|
|
51889
51892
|
await super.connect(Z);
|
|
51890
51893
|
try {
|
|
51891
|
-
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, $);
|
|
51892
51895
|
if (J === undefined)
|
|
51893
51896
|
throw Error(`Server sent invalid initialize result: ${J}`);
|
|
51894
51897
|
if (this._hostCapabilities = J.hostCapabilities, this._hostInfo = J.hostInfo, this._hostContext = J.hostContext, await this.notification({ method: "ui/notifications/initialized" }), this.options?.autoResize)
|
|
@@ -51898,15 +51901,15 @@ class qQ extends Protocol {
|
|
|
51898
51901
|
}
|
|
51899
51902
|
}
|
|
51900
51903
|
}
|
|
51901
|
-
function
|
|
51902
|
-
let D = J._meta, V = D.ui,
|
|
51903
|
-
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)
|
|
51904
51907
|
W = { ...D, [v]: V.resourceUri };
|
|
51905
|
-
else if (
|
|
51906
|
-
W = { ...D, ui: { ...V, resourceUri:
|
|
51908
|
+
else if (L && !V?.resourceUri)
|
|
51909
|
+
W = { ...D, ui: { ...V, resourceUri: L } };
|
|
51907
51910
|
return Z.registerTool($, { ...J, _meta: W }, X);
|
|
51908
51911
|
}
|
|
51909
|
-
function
|
|
51912
|
+
function mZ(Z, $, J, X, D) {
|
|
51910
51913
|
return Z.registerResource($, J, { mimeType: d, ...X }, D);
|
|
51911
51914
|
}
|
|
51912
51915
|
|
|
@@ -51926,7 +51929,7 @@ function createServer() {
|
|
|
51926
51929
|
version: "1.0.0"
|
|
51927
51930
|
});
|
|
51928
51931
|
const resourceUri = "ui://sheet-music/mcp-app.html";
|
|
51929
|
-
|
|
51932
|
+
hZ(server, "play-sheet-music", {
|
|
51930
51933
|
title: "Play Sheet Music",
|
|
51931
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.",
|
|
51932
51935
|
inputSchema: exports_external.object({
|
|
@@ -51949,7 +51952,7 @@ ${messages.join(`
|
|
|
51949
51952
|
content: [{ type: "text", text: "Input parsed successfully." }]
|
|
51950
51953
|
};
|
|
51951
51954
|
});
|
|
51952
|
-
|
|
51955
|
+
mZ(server, resourceUri, resourceUri, { mimeType: d, description: "Sheet Music Viewer UI" }, async () => {
|
|
51953
51956
|
const html = await fs.readFile(path.join(DIST_DIR, "mcp-app.html"), "utf-8");
|
|
51954
51957
|
return {
|
|
51955
51958
|
contents: [
|