Skip to main content

text-adventure-mcp

A minimal MCP server that lets an agent converse with a line-oriented text service over TCP: a Zork-style game, a telnet MUD, or any automation that exposes a text command interface.

The server is a dumb pipe. It holds the socket, terminates lines, strips escape codes, and hands back whatever the service said. All interpretation of the text stays with the agent.

The connection is stateful, so the server keeps one socket open per address across tool calls.

Tool

One tool, text_adventure:

parameter type required default meaning
command string yes — Text to send. Empty sends a blank line.
address string no 127.0.0.1:3000 host:port of the service. Identifies the connection.
settle_ms integer, optional no not set Fixed collection window, in milliseconds. Not set = wait for a complete response.
timeout_ms integer, optional no 20000, or 20000 + settle_ms Hard cap on the call, in milliseconds.

Failed calls are reported as MCP tool errors. The MCP SDK puts Error executing tool text_adventure: in front of the message, so the status lines and any partial text follow that prefix.

Safety

This is an arbitrary outbound TCP client and can reach anything the host can reach, including internal services. That is the point. Do not expose it to untrusted callers, and do not point it at services you are not authorized to use.

The connection is raw TCP. The server does no telnet negotiation (no IAC DO/WILL/WONT/DONT replies) and strips no IAC bytes. Telnet bytes from the service reach the caller as replacement characters. Only ANSI escape sequences are removed from the text.

Install and run

Requires Python 3.11 or newer.

Straight from PyPI (stdio transport; blocks waiting for a client):

uvx text-adventure-mcp

Or point an MCP client at it:

{
  "servers": {
    "text-adventure": {
      "type": "stdio",
      "command": "uvx",
      "args": ["text-adventure-mcp"]
    }
  }
}

Develop

uv venv .venv --python 3.12
uv pip install -e ".[dev]"
.venv/Scripts/text-adventure-mcp.exe      # stdio transport; blocks waiting for a client

Tests

.venv/Scripts/python.exe -m pytest

Naming note

The design notes call the SDK class FastMCP. In the official mcp 2.x package that class is named MCPServer (from mcp.server.mcpserver import MCPServer). This project depends on mcp>=2,<3 and uses MCPServer. The mcp.server.fastmcp module from 1.x is not present in 2.x.

Metadata

Release files for text-adventure-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for text-adventure-mcp 0.1.1
File Size Uploaded
text_adventure_mcp-0.1.1.tar.gz 9.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for text-adventure-mcp 0.1.1
File Interpreter ABI Platform
text_adventure_mcp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 MB

Release files / text_adventure_mcp-0.1.1.tar.gz

Download URL text_adventure_mcp-0.1.1.tar.gz
Size 9.0 MB
Tags Source
SHA-256 checksum
How to use checksums
1921fda435b6555b391935c9435a7c3b209b0a252c94066b55595dbc45717ae4
BLAKE2b-256 checksum
How to use checksums
3cb80ad1be8f82f33d5928a2537254e8caae9fb5557ae62596b73bbc32777982
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / text_adventure_mcp-0.1.1-py3-none-any.whl

Download URL text_adventure_mcp-0.1.1-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
927f0ea4f8c3fb63aec50eadf62697694490e916c21c02d9418f3129812afae6
BLAKE2b-256 checksum
How to use checksums
7857f6444bbc70fd4f6e7a1ac5e0171469a8c27b944d951123f054051545fc66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page