Skip to main content
Glama
freshlife001

Texas Holdem MCP Server

by freshlife001

login

Access and list all available poker tables by authenticating with a username. Use this to join Texas Holdem games on the MCP server.

Instructions

login and list all tables in the poker game

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • Executes the 'login' tool: registers the player with the given name, retrieves player ID, lists available poker tables with details.
    if (request.params.name === "login") {
      response = await sendPokerRequest('register', { name: args?.name });
      view_text = `Logged in as ${args?.name}.\n Your PlayerID: ${response.playerId}.\n Available tables:\n`;
      
      // After login, fetch tables
      const tables = await sendPokerRequest('listTables', {});
      if (tables && tables.length > 0) {
        tables.forEach((table: any, index: number) => {
          view_text += `Table: ${table.name} - TableID: ${table.id} - Players: ${table.players}/${table.maxPlayers} - Blinds: $${table.smallBlind}/$${table.bigBlind}\n`;
        });
      } else {
        view_text += "No tables available. Create one to start playing.";
      }
    } 
  • src/mcpServer.ts:31-41 (registration)
    Registers the 'login' tool in the MCP server's listTools handler, defining its name, description, and input schema.
    {
      name: "login",
      description: "login and list all tables in the poker game",
      inputSchema: {
        type: "object",
        properties: {
          name: { type: "string" },
        },
        required: ['name'],
      },
    },
  • Helper function used by the 'login' handler to send 'register' and 'listTables' requests to the poker server via socket.io.
    function sendPokerRequest(method: string, params: any): Promise<any> {
      return new Promise((resolve, reject) => {
        const request = {
          method,
          params,
          id: Date.now()
        };
        
        //console.log(`[Client] Sending request: ${method}`, params);
        
        socket.emit('action', request, (response: any) => {
          //console.log(`[Client] Received response for ${method}:`, response);
          
          if (response.error) {
            console.error(`[Client] Error in ${method}:`, response.error);
            reject(response.error);
          } else {
            resolve(response.result);
          }
        });
      });
    }

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other Tools

Related Tools

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/freshlife001/mcp_poker'

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