Skip to content

Instantly share code, notes, and snippets.

View samjarman's full-sized avatar

Sam Jarman samjarman

View GitHub Profile
@samjarman
samjarman / pokemon.server.ts
Created January 14, 2025 09:27
Pokemon MCP Server snipped
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { ListToolsRequestSchema, CallToolRequestSchema} from "@modelcontextprotocol/sdk/types.js";
async function getPokemonDetails(pokemonName: string): Promise<string> {
try {
const url = `https://pokeapi.co/api/v2/pokemon/${pokemonName.toLowerCase()}`;
console.error("Fetching Pokemon details from:", url);
const response = await fetch(url);