MCP server for playing interactive fiction games (Glulx and Z-machine)
SaferSkills independently audited mcp-server-if (MCP Server) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
An MCP (Model Context Protocol) server for playing interactive fiction games. Enables AI assistants like Claude to play text adventure games through a standardized interface.
# Using uvx (recommended)
uvx mcp-server-if
# Or install with pip
pip install mcp-server-ifThe package includes pre-compiled interpreters. No additional setup required.
| Variable | Description | Default |
|---|---|---|
IF_GAMES_DIR | Directory to store games | ~/.mcp-server-if/games |
IF_GLULXE_PATH | Override path to glulxe binary | Bundled binary |
IF_BOCFEL_PATH | Override path to bocfel binary | Bundled binary |
IF_REQUIRE_JOURNAL | Require journal reflections | false |
mcp-server-if --help
Options:
--games-dir PATH Directory to store games
--glulxe-path PATH Path to glulxe binary (overrides bundled)
--require-journal Require journal reflections between turnsAdd to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"interactive-fiction": {
"command": "uvx",
"args": ["mcp-server-if"]
}
}
}claude mcp add interactive-fiction -- uvx mcp-server-ifplay_ifPlay a turn of interactive fiction.
play_if(game="zork", command="go north")
play_if(game="zork", command="", journal="...reflection...") # with journalinglist_gamesList available games and their save state status.
download_gameDownload a game from the IF Archive or any URL.
download_game(name="advent", url="advent.ulx")
download_game(name="bronze", url="https://example.com/Bronze.gblorb")reset_gameReset a game to start fresh (clears save state, preserves journal).
read_journalRead the playthrough journal for a game.
read_journal(game="zork", recent=10) # last 10 entriessearch_journalSearch journal entries by keyword.
search_journal(game="zork", query="treasure")Glulx (modern, uses glulxe interpreter):
.ulx - Raw Glulx game files.gblorb - Blorb containers with Glulx gamesZ-machine (classic Infocom format, uses bocfel interpreter):
.z3, .z4, .z5, .z7, .z8 - Z-code game files.zblorb - Blorb containers with Z-machine gamesFind games at the IF Archive: Glulx games, Z-code games.
Enable with --require-journal or IF_REQUIRE_JOURNAL=true. In this mode:
{game}/journal.jsonlread_journal and search_journal to review your playthroughThis encourages thoughtful, reflective gameplay rather than rushing through.
~/.mcp-server-if/games/{name}/.ulx, .gblorb, .z5, etc.)state/ - autosave data (persists between sessions)metadata.json - session metadatajournal.jsonl - playthrough journal (if enabled)Requires uv, a C compiler (gcc or clang), a C++ compiler (g++ or clang++), make, and git.
git clone --recursive https://github.com/davidar/mcp-server-if.git
cd mcp-server-if
uv sync --group dev
uv run pytest -vuv sync compiles the bundled interpreters (glulxe and bocfel) from source automatically. If binaries are missing after a fresh clone, run uv sync --reinstall-package mcp-server-if to force recompilation.
This shouldn't happen with pip/uvx installs. If it does:
pip install --force-reinstall mcp-server-if or uv sync --reinstall-package mcp-server-ifIF_GLULXE_PATH to a manually installed glulxeUse list_games to see available games, or download_game to get new ones.
In-game save/restore triggers file dialogs that aren't supported. Use the automatic autosave system instead - your game state persists between sessions automatically.
MIT License - see LICENSE for details.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.