Skip to main content
Glama

Emoji Storyteller MCP Server

by septapod
index.jsโ€ข6.54 kB
#!/usr/bin/env node import { Server } from "@modelcontextprotocol/sdk/server/index.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js"; // Emoji categories for silly stories const EMOJIS = { animals: ["๐Ÿธ", "๐Ÿฆ†", "๐Ÿข", "๐ŸฆŒ", "๐ŸฆŠ", "๐Ÿป", "๐Ÿฆ", "๐Ÿฆ—", "๐Ÿฆ‰", "๐Ÿฆ…"], action: ["๐Ÿ’ƒ", "๐Ÿ•บ", "๐Ÿƒ", "๐Ÿคธ", "๐Ÿง—", "๐Ÿš€", "๐Ÿ’จ", "โšก", "๐Ÿ”ฅ", "๐Ÿ’ฅ"], objects: ["๐Ÿ•", "๐ŸŒ", "๐ŸŽธ", "๐Ÿงฒ", "๐ŸŽบ", "๐Ÿงจ", "๐ŸŽช", "๐Ÿš", "โš™๏ธ", "๐Ÿ””"], emotions: ["๐Ÿ˜‚", "๐Ÿคช", "๐Ÿ˜ฑ", "๐Ÿฅณ", "๐Ÿ˜", "๐Ÿคฏ", "๐Ÿ˜ต", "๐Ÿค”", "๐Ÿ‘€", "๐Ÿ’€"], places: ["๐Ÿฐ", "๐Ÿ–๏ธ", "๐ŸŒ‹", "๐Ÿข", "๐ŸŽข", "๐ŸŒณ", "๐Ÿ”๏ธ", "๐ŸŒŠ", "๐ŸŽ ", "๐Ÿช"], weather: ["โ›ˆ๏ธ", "๐ŸŒช๏ธ", "โ„๏ธ", "โ˜€๏ธ", "๐ŸŒˆ", "๐ŸŒง๏ธ", "โ›…", "๐ŸŒฉ๏ธ", "๐Ÿ’จ", "โ˜๏ธ"], magic: ["โœจ", "๐ŸŒŸ", "๐Ÿ’ซ", "โญ", "๐ŸŽ†", "๐ŸŽ‡", "๐Ÿ”ฎ", "๐Ÿงฟ", "๐Ÿช„", "๐Ÿ’Ž"], food: ["๐Ÿ•", "๐Ÿ”", "๐ŸŸ", "๐ŸŒญ", "๐Ÿฟ", "๐Ÿง", "๐Ÿฐ", "๐Ÿช", "๐Ÿฅ", "๐Ÿฉ"], silly: ["๐Ÿคก", "๐ŸŽญ", "๐ŸŽช", "๐Ÿ‘ฝ", "๐ŸŒฎ", "๐Ÿงƒ", "๐Ÿฆ–", "๐Ÿฆ•", "๐Ÿง›", "๐ŸŽจ"], }; function getRandomEmojis(category, count = 1) { const emojis = EMOJIS[category]; const result = []; for (let i = 0; i < count; i++) { result.push(emojis[Math.floor(Math.random() * emojis.length)]); } return result; } function generateEmojiStory(theme = "random", chaosLevel = 5) { const scenes = []; const storyLength = chaosLevel + 3; // Act I - The Setup scenes.push( `Act I: ${getRandomEmojis("places", 1)} ${getRandomEmojis("animals", 2)}` ); scenes.push( `${getRandomEmojis("emotions", 1)} ${getRandomEmojis("weather", 1)}` ); // Act II - The Chaos for (let i = 0; i < storyLength; i++) { const sceneType = Math.random(); if (sceneType < 0.3) { // Action scene scenes.push( `${getRandomEmojis("action", 2)} ${getRandomEmojis("objects", 1)} ${getRandomEmojis("action", 1)}` ); } else if (sceneType < 0.6) { // Emotional scene scenes.push( `${getRandomEmojis("emotions", 2)} ${getRandomEmojis("magic", 1)}` ); } else { // Complete randomness scenes.push( `${getRandomEmojis("silly", 1)} ${getRandomEmojis("food", 1)} ${getRandomEmojis("animals", 1)} ${getRandomEmojis("objects", 1)}` ); } } // Act III - The Climax scenes.push( `โšก๐Ÿ’ฅ ${getRandomEmojis("magic", 2)} ๐ŸŽ† ${getRandomEmojis("animals", 1)} ๐Ÿ’ซ` ); // The Ending (always weird) scenes.push(`THE END... OR IS IT? ๐ŸŽญโœจ๐ŸŒ€`); return scenes.join("\n"); } function generateThemedStory(theme) { const themeMap = { adventure: () => { return `๐Ÿ—บ๏ธ ๐Ÿง— ๐Ÿ”๏ธ\nโšก ๐Ÿ‰ ๐Ÿ’ช\n๐Ÿ† ๐Ÿ’Ž โœจ\n๐ŸŽ‰ ๐Ÿฅณ ๐ŸŽŠ`; }, romance: () => { return `๐Ÿ’• ๐Ÿ’‘ ๐Ÿ’\n๐ŸŒน ๐Ÿ˜ ๐Ÿ’ซ\n๐Ÿ’” ๐Ÿฅบ ๐Ÿ˜ข\n๐Ÿ’•๐Ÿ’•๐Ÿ’•`; }, horror: () => { return `๐Ÿš๏ธ ๐Ÿ‘ป ๐Ÿ˜ฑ\n๐Ÿ”ช ๐Ÿ’€ โ˜ ๏ธ\n๐Ÿ˜ฒ ๐Ÿƒ ๐Ÿ’จ\n๐ŸŒ™ ๐Ÿ˜ต ๐Ÿ’ฅ`; }, space: () => { return `๐Ÿš€ ๐ŸŒŒ ๐Ÿ‘ฝ\n๐Ÿช โญ ๐ŸŒ \n๐Ÿ›ธ ๐Ÿ”ญ ๐Ÿ’ซ\n๐ŸŒ ๐Ÿ’ฅ ๐ŸŽ†`; }, food: () => { return `๐Ÿ• ๐Ÿ” ๐ŸŸ\n๐Ÿ˜‹ ๐Ÿคค ๐Ÿ˜\n๐Ÿฝ๏ธ ๐Ÿ”ฅ ๐Ÿ’จ\n๐Ÿ’€ ๐Ÿ˜ฑ ๐Ÿš€`; }, party: () => { return `๐ŸŽ‰ ๐ŸŽŠ ๐Ÿฅณ\n๐Ÿ’ƒ ๐Ÿ•บ ๐ŸŽต\n๐Ÿพ ๐Ÿป ๐ŸŽช\n๐Ÿ˜ต ๐Ÿ’ซ โœจ`; }, }; return themeMap[theme] ? themeMap[theme]() : `Random chaos incoming...\n${generateEmojiStory("random", 7)}`; } // Tool definitions const TOOLS = [ { name: "tell_random_story", description: "Tells a completely random and chaotic emoji story. Perfect for when you want pure chaos! ๐ŸŽญโœจ", inputSchema: { type: "object", properties: { chaos_level: { type: "number", description: "How chaotic the story should be (1-10). Default: 5", minimum: 1, maximum: 10, }, }, }, }, { name: "tell_themed_story", description: "Tells a themed emoji story. Choose your adventure! ๐Ÿ—บ๏ธโœจ", inputSchema: { type: "object", properties: { theme: { type: "string", description: "Story theme: 'adventure', 'romance', 'horror', 'space', 'food', or 'party'", enum: ["adventure", "romance", "horror", "space", "food", "party"], }, }, required: ["theme"], }, }, { name: "tell_emoji_madness", description: "THE ULTIMATE CHAOS MODE! Maximum silly emoji overload! ๐ŸŒ€๐Ÿ’€โœจ", inputSchema: { type: "object", properties: {}, }, }, ]; async function processToolCall(toolName, toolInput) { console.error(`Tool called: ${toolName}`, toolInput); if (toolName === "tell_random_story") { const chaosLevel = toolInput.chaos_level || 5; const story = generateEmojiStory("random", chaosLevel); return `๐ŸŽฌ EMOJI STORY (Chaos Level: ${chaosLevel}/10) ๐ŸŽฌ\n\n${story}`; } if (toolName === "tell_themed_story") { const theme = toolInput.theme || "random"; const story = generateThemedStory(theme); return `๐ŸŽญ ${theme.toUpperCase()} STORY ๐ŸŽญ\n\n${story}`; } if (toolName === "tell_emoji_madness") { const madness = []; for (let i = 0; i < 10; i++) { madness.push(generateEmojiStory("random", 8)); } return `๐ŸŒ€ MAXIMUM EMOJI CHAOS MODE ACTIVATED ๐ŸŒ€\n\n${madness.join("\n---\n")}`; } throw new Error(`Unknown tool: ${toolName}`); } async function main() { const server = new Server( { name: "emoji-storyteller", version: "1.0.0", }, { capabilities: { tools: {}, }, } ); server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TOOLS }; }); server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; console.error(`Executing tool: ${name}`); try { const result = await processToolCall(name, args || {}); return { content: [ { type: "text", text: result, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error: ${error.message}`, }, ], isError: true, }; } }); const transport = new StdioServerTransport(); await server.connect(transport); console.error("Emoji Storyteller MCP Server is running! ๐ŸŽญโœจ"); } main();

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/septapod/mcp-emoji-stories'

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