Skip to content

Commit d0125b3

Browse files
committed
Initial commit
0 parents  commit d0125b3

File tree

15 files changed

+1272
-0
lines changed

15 files changed

+1272
-0
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
name: Lint & Typecheck
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: oven-sh/setup-bun@v2
16+
- run: bun install --frozen-lockfile
17+
- run: bun run format:check
18+
- run: bun run lint
19+
- run: bun run typecheck
20+
21+
build:
22+
name: Build
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: oven-sh/setup-bun@v2
27+
- run: bun install --frozen-lockfile
28+
- run: bun run compile
29+
- name: Smoke test (stdio)
30+
run: |
31+
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"ci","version":"1.0"}}}' \
32+
| ./platter 2>/dev/null \
33+
| head -1 \
34+
| jq -e '.result.serverInfo.name == "platter"'

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build:
12+
name: Build ${{ matrix.target }}
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
include:
17+
- target: bun-linux-x64
18+
artifact: platter-linux-x64
19+
- target: bun-linux-arm64
20+
artifact: platter-linux-arm64
21+
- target: bun-darwin-x64
22+
artifact: platter-darwin-x64
23+
- target: bun-darwin-arm64
24+
artifact: platter-darwin-arm64
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: oven-sh/setup-bun@v2
28+
- run: bun install --frozen-lockfile
29+
- name: Compile
30+
run: bun build src/index.ts --compile --target=${{ matrix.target }} --outfile=${{ matrix.artifact }}
31+
- uses: actions/upload-artifact@v4
32+
with:
33+
name: ${{ matrix.artifact }}
34+
path: ${{ matrix.artifact }}
35+
36+
release:
37+
name: Create Release
38+
needs: build
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/download-artifact@v4
42+
with:
43+
path: artifacts
44+
merge-multiple: true
45+
- name: Make binaries executable
46+
run: chmod +x artifacts/platter-*
47+
- name: Create GitHub Release
48+
uses: softprops/action-gh-release@v2
49+
with:
50+
generate_release_notes: true
51+
files: artifacts/platter-*

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
dist/
3+
/platter

LICENSE.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Copyright 2026 Adam Smith
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8+

README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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

biome.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.4.8/schema.json",
3+
"files": {
4+
"includes": ["src/**/*.ts"]
5+
},
6+
"linter": {
7+
"enabled": true,
8+
"rules": {
9+
"recommended": true,
10+
"style": {
11+
"noNonNullAssertion": "off"
12+
},
13+
"suspicious": {
14+
"noExplicitAny": "off"
15+
}
16+
}
17+
},
18+
"formatter": {
19+
"enabled": true,
20+
"indentStyle": "space",
21+
"indentWidth": 2,
22+
"lineWidth": 120
23+
}
24+
}

0 commit comments

Comments
 (0)