MCP Hub
Back to servers

Sphere MCP Gaming Server

A gaming platform MCP server that enables LLMs to facilitate game discovery and access management through a Nostr-integrated payment system and Unicity blockchain identities.

Tools
5
Updated
Dec 5, 2025

Sphere MCP Gaming Server

MCP (Model Context Protocol) server for the Unicity gaming platform. Provides LLM access to games with payment-gated day passes via Nostr.

Features

  • Day Pass System: Users pay once for 24-hour access to all games
  • Nostr Integration: Payment requests sent via Nostr protocol
  • Unicity Blockchain: Uses nametags for identity and payment routing
  • Auto Identity: Server creates its own blockchain identity on first run
  • HTTP Transport: Supports both legacy SSE and modern Streamable HTTP

Available Games

IDNameDescription
unicity-quakeUnicity QuakeFast-paced multiplayer arena shooter
boxy-runBoxy RunEndless runner with blockchain rewards
unirunUnirunUnicity-native endless runner

MCP Tools

ToolParametersDescription
list_games-List all available games
check_accessunicity_idCheck access status and day pass validity
get_gameunicity_id, gameGet access to a specific game (initiates payment if needed)
confirm_paymentunicity_id, game (optional)Wait for payment confirmation
get_wallet_balancepasswordGet MCP wallet balance (admin)

All tools that require user identity take unicity_id as a parameter, making the API stateless and suitable for multi-user scenarios.

HTTP Endpoints

The server runs on HTTP (default port 3001) with two transport protocols:

Legacy SSE (MCP Inspector, older clients)

EndpointMethodDescription
/sseGETEstablish SSE stream, returns POST endpoint
/messages?sessionId=xxxPOSTSend JSON-RPC messages

Streamable HTTP (modern clients)

EndpointMethodDescription
/mcpPOSTSend JSON-RPC requests
/mcpGETSSE stream for responses

Session ID is passed via mcp-session-id header.

Health Check

EndpointMethodDescription
/healthGETReturns { status, sseSessions, httpSessions }

Quick Start

1. Configure Environment

cp .env.example .env

Edit .env with required values:

# Required
MCP_NAMETAG=gaming-mcp
PAYMENT_COIN_ID=your_coin_id_here

2. Run with Docker Compose

docker compose up -d

The server will:

  1. Generate a new private key (saved to ./data/identity.json)
  2. Mint a nametag on Unicity blockchain
  3. Publish Nostr binding for the nametag
  4. Start listening for MCP connections

3. View Logs

docker compose logs -f

Testing the MCP

Option 1: MCP Inspector (Recommended)

The MCP Inspector provides a web UI to interact with the server:

# Start the server
npm run build && npm start

# In another terminal, connect inspector to HTTP endpoint
npx @modelcontextprotocol/inspector --url http://localhost:3001/sse

This opens a browser UI where you can call tools interactively.

Option 2: curl (Health Check)

curl http://localhost:3001/health

Option 3: Claude Desktop Integration

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "gaming": {
      "url": "http://localhost:3001/sse"
    }
  }
}

Example Workflow

  1. User lists available games:

    Tool: list_games
    
  2. User requests a game with their Unicity ID:

    Tool: get_game
    Args: { "unicity_id": "alice", "game": "unicity-quake" }
    
  3. If no day pass, payment is requested. The user receives a payment request in their Unicity wallet.

  4. User confirms payment:

    Tool: confirm_payment
    Args: { "unicity_id": "alice" }
    
  5. On successful payment, user gets game URL and 24h access.

Configuration

VariableRequiredDefaultDescription
MCP_NAMETAGYes-Nametag for this MCP server
PAYMENT_COIN_IDYes-Coin ID for payments
MCP_PRIVATE_KEY_HEXNoAuto-generatedPrivate key (hex)
NOSTR_RELAY_URLNowss://nostr-relay.testnet.unicity.networkNostr relay
AGGREGATOR_URLNohttps://goggregator-test.unicity.networkUnicity aggregator
AGGREGATOR_API_KEYNo(testnet key)Aggregator API key
PAYMENT_AMOUNTNo1000000000Payment amount
DAY_PASS_HOURSNo24Day pass duration
PAYMENT_TIMEOUT_SECONDSNo120Payment timeout
DATA_DIRNo./dataData persistence directory
ADMIN_PASSWORDNoAuto-generatedAdmin password for wallet access
HTTP_PORTNo3001HTTP server port

Data Persistence

The server stores identity and nametag data in DATA_DIR:

  • identity.json - Private key (keep this safe!)
  • nametag-{name}.json - Minted nametag token

Mount this directory as a volume to persist across container restarts.

Development

# Install dependencies
npm install

# Build
npm run build

# Run locally
npm start

# Watch mode
npm run dev

Architecture

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   LLM Client    │────▶│   MCP Server    │────▶│  Nostr Relay    │
│ (Claude, etc.)  │     │ (HTTP transport)│     │                 │
└─────────────────┘     └─────────────────┘     └─────────────────┘
                               │                        │
                               ▼                        ▼
                        ┌─────────────────┐     ┌─────────────────┐
                        │    Unicity      │     │  User Wallet    │
                        │   Aggregator    │     │  (Sphere app)   │
                        └─────────────────┘     └─────────────────┘

License

MIT

Reviews

No reviews yet

Sign in to write a review