|
| 1 | +# platter |
| 2 | + |
| 3 | +*Your computer, served on a platter.* |
| 4 | + |
| 5 | +MCP server that exposes **Read**, **Write**, **Edit**, and **Bash** tools over Stdio and StreamableHTTP transports. Built with [Bun](https://bun.sh), compiles to standalone executables with zero runtime dependencies. |
| 6 | + |
| 7 | +Designed to be used by browser-based (or any MCP-compatible) agents — like [Hadrian](https://github.com/ScriptSmith/hadrian) — to control a computer. |
| 8 | + |
| 9 | +## Tools |
| 10 | + |
| 11 | +| Tool | Description | |
| 12 | +|------|-------------| |
| 13 | +| **read** | Read file contents with pagination (offset/limit). Truncates at 2000 lines or 50KB. | |
| 14 | +| **write** | Create or overwrite files. Auto-creates parent directories. | |
| 15 | +| **edit** | Find-and-replace with exact (or fuzzy Unicode) matching. Requires a unique match. Returns a unified diff. | |
| 16 | +| **bash** | Execute shell commands with optional timeout. Output truncated to last 2000 lines or 50KB. | |
| 17 | + |
| 18 | +## Quick start |
| 19 | + |
| 20 | +### From a release binary |
| 21 | + |
| 22 | +Download the binary for your platform from [Releases](https://github.com/ScriptSmith/platter/releases), make it executable, and run: |
| 23 | + |
| 24 | +```bash |
| 25 | +chmod +x platter-linux-x64 |
| 26 | +./platter-linux-x64 # stdio mode |
| 27 | +./platter-linux-x64 -t http # HTTP mode on :3100 |
| 28 | +``` |
| 29 | + |
| 30 | +### From source |
| 31 | + |
| 32 | +```bash |
| 33 | +bun install |
| 34 | +bun run dev # run directly from TypeScript |
| 35 | +bun run compile # build standalone binary for current platform |
| 36 | +``` |
| 37 | + |
| 38 | +## Usage |
| 39 | + |
| 40 | +``` |
| 41 | +platter [options] |
| 42 | +
|
| 43 | +Options: |
| 44 | + -t, --transport <stdio|http> Transport mode (default: stdio) |
| 45 | + -p, --port <number> HTTP port (default: 3100) |
| 46 | + -h, --host <address> HTTP bind address (default: 127.0.0.1) |
| 47 | + --cwd <path> Working directory for tools (default: current directory) |
| 48 | + --cors-origin <origin> Allowed CORS origin (default: * — reflects request origin) |
| 49 | +``` |
| 50 | + |
| 51 | +### Stdio mode |
| 52 | + |
| 53 | +For use with Claude Desktop, Cursor, and other MCP clients that spawn a subprocess: |
| 54 | + |
| 55 | +```json |
| 56 | +{ |
| 57 | + "mcpServers": { |
| 58 | + "platter": { |
| 59 | + "command": "/path/to/platter" |
| 60 | + } |
| 61 | + } |
| 62 | +} |
| 63 | +``` |
| 64 | + |
| 65 | +### HTTP mode (StreamableHTTP) |
| 66 | + |
| 67 | +For browser-based agents and remote connections: |
| 68 | + |
| 69 | +```bash |
| 70 | +platter -t http -p 3100 |
| 71 | +``` |
| 72 | + |
| 73 | +The server exposes a single endpoint at `/mcp` that handles: |
| 74 | +- `POST /mcp` — JSON-RPC messages (initialize, tool calls) |
| 75 | +- `GET /mcp` — SSE notification stream |
| 76 | +- `DELETE /mcp` — session teardown |
| 77 | + |
| 78 | +CORS is enabled for all origins by default (reflects the request `Origin`). To restrict to a specific origin: |
| 79 | + |
| 80 | +```bash |
| 81 | +platter -t http --cors-origin https://myapp.example.com |
| 82 | +``` |
| 83 | + |
| 84 | +Sessions are managed via the `Mcp-Session-Id` header per the StreamableHTTP spec. |
| 85 | + |
| 86 | +## Build |
| 87 | + |
| 88 | +```bash |
| 89 | +bun install |
| 90 | +bun run build # bundle to dist/ |
| 91 | +bun run compile # standalone binary for current platform → ./platter |
| 92 | +bun run compile:all # cross-compile for linux-x64, linux-arm64, darwin-x64, darwin-arm64 |
| 93 | +bun run format # format with Biome |
| 94 | +bun run format:check # check formatting |
| 95 | +bun run lint # lint with Biome |
| 96 | +bun run typecheck # typecheck with TypeScript |
| 97 | +``` |
| 98 | + |
| 99 | +## License |
| 100 | + |
| 101 | +MIT |
0 commit comments