Skip to main content
Glama
server.py876 B
from pathlib import Path import sys from mcp.server.fastmcp import FastMCP mcp = FastMCP('Chess.com') try: from .chess_api import get_player_profile, get_player_stats except ImportError: # Fallback for direct execution where relative imports lack package context. src_dir = Path(__file__).resolve().parent.parent if str(src_dir) not in sys.path: sys.path.append(str(src_dir)) from chess.chess_api import get_player_profile, get_player_stats @mcp.tool() def get_chess_player_profile(username: str): """Get the public profile for a Chess.com player by username.""" return get_player_profile(username) @mcp.tool() def get_chess_player_stats(username: str): """Get the stats for a Chess.com player by username.""" return get_player_stats(username) def main(): mcp.run(transport="stdio") if __name__ == "__main__": main()

Latest Blog Posts

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/Ramakrishna-Gedala/mcp-chess'

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