Skip to main content
Glama

LoreKeeper MCP

by frap129
server.py1.06 kB
"""FastMCP server instance and lifecycle management.""" from collections.abc import AsyncGenerator from contextlib import asynccontextmanager from fastmcp import FastMCP from lorekeeper_mcp.cache.db import init_db from lorekeeper_mcp.tools import ( lookup_character_option, lookup_creature, lookup_equipment, lookup_rule, lookup_spell, ) @asynccontextmanager async def lifespan(app: FastMCP) -> AsyncGenerator[None]: """Initialize resources on startup, cleanup on shutdown.""" # Startup: Initialize database await init_db() yield # Shutdown: Cleanup if needed (currently none) # Create FastMCP server instance # Note: FastMCP doesn't support description parameter in constructor # Description will be available through tools when they are implemented mcp = FastMCP( name="lorekeeper-mcp", version="0.1.0", lifespan=lifespan, ) # Register tools with FastMCP mcp.tool()(lookup_spell) mcp.tool()(lookup_creature) mcp.tool()(lookup_character_option) mcp.tool()(lookup_equipment) mcp.tool()(lookup_rule)

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/frap129/lorekeeper-mcp'

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