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 number, optional no not set Fixed collection window, in seconds. Not set = wait for a complete response.
timeout number, optional no 20, or 20 + settle Hard cap on the call, in seconds.

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.0

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.0
File Size Uploaded
text_adventure_mcp-0.1.0.tar.gz 9.0 MB Details

Built distribution (wheel)

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

Total release size: 9.0 MB

Release files / text_adventure_mcp-0.1.0.tar.gz

Download URL text_adventure_mcp-0.1.0.tar.gz
Size 9.0 MB
Tags Source
SHA-256 checksum
How to use checksums
8f9551abe6e19e458e297bd66e159aecd34feabc1d1ca2774f18683d3c15f6d6
BLAKE2b-256 checksum
How to use checksums
db501e901d73dc7626fdcca6b17e33391eeee1ec7d14c846f9b828c7d1f3bbad
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.0-py3-none-any.whl

Download URL text_adventure_mcp-0.1.0-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bce2e1aa9c32a61fecb3ba4c066d0ae5e680baee6083bacd03737a145bd88f3
BLAKE2b-256 checksum
How to use checksums
248aa2184c03941fe265aa3bec685f70048f3e4de4352038e76560800c290ac8
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.0 This release

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