@kaminaduck/scryfall-mcp-server
Version:
A Model Context Protocol (MCP) server that provides access to the Scryfall API for Magic: The Gathering card data
72 lines • 1.83 kB
TypeScript
/**
* Scryfall API client for Magic: The Gathering card data.
*/
export interface Card {
id: string;
name: string;
set: string;
set_name: string;
collector_number: string;
rarity: string;
artist: string;
display_name?: string;
scryfall_uri: string;
image_uris?: {
small?: string;
normal?: string;
large?: string;
png?: string;
art_crop?: string;
border_crop?: string;
};
card_faces?: Array<{
name: string;
image_uris?: Card['image_uris'];
}>;
}
export interface SearchResponse {
object: string;
total_cards: number;
has_more: boolean;
next_page?: string;
data: Card[];
details?: string;
}
export declare class ScryfallClient {
private readonly baseUrl;
private readonly rateLimitDelay;
/**
* Add a delay between requests to respect rate limits.
*/
private delay;
/**
* Make a request to the Scryfall API with retry logic.
*/
private makeRequest;
/**
* Search for cards using Scryfall's search API.
*/
searchCards(query: string): Promise<Card[]>;
/**
* Get a card by its Scryfall ID.
*/
getCardById(cardId: string): Promise<Card>;
/**
* Get a card by its name (exact match).
*/
getCardByName(cardName: string): Promise<Card>;
/**
* Get a random card.
*/
getRandomCard(): Promise<Card>;
/**
* Get a card by set and collector number.
*/
getCardBySetAndNumber(setCode: string, collectorNumber: string): Promise<Card>;
/**
* Group cards by name and identify alternate artworks.
*/
groupCardsByNameAndArt(cards: Card[]): Record<string, Card[]>;
}
export declare const scryfallClient: ScryfallClient;
//# sourceMappingURL=scryfallClient.d.ts.map