Logo di Claude Plays Terminal Games

Claude Plays Terminal Games

Community
brendanlong

An MCP server that allows Claude to interact with terminal-based games through tmux

Autorebrendanlong
Repositoryclaude-code-plays-text-games
LinguaJavaScript
Fork
3
Stelle
16
Strumenti disponibili
0
Tipo di trasportostdio
Categorie
LicenzaMIT
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Claude Plays Terminal Games mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    16 stelle e 3 fork nel repository collegato.

Claude Plays Terminal Games

This project provides an MCP (Model Context Protocol) server that allows Claude to interact with terminal-based games through tmux. It enables Claude to play text-based games like Colossal Cave Adventure, NetHack, Zork, and other terminal games.

Security note: The start_game tool included in this repo can run arbitrary commands, so you probably don't want to give Claude unconditional permission to run it. The other commands are relatively safe to allow since they only work on whatever game is started, and the tmux session will end with it. This assumes you're running and actual game and not something like bash (in which case, send_line and send_keys can also run arbitrary commands).

Read more: Dwarf Fortress and Claude's ASCII Art Blindness

Examples

Features

  • MCP Server: Provides a clean API for Claude to interact with games
  • Terminal Game Support: Works with any terminal-based game available in your PATH
  • Tmux Integration: Uses tmux for reliable session management
  • Special Key Support: Send complex key combinations and special keys
  • Game Notes: Includes notes and guides for specific games

Quick Start

  1. Install dependencies:

    bash
    npm install
  2. Restart Claude Code - it will automatically detect the .mcp.json file and load the game controller server!

Available MCP Tools

  • start_game: Start a new game session

    • Parameters: game_name (e.g., "adventure", "nethack")
  • send_line: Send text commands to the game

    • Parameters: command (the command text)
  • send_keys: Send special keys to the game

    • Parameters: keys (array of key names, e.g., ["Escape"], ["C-c"])
  • read_output: Read the current game state/output

  • end_game: Terminate the game session

Supported Games

Any terminal-based game that can run in tmux, including:

  • Colossal Cave Adventure (adventure)
  • NetHack (nethack)
  • Zork series (zork1, zork2, zork3)
  • Dwarf Fortress (dwarffortress)
  • And many more...

Key Names Reference

Use these key names with the send_keys tool:

  • Arrow keys: Up, Down, Left, Right
  • Special keys: BSpace, BTab, DC (Delete), End, Enter, Escape, Home, IC (Insert), Space, Tab
  • Page keys: NPage/PageDown, PPage/PageUp
  • Function keys: F1 to F12
  • Modifiers: C- (Ctrl), S- (Shift), M- (Alt)
  • Examples: C-c (Ctrl+C), S-Tab (Shift+Tab), M-a (Alt+A)

Project Structure

claude-code-plays-text-games/
├── src/                   # Source code
│   ├── mcp-server.js      # Main MCP server
│   └── game-controller.js # Game interaction logic
├── scripts/               # Shell scripts for game interaction
│   ├── start_game.sh
│   ├── send_line.sh
│   ├── send_key.sh
│   ├── read_output.sh
│   └── end_game.sh
├── tests/                 # Test files and snapshots
│   ├── game-controller.test.js
│   └── __snapshots__/
├── game-notes/            # Game-specific notes and guides
│   └── dwarffortress/
├── CLAUDE.md              # Instructions for Claude
└── .mcp.json              # MCP server configuration

Requirements

  • Node.js
  • tmux
  • Game executables installed and available in PATH
  • Claude Code with MCP support

Testing

Run the test suite:

bash
npm test

Troubleshooting

  • Use /mcp in Claude Code to check if the server is connected
  • Ensure all game binaries are installed and in your PATH
  • Check that tmux is installed and working
  • Make sure you've run npm install to install dependencies

Installazione

TypingMind
{
  "mcpServers": {
    "claude-code-plays-text-games": {
      "command": "node",
      "args": [
        "src/mcp-server.js"
      ]
    }
  }
}

Usa MCP Claude Plays Terminal Games con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Claude Plays Terminal Games, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi Claude Plays Terminal Games come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di Claude Plays Terminal Games.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "claude-code-plays-text-games": {
      "command": "npx",
      "args": [
        "-y",
        "claude-game-mcp-server"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di Claude Plays Terminal Games, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di Claude Plays Terminal Games.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Claude Plays Terminal Games per aiutarmi con questa attività?
Claude Plays Terminal Games
Certo. Ho letto.
Ecco cosa ho trovato con Claude Plays Terminal Games.

Domande frequenti

A cosa serve il server MCP Claude Plays Terminal Games?

Claude Plays Terminal Games è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare Claude Plays Terminal Games MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Claude Plays Terminal Games con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Claude Plays Terminal Games con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Claude Plays Terminal Games, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego Claude Plays Terminal Games MCP a TypingMind?

Claude Plays Terminal Games funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre Claude Plays Terminal Games MCP in TypingMind?

Claude Plays Terminal Games mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare Claude Plays Terminal Games MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Claude Plays Terminal Games richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇