Skip to main content
Glama

Scryfall MCP Server

by bmurdock
index.ts1.22 kB
import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { ScryfallMCPServer } from './server.js'; import { mcpLogger } from './services/logger.js'; async function main() { const server = new Server( { name: 'scryfall-mcp-server', version: '1.0.0', }, { capabilities: { tools: {}, resources: {}, prompts: {}, }, } ); const scryfallServer = new ScryfallMCPServer(); await scryfallServer.setupHandlers(server); const transport = new StdioServerTransport(); await server.connect(transport); mcpLogger.info({ operation: 'startup' }, 'scryfall-mcp server started'); // Graceful shutdown const shutdown = async (signal: string) => { try { mcpLogger.info({ operation: 'shutdown', signal }, 'Shutting down server'); scryfallServer.destroy(); } finally { process.exit(0); } }; process.on('SIGINT', () => shutdown('SIGINT')); process.on('SIGTERM', () => shutdown('SIGTERM')); } main().catch((err) => { mcpLogger.fatal({ operation: 'startup', error: err }, 'Unhandled startup error'); process.exit(1); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bmurdock/scryfall-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server