@aimaginationlab/marvel-rivals-mcp
Version:
Model Context Protocol server for Marvel Rivals API
212 lines (206 loc) • 5.69 kB
TypeScript
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
declare function createMCPServer(): Server<{
method: string;
params?: {
[x: string]: unknown;
_meta?: {
[x: string]: unknown;
progressToken?: string | number | undefined;
} | undefined;
} | undefined;
}, {
method: string;
params?: {
[x: string]: unknown;
_meta?: {
[x: string]: unknown;
} | undefined;
} | undefined;
}, {
[x: string]: unknown;
_meta?: {
[x: string]: unknown;
} | undefined;
}>;
declare function startMCPServer(): Promise<void>;
interface HeroMin {
id: string;
name: string;
slug: string;
role: 'VANGUARD' | 'DUELIST' | 'STRATEGIST';
difficulty: number;
description: string;
avatar: string;
}
interface Ability {
id: string;
heroId: string;
name: string;
description: string;
type: string;
icon: string;
cooldown?: number;
damage?: number;
}
interface HeroFull extends HeroMin {
abilities: Ability[];
stats: {
health: number;
movementSpeed: number;
damageReduction?: number;
};
lore?: string;
releaseDate?: string;
}
interface Skin {
id: string;
heroId?: string;
name: string;
rarity: 'COMMON' | 'RARE' | 'EPIC' | 'LEGENDARY';
description?: string;
thumbnail: string;
fullImage?: string;
price?: {
currency: string;
amount: number;
};
}
interface Achievement {
id: string;
name: string;
description: string;
category: string;
points: number;
icon: string;
isHidden: boolean;
progress?: {
current: number;
total: number;
};
}
interface Item {
id: string;
name: string;
type: 'NAMEPLATE' | 'MVP' | 'EMOTE' | 'SPRAY';
rarity: 'COMMON' | 'RARE' | 'EPIC' | 'LEGENDARY';
description?: string;
thumbnail: string;
heroId?: string;
}
interface GameMap {
id: string;
name: string;
type: 'CONVOY' | 'CONVERGENCE' | 'DOMINATION' | 'HYBRID';
location: string;
description: string;
thumbnail: string;
modes: string[];
}
interface PlayerProfile {
id: string;
username: string;
level: number;
avatar: string;
banner?: string;
title?: string;
stats: {
totalMatches: number;
wins: number;
losses: number;
winRate: number;
kda: number;
averageDamage: number;
averageHealing: number;
averageEliminations: number;
mostPlayed: {
heroId: string;
heroName: string;
timePlayed: number;
}[];
};
ranks?: {
current: {
tier: string;
division: number;
points: number;
};
peak: {
tier: string;
division: number;
season: number;
};
};
}
interface PlayerSearchResult {
id: string;
username: string;
level: number;
avatar: string;
platform?: string;
}
interface Match {
id: string;
timestamp: string;
duration: number;
mode: string;
map: string;
result: 'VICTORY' | 'DEFEAT' | 'DRAW';
heroPlayed: {
id: string;
name: string;
};
stats: {
eliminations: number;
deaths: number;
assists: number;
damage: number;
healing: number;
damageBlocked: number;
};
}
interface MatchHistory {
playerId: string;
matches: Match[];
pagination: {
page: number;
limit: number;
total: number;
};
}
interface IProvider {
listHeroes(): Promise<HeroMin[]>;
getHeroAbilities(identifier: string): Promise<Ability[]>;
getHeroInfo(identifier: string): Promise<HeroFull>;
getHeroSkins(id: string): Promise<Skin[]>;
listSkins(): Promise<Skin[]>;
listAchievements(): Promise<Achievement[]>;
searchAchievement(name: string): Promise<Achievement[]>;
listItems(): Promise<Item[]>;
getItemsByType(type: 'NAMEPLATE' | 'MVP' | 'EMOTE' | 'SPRAY'): Promise<Item[]>;
listMaps(): Promise<GameMap[]>;
filterMaps(filter: 'convoy' | 'convergence' | 'competitive' | 'casual'): Promise<GameMap[]>;
getPlayerProfile(identifier: string): Promise<PlayerProfile>;
searchPlayer(username: string): Promise<PlayerSearchResult>;
getPlayerMatchHistory(identifier: string): Promise<MatchHistory>;
}
declare class MarvelsApiProvider implements IProvider {
private readonly baseUrl;
private readonly queue;
constructor(baseUrl?: string);
private request;
listHeroes(): Promise<HeroMin[]>;
getHeroAbilities(identifier: string): Promise<Ability[]>;
getHeroInfo(identifier: string): Promise<HeroFull>;
getHeroSkins(id: string): Promise<Skin[]>;
listSkins(): Promise<Skin[]>;
listAchievements(): Promise<Achievement[]>;
searchAchievement(name: string): Promise<Achievement[]>;
listItems(): Promise<Item[]>;
getItemsByType(type: 'NAMEPLATE' | 'MVP' | 'EMOTE' | 'SPRAY'): Promise<Item[]>;
listMaps(): Promise<GameMap[]>;
filterMaps(filter: 'convoy' | 'convergence' | 'competitive' | 'casual'): Promise<GameMap[]>;
getPlayerProfile(identifier: string): Promise<PlayerProfile>;
searchPlayer(username: string): Promise<PlayerSearchResult>;
getPlayerMatchHistory(identifier: string): Promise<MatchHistory>;
}
export { type Ability, type Achievement, type GameMap, type HeroFull, type HeroMin, type IProvider, type Item, MarvelsApiProvider, type Match, type MatchHistory, type PlayerProfile, type PlayerSearchResult, type Skin, createMCPServer, startMCPServer };