Get the FREE Ultimate OpenClaw Setup Guide →

llm9p

LLM exposed as a 9P filesystem

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nervsystems-llm9p docker run -i nervsystems/llm9p:latest \
  --env ANTHROPIC_API_KEY="Your Anthropic API key (required for the API backend)"

How to use

llm9p exposes an LLM as a 9P filesystem. You interact with the model by reading and writing to files under the mounted filesystem, which translates standard file operations into prompts, model selections, and responses. The server supports multiple backends: Anthropic API via an API key, and Claude Code CLI via Claude Max subscription. You can mount the filesystem using 9P-compatible tools or environments such as plan9port, Infernode, or Linux 9P support, and then issue reads and writes to files like model, ask, and system to control the conversation and model behavior. This allows you to script LLM interactions, pipe prompts, or chain commands in shells without using SDKs or HTTP calls.

How to install

Prerequisites:

  • Go toolchain if you plan to build from source, or a Docker runtime if using the Docker approach described below.

Option A: Install as a Go binary (build from source or install via go install)

  • Prerequisites: Go 1.17+ installed
  • Install via Go (build from source is also shown in Option B): go install github.com/NERVsystems/llm9p/cmd/llm9p@latest
  • Run the binary directly once built: ./llm9p -addr :5640

Option B: Run via Docker (recommended if you do not want to install Go locally)

  • Prerequisites: Docker installed and running
  • Start the server (example): docker run -p 5640:5640 -e ANTHROPIC_API_KEY=sk--yourkey nervsystems/llm9p:latest -addr :5640

Notes:

  • If using the API backend, set ANTHROPIC_API_KEY in the environment where the server runs.
  • If using the Claude Code CLI backend, ensure claude is installed and authenticated (no API key needed).
  • The server defaults to port 5640 unless overridden with -addr.

Additional notes

Tips and caveats:

  • Environment variable ANTHROPIC_API_KEY is required for the API backend. Ensure it is exported in the server environment.
  • For the Claude CLI backend, ensure the claude CLI is installed and you have an active Claude Max subscription.
  • The default model names differ between API and CLI backends (see Default Settings in the README): claude-sonnet-4-20250514 for API, and sonnet for CLI.
  • When mounting via 9P, you can inspect and interact with the following file set: model, ask, temperature, system, context, tokens, new, _example, and streaming files under stream/.
  • For streaming, read chunks from stream/chunk after initiating a write to stream/ask; the read may block until a new chunk is available.
  • If you encounter permission or mount errors, verify the address, 9P client compatibility, and that the server is listening on the configured port.

Related MCP Servers

Sponsor this space

Reach thousands of developers ↗