@olaservo/scryfall-mcp-server 1.0.1 → 2.1.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/README.md +14 -0
- package/dist/card-viewer.html +89 -72
- package/dist/citations.d.ts +35 -0
- package/dist/citations.js +45 -0
- package/dist/index.js +23 -24
- package/dist/rules/comprehensive-rules.d.ts +48 -0
- package/dist/rules/comprehensive-rules.js +192 -0
- package/dist/scryfall-api.d.ts +12 -1
- package/dist/scryfall-api.js +20 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.js +21 -0
- package/dist/tools/fetch.d.ts +1 -1
- package/dist/tools/fetch.js +5 -8
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +5 -1
- package/dist/tools/rules.d.ts +2 -0
- package/dist/tools/rules.js +128 -0
- package/dist/tools/rulings.d.ts +2 -0
- package/dist/tools/rulings.js +71 -0
- package/dist/tools/search.d.ts +1 -1
- package/dist/tools/search.js +1 -2
- package/dist/transports/stdio.d.ts +1 -0
- package/dist/transports/stdio.js +10 -0
- package/dist/transports/streamableHttp.d.ts +1 -0
- package/dist/transports/streamableHttp.js +70 -0
- package/dist/ui-meta.d.ts +99 -0
- package/dist/ui-meta.js +83 -0
- package/package.json +16 -6
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CitationList, SCRYFALL, WIZARDS } from "../citations.js";
|
|
3
|
+
import { fetchCard, fetchCardByName, fetchRulings, isScryfallError, } from "../scryfall-api.js";
|
|
4
|
+
const RulingsSchema = z.object({
|
|
5
|
+
id: z.uuid().optional().describe("Scryfall card UUID, from the search tool"),
|
|
6
|
+
name: z.string().min(1).optional().describe("Card name. Misspellings and partial words are allowed if they match one card."),
|
|
7
|
+
});
|
|
8
|
+
function errorResult(error) {
|
|
9
|
+
return {
|
|
10
|
+
content: [{ type: "text", text: JSON.stringify({ error: true, status: error.status, body: error.body }) }],
|
|
11
|
+
isError: true,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export const registerRulingsTool = (server) => {
|
|
15
|
+
server.registerTool("get_rulings", {
|
|
16
|
+
title: "Get Card Rulings",
|
|
17
|
+
description: "Get a Magic: The Gathering card's Oracle text and its rulings from Scryfall, by Scryfall UUID or by name. " +
|
|
18
|
+
"Each ruling says whether it came from Wizards of the Coast or from Scryfall, and when it was published. " +
|
|
19
|
+
"Carries citation markers to quote when answering a rules question about the card.",
|
|
20
|
+
inputSchema: RulingsSchema,
|
|
21
|
+
annotations: {
|
|
22
|
+
readOnlyHint: true,
|
|
23
|
+
destructiveHint: false,
|
|
24
|
+
idempotentHint: true,
|
|
25
|
+
openWorldHint: true,
|
|
26
|
+
},
|
|
27
|
+
}, async ({ id, name }, ctx) => {
|
|
28
|
+
if (!id && !name) {
|
|
29
|
+
return { content: [{ type: "text", text: "Give a card id or name." }], isError: true };
|
|
30
|
+
}
|
|
31
|
+
const card = id ? await fetchCard(id) : await fetchCardByName(name);
|
|
32
|
+
if (isScryfallError(card))
|
|
33
|
+
return errorResult(card);
|
|
34
|
+
const rulings = await fetchRulings(card.id);
|
|
35
|
+
if (isScryfallError(rulings))
|
|
36
|
+
return errorResult(rulings);
|
|
37
|
+
const page = new URL(card.scryfall_uri);
|
|
38
|
+
page.searchParams.delete("utm_source");
|
|
39
|
+
const url = page.href;
|
|
40
|
+
const list = new CitationList();
|
|
41
|
+
const faces = card.oracle_text !== undefined
|
|
42
|
+
? [{ name: card.name, oracle_text: card.oracle_text }]
|
|
43
|
+
: (card.card_faces ?? []).map((f) => ({ name: f.name ?? card.name, oracle_text: f.oracle_text ?? "" }));
|
|
44
|
+
const oracle = faces.map((f) => `${f.name}\n${f.oracle_text} ` +
|
|
45
|
+
list.cite({ name: `${f.name} Oracle text`, url, text: f.oracle_text, author: WIZARDS, publisher: SCRYFALL }));
|
|
46
|
+
const lines = rulings.map((r) => {
|
|
47
|
+
const by = r.source === "wotc" ? WIZARDS : SCRYFALL;
|
|
48
|
+
const marker = list.cite({
|
|
49
|
+
name: `Ruling on ${card.name}, ${r.published_at}`,
|
|
50
|
+
url,
|
|
51
|
+
text: r.comment,
|
|
52
|
+
datePublished: r.published_at,
|
|
53
|
+
author: by,
|
|
54
|
+
publisher: SCRYFALL,
|
|
55
|
+
});
|
|
56
|
+
return `- ${r.published_at} (${by.name}): ${r.comment} ${marker}`;
|
|
57
|
+
});
|
|
58
|
+
const text = [
|
|
59
|
+
`Oracle text:\n${oracle.join("\n\n")}`,
|
|
60
|
+
rulings.length > 0 ? `Rulings (${rulings.length}):\n${lines.join("\n")}` : "No rulings.",
|
|
61
|
+
].join("\n\n");
|
|
62
|
+
return list.result(server, ctx, text, {
|
|
63
|
+
name: card.name,
|
|
64
|
+
id: card.id,
|
|
65
|
+
oracle_id: card.oracle_id,
|
|
66
|
+
scryfall_uri: url,
|
|
67
|
+
oracle: faces,
|
|
68
|
+
rulings: rulings.map((r) => ({ source: r.source, published_at: r.published_at, comment: r.comment })),
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
};
|
package/dist/tools/search.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { McpServer } from "@modelcontextprotocol/
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/server";
|
|
2
2
|
export declare const registerSearchTool: (server: McpServer) => void;
|
package/dist/tools/search.js
CHANGED
|
@@ -21,8 +21,7 @@ export const registerSearchTool = (server) => {
|
|
|
21
21
|
idempotentHint: true,
|
|
22
22
|
openWorldHint: true,
|
|
23
23
|
},
|
|
24
|
-
}, async (
|
|
25
|
-
const { query } = SearchSchema.parse(args);
|
|
24
|
+
}, async ({ query }) => {
|
|
26
25
|
const result = await searchCards(query);
|
|
27
26
|
if (isScryfallError(result)) {
|
|
28
27
|
return {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
|
|
2
|
+
import { createServer } from "../server.js";
|
|
3
|
+
const transport = new StdioServerTransport();
|
|
4
|
+
const server = createServer();
|
|
5
|
+
await server.connect(transport);
|
|
6
|
+
console.error("Scryfall MCP server running via stdio");
|
|
7
|
+
process.on("SIGINT", async () => {
|
|
8
|
+
await server.close();
|
|
9
|
+
process.exit(0);
|
|
10
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import express from "express";
|
|
2
|
+
import cors from "cors";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
import { isInitializeRequest } from "@modelcontextprotocol/server";
|
|
5
|
+
import { NodeStreamableHTTPServerTransport } from "@modelcontextprotocol/node";
|
|
6
|
+
import { createServer } from "../server.js";
|
|
7
|
+
const app = express();
|
|
8
|
+
app.use(cors({ origin: "*", exposedHeaders: ["Mcp-Session-Id"] }));
|
|
9
|
+
app.use(express.json());
|
|
10
|
+
const transports = {};
|
|
11
|
+
app.post("/mcp", async (req, res) => {
|
|
12
|
+
const sessionId = req.headers["mcp-session-id"];
|
|
13
|
+
let transport;
|
|
14
|
+
if (sessionId && transports[sessionId]) {
|
|
15
|
+
transport = transports[sessionId];
|
|
16
|
+
}
|
|
17
|
+
else if (!sessionId && isInitializeRequest(req.body)) {
|
|
18
|
+
transport = new NodeStreamableHTTPServerTransport({
|
|
19
|
+
sessionIdGenerator: () => randomUUID(),
|
|
20
|
+
onsessioninitialized: (id) => {
|
|
21
|
+
transports[id] = transport;
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
transport.onclose = () => {
|
|
25
|
+
if (transport.sessionId) {
|
|
26
|
+
delete transports[transport.sessionId];
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const server = createServer();
|
|
30
|
+
await server.connect(transport);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
res.status(400).json({
|
|
34
|
+
jsonrpc: "2.0",
|
|
35
|
+
error: {
|
|
36
|
+
code: -32000,
|
|
37
|
+
message: "Bad Request: No valid session ID provided",
|
|
38
|
+
},
|
|
39
|
+
id: null,
|
|
40
|
+
});
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
await transport.handleRequest(req, res, req.body);
|
|
44
|
+
});
|
|
45
|
+
app.get("/mcp", async (req, res) => {
|
|
46
|
+
const sessionId = req.headers["mcp-session-id"];
|
|
47
|
+
if (!sessionId || !transports[sessionId]) {
|
|
48
|
+
res.status(400).send("Invalid or missing session ID");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
await transports[sessionId].handleRequest(req, res);
|
|
52
|
+
});
|
|
53
|
+
app.delete("/mcp", async (req, res) => {
|
|
54
|
+
const sessionId = req.headers["mcp-session-id"];
|
|
55
|
+
if (!sessionId || !transports[sessionId]) {
|
|
56
|
+
res.status(400).send("Invalid or missing session ID");
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
await transports[sessionId].handleRequest(req, res);
|
|
60
|
+
});
|
|
61
|
+
const PORT = Number(process.env.PORT) || 3000;
|
|
62
|
+
app.listen(PORT, () => {
|
|
63
|
+
console.log(`Scryfall MCP HTTP server listening on http://localhost:${PORT}/mcp`);
|
|
64
|
+
});
|
|
65
|
+
process.on("SIGINT", async () => {
|
|
66
|
+
for (const transport of Object.values(transports)) {
|
|
67
|
+
await transport.close();
|
|
68
|
+
}
|
|
69
|
+
process.exit(0);
|
|
70
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vendored MCP Apps (`ui`) server helpers.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS FILE EXISTS
|
|
5
|
+
* --------------------
|
|
6
|
+
* `@modelcontextprotocol/ext-apps` has no release that is compatible with the
|
|
7
|
+
* MCP TypeScript SDK v2: its `/server` entry point is typed against v1's
|
|
8
|
+
* `McpServer` and imports `@modelcontextprotocol/sdk/server/zod-compat.js`, a
|
|
9
|
+
* module that was removed in v2, and its peerDependency is
|
|
10
|
+
* `@modelcontextprotocol/sdk@^1.x`.
|
|
11
|
+
*
|
|
12
|
+
* The server half of this package is on SDK v2, so it cannot import
|
|
13
|
+
* `@modelcontextprotocol/ext-apps/server`. This module is a faithful port of the
|
|
14
|
+
* only two behaviours those helpers add on top of the plain SDK calls — `_meta`
|
|
15
|
+
* normalization for tools and a default MIME type for resources — retyped
|
|
16
|
+
* against the v2 SDK.
|
|
17
|
+
*
|
|
18
|
+
* The browser half (`src/ui/**`) still uses `@modelcontextprotocol/ext-apps` and
|
|
19
|
+
* SDK v1; it is compiled into a self-contained HTML bundle by a separate vite
|
|
20
|
+
* pass and only ever talks to this server over the MCP wire, so no object ever
|
|
21
|
+
* crosses the v1/v2 boundary in-process.
|
|
22
|
+
*
|
|
23
|
+
* DELETE THIS FILE and go back to `@modelcontextprotocol/ext-apps/server` once
|
|
24
|
+
* upstream ships a v2-compatible release.
|
|
25
|
+
*
|
|
26
|
+
* Ported verbatim from `@modelcontextprotocol/ext-apps` `dist/src/server/index.js`.
|
|
27
|
+
*/
|
|
28
|
+
import type { ClientCapabilities, McpServer, ReadResourceCallback, RegisteredResource, RegisteredTool, ResourceMetadata, StandardSchemaWithJSON, ToolAnnotations, ToolCallback } from "@modelcontextprotocol/server";
|
|
29
|
+
/**
|
|
30
|
+
* Legacy `_meta` key hosts read to find a tool's UI resource.
|
|
31
|
+
*
|
|
32
|
+
* Deprecated upstream in favour of `_meta.ui.resourceUri`, but still written
|
|
33
|
+
* (and still read by older hosts), so both keys are always emitted.
|
|
34
|
+
*/
|
|
35
|
+
export declare const RESOURCE_URI_META_KEY = "ui/resourceUri";
|
|
36
|
+
/** MIME type identifying an MCP Apps HTML resource. */
|
|
37
|
+
export declare const RESOURCE_MIME_TYPE = "text/html;profile=mcp-app";
|
|
38
|
+
/** Extension identifier used for MCP Apps capability negotiation. */
|
|
39
|
+
export declare const EXTENSION_ID = "io.modelcontextprotocol/ui";
|
|
40
|
+
/** Who may call a UI-backed tool. */
|
|
41
|
+
export type McpUiToolVisibility = "model" | "app";
|
|
42
|
+
/** `_meta.ui` on a tool declaration. */
|
|
43
|
+
export interface McpUiToolMeta {
|
|
44
|
+
/** URI of the UI resource to display for this tool. */
|
|
45
|
+
resourceUri?: string;
|
|
46
|
+
/** Who can access this tool. Default: `["model", "app"]`. */
|
|
47
|
+
visibility?: McpUiToolVisibility[];
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* `_meta` for a UI-backed tool. The UI resource may be given either as
|
|
52
|
+
* `_meta.ui.resourceUri` (preferred) or `_meta["ui/resourceUri"]` (legacy);
|
|
53
|
+
* {@link normalizeAppToolMeta} fills in whichever one is missing.
|
|
54
|
+
*/
|
|
55
|
+
export type McpUiAppToolMeta = {
|
|
56
|
+
[key: string]: unknown;
|
|
57
|
+
} & ({
|
|
58
|
+
ui: McpUiToolMeta;
|
|
59
|
+
} | {
|
|
60
|
+
"ui/resourceUri"?: string;
|
|
61
|
+
});
|
|
62
|
+
/** Config accepted by {@link registerAppTool}, mirroring `McpServer.registerTool`. */
|
|
63
|
+
export interface McpUiAppToolConfig<InputArgs extends StandardSchemaWithJSON | undefined> {
|
|
64
|
+
title?: string;
|
|
65
|
+
description?: string;
|
|
66
|
+
inputSchema?: InputArgs;
|
|
67
|
+
outputSchema?: StandardSchemaWithJSON;
|
|
68
|
+
annotations?: ToolAnnotations;
|
|
69
|
+
_meta: McpUiAppToolMeta;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Normalize a UI tool's `_meta` so both the modern (`_meta.ui.resourceUri`) and
|
|
73
|
+
* the legacy (`_meta["ui/resourceUri"]`) keys are present.
|
|
74
|
+
*
|
|
75
|
+
* This is byte-for-byte the normalization ext-apps' `registerAppTool` applied.
|
|
76
|
+
* Hosts (including Claude) look at either key to find the UI resource, so the
|
|
77
|
+
* output must not drift.
|
|
78
|
+
*/
|
|
79
|
+
export declare function normalizeAppToolMeta(meta: Record<string, unknown>): Record<string, unknown>;
|
|
80
|
+
/**
|
|
81
|
+
* `server.registerTool` plus the `_meta` normalization described in
|
|
82
|
+
* {@link normalizeAppToolMeta}. Nothing else.
|
|
83
|
+
*/
|
|
84
|
+
export declare function registerAppTool<InputArgs extends StandardSchemaWithJSON | undefined = undefined>(server: Pick<McpServer, "registerTool">, name: string, config: McpUiAppToolConfig<InputArgs>, cb: ToolCallback<InputArgs>): RegisteredTool;
|
|
85
|
+
/**
|
|
86
|
+
* `server.registerResource` with the MCP Apps MIME type as a default. Nothing
|
|
87
|
+
* else — a caller-supplied `mimeType` still wins, because the default is spread
|
|
88
|
+
* first.
|
|
89
|
+
*/
|
|
90
|
+
export declare function registerAppResource(server: Pick<McpServer, "registerResource">, name: string, uri: string, config: ResourceMetadata, readCallback: ReadResourceCallback): RegisteredResource;
|
|
91
|
+
/**
|
|
92
|
+
* Read the MCP Apps capability out of the client's declared capabilities.
|
|
93
|
+
*
|
|
94
|
+
* `extensions` is not part of the SDK's `ClientCapabilities` yet (SEP-1724), so
|
|
95
|
+
* it is intersected in here, exactly as ext-apps did.
|
|
96
|
+
*/
|
|
97
|
+
export declare function getUiCapability(clientCapabilities: (ClientCapabilities & {
|
|
98
|
+
extensions?: Record<string, unknown>;
|
|
99
|
+
}) | null | undefined): unknown;
|
package/dist/ui-meta.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vendored MCP Apps (`ui`) server helpers.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS FILE EXISTS
|
|
5
|
+
* --------------------
|
|
6
|
+
* `@modelcontextprotocol/ext-apps` has no release that is compatible with the
|
|
7
|
+
* MCP TypeScript SDK v2: its `/server` entry point is typed against v1's
|
|
8
|
+
* `McpServer` and imports `@modelcontextprotocol/sdk/server/zod-compat.js`, a
|
|
9
|
+
* module that was removed in v2, and its peerDependency is
|
|
10
|
+
* `@modelcontextprotocol/sdk@^1.x`.
|
|
11
|
+
*
|
|
12
|
+
* The server half of this package is on SDK v2, so it cannot import
|
|
13
|
+
* `@modelcontextprotocol/ext-apps/server`. This module is a faithful port of the
|
|
14
|
+
* only two behaviours those helpers add on top of the plain SDK calls — `_meta`
|
|
15
|
+
* normalization for tools and a default MIME type for resources — retyped
|
|
16
|
+
* against the v2 SDK.
|
|
17
|
+
*
|
|
18
|
+
* The browser half (`src/ui/**`) still uses `@modelcontextprotocol/ext-apps` and
|
|
19
|
+
* SDK v1; it is compiled into a self-contained HTML bundle by a separate vite
|
|
20
|
+
* pass and only ever talks to this server over the MCP wire, so no object ever
|
|
21
|
+
* crosses the v1/v2 boundary in-process.
|
|
22
|
+
*
|
|
23
|
+
* DELETE THIS FILE and go back to `@modelcontextprotocol/ext-apps/server` once
|
|
24
|
+
* upstream ships a v2-compatible release.
|
|
25
|
+
*
|
|
26
|
+
* Ported verbatim from `@modelcontextprotocol/ext-apps` `dist/src/server/index.js`.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Legacy `_meta` key hosts read to find a tool's UI resource.
|
|
30
|
+
*
|
|
31
|
+
* Deprecated upstream in favour of `_meta.ui.resourceUri`, but still written
|
|
32
|
+
* (and still read by older hosts), so both keys are always emitted.
|
|
33
|
+
*/
|
|
34
|
+
export const RESOURCE_URI_META_KEY = "ui/resourceUri";
|
|
35
|
+
/** MIME type identifying an MCP Apps HTML resource. */
|
|
36
|
+
export const RESOURCE_MIME_TYPE = "text/html;profile=mcp-app";
|
|
37
|
+
/** Extension identifier used for MCP Apps capability negotiation. */
|
|
38
|
+
export const EXTENSION_ID = "io.modelcontextprotocol/ui";
|
|
39
|
+
/**
|
|
40
|
+
* Normalize a UI tool's `_meta` so both the modern (`_meta.ui.resourceUri`) and
|
|
41
|
+
* the legacy (`_meta["ui/resourceUri"]`) keys are present.
|
|
42
|
+
*
|
|
43
|
+
* This is byte-for-byte the normalization ext-apps' `registerAppTool` applied.
|
|
44
|
+
* Hosts (including Claude) look at either key to find the UI resource, so the
|
|
45
|
+
* output must not drift.
|
|
46
|
+
*/
|
|
47
|
+
export function normalizeAppToolMeta(meta) {
|
|
48
|
+
const ui = meta.ui;
|
|
49
|
+
const legacy = meta[RESOURCE_URI_META_KEY];
|
|
50
|
+
if (ui?.resourceUri && !legacy) {
|
|
51
|
+
return { ...meta, [RESOURCE_URI_META_KEY]: ui.resourceUri };
|
|
52
|
+
}
|
|
53
|
+
if (legacy && !ui?.resourceUri) {
|
|
54
|
+
return { ...meta, ui: { ...ui, resourceUri: legacy } };
|
|
55
|
+
}
|
|
56
|
+
return meta;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* `server.registerTool` plus the `_meta` normalization described in
|
|
60
|
+
* {@link normalizeAppToolMeta}. Nothing else.
|
|
61
|
+
*/
|
|
62
|
+
export function registerAppTool(server, name, config, cb) {
|
|
63
|
+
return server.registerTool(name, { ...config, _meta: normalizeAppToolMeta(config._meta) }, cb);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* `server.registerResource` with the MCP Apps MIME type as a default. Nothing
|
|
67
|
+
* else — a caller-supplied `mimeType` still wins, because the default is spread
|
|
68
|
+
* first.
|
|
69
|
+
*/
|
|
70
|
+
export function registerAppResource(server, name, uri, config, readCallback) {
|
|
71
|
+
return server.registerResource(name, uri, { mimeType: RESOURCE_MIME_TYPE, ...config }, readCallback);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Read the MCP Apps capability out of the client's declared capabilities.
|
|
75
|
+
*
|
|
76
|
+
* `extensions` is not part of the SDK's `ClientCapabilities` yet (SEP-1724), so
|
|
77
|
+
* it is intersected in here, exactly as ext-apps did.
|
|
78
|
+
*/
|
|
79
|
+
export function getUiCapability(clientCapabilities) {
|
|
80
|
+
if (!clientCapabilities)
|
|
81
|
+
return undefined;
|
|
82
|
+
return clientCapabilities.extensions?.[EXTENSION_ID];
|
|
83
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olaservo/scryfall-mcp-server",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Community MCP server to search and fetch Magic: The Gathering card data from Scryfall with a rich card viewer UI. Not affiliated with or endorsed by Scryfall.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,25 +27,35 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/olaservo/scryfall-mcp-app#readme",
|
|
29
29
|
"engines": {
|
|
30
|
-
"node": ">=
|
|
30
|
+
"node": ">=24.0.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build:ui": "cross-env INPUT=src/ui/card-viewer.html vite build",
|
|
34
34
|
"build:server": "tsc",
|
|
35
35
|
"build": "npm run build:ui && npm run build:server",
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
37
|
+
"test": "tsx --test test/*.test.ts",
|
|
36
38
|
"prepublishOnly": "npm run build",
|
|
37
39
|
"start": "node dist/index.js",
|
|
40
|
+
"start:http": "node dist/index.js streamableHttp",
|
|
38
41
|
"dev": "tsx watch src/index.ts",
|
|
42
|
+
"dev:http": "tsx watch src/index.ts streamableHttp",
|
|
39
43
|
"inspector": "npx @modelcontextprotocol/inspector node dist/index.js",
|
|
40
44
|
"pack": "npm run build && rm -rf node_modules && npm install --omit=dev --omit=optional && npx --yes @anthropic-ai/mcpb -- pack . scryfall-mcp-server.mcpb; npm install"
|
|
41
45
|
},
|
|
42
46
|
"dependencies": {
|
|
43
|
-
"@modelcontextprotocol/
|
|
44
|
-
"@modelcontextprotocol/
|
|
45
|
-
"
|
|
47
|
+
"@modelcontextprotocol/node": "^2.0.0",
|
|
48
|
+
"@modelcontextprotocol/server": "^2.0.0",
|
|
49
|
+
"cors": "^2.8.6",
|
|
50
|
+
"express": "^5.2.1",
|
|
51
|
+
"zod": "^4.2.0"
|
|
46
52
|
},
|
|
47
53
|
"devDependencies": {
|
|
48
|
-
"@
|
|
54
|
+
"@modelcontextprotocol/ext-apps": "^1.7.5",
|
|
55
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
56
|
+
"@types/cors": "^2.8.19",
|
|
57
|
+
"@types/express": "^5.0.6",
|
|
58
|
+
"@types/node": "^24.19.2",
|
|
49
59
|
"cross-env": "^10.1.0",
|
|
50
60
|
"tsx": "^4.19.2",
|
|
51
61
|
"typescript": "^5.7.2",
|