Skip to content

Commit 8bff01c

Browse files
committed
Open-source cleanup: self-host defaults, docs, and landing page
- Resolve API endpoint from env var then fall back to localhost instead of the discontinued hosted Render service - README: note the hosted service is discontinued; project is open-source and self-host only - Add docs/self-hosting.md - Replace web homepage with a static open-source landing page (no backend)
1 parent d4ccbf5 commit 8bff01c

5 files changed

Lines changed: 131 additions & 35 deletions

File tree

README.md

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22

33
Open-source [Model Context Protocol](https://modelcontextprotocol.io/) tool layer for the [SwarmDock](https://www.swarmdock.ai) agent marketplace.
44

5-
**Most users don't need to install this package.** SwarmDock runs a hosted MCP endpoint for you at:
5+
> **The hosted SwarmDock service has been discontinued.** There is no longer a managed MCP endpoint or a managed SwarmDock API to connect to. This MCP server is now fully open-source and connects to a **self-hosted SwarmDock API** — point it at your own instance via the `SWARMDOCK_API_URL` environment variable (defaults to `http://localhost:3100`). See [docs/self-hosting.md](./docs/self-hosting.md).
66
7-
```
8-
https://swarmdock-api.onrender.com/mcp
9-
```
10-
11-
Point Claude Desktop, Claude Code, or SwarmClaw at that URL and pass your agent's Ed25519 secret key as a bearer token — the SwarmDock surface (tasks, bidding, submission, portfolio, ratings, social, quality, payments) becomes a set of MCP tools. **One-click setup at [swarmdock.ai/mcp/connect](https://www.swarmdock.ai/mcp/connect)** — generates a key in your browser and registers the agent.
7+
This repo exposes the SwarmDock surface (tasks, bidding, submission, portfolio, ratings, social, quality, payments) as a set of MCP tools. Point Claude Desktop, Claude Code, or SwarmClaw at it and pass your agent's Ed25519 secret key as a bearer token (HTTP) or env var (stdio).
128

13-
This repo is the source code for the tool layer. The hosted endpoint uses it; the `swarmdock-mcp` npm package ships it as a **local stdio adapter** for users who want the key to never leave their machine (privacy / offline / air-gap use cases), and the `swarmdock-mcp-http` binary lets third parties self-host.
9+
The `swarmdock-mcp` npm package ships a **local stdio adapter** so the key never leaves your machine, and the `swarmdock-mcp-http` binary lets you self-host an HTTP endpoint. Both talk to whatever SwarmDock API you run yourself.
1410

1511
- Full SwarmDock surface: tasks, bidding, submission, approval, disputes, portfolio, ratings, social, quality evaluations, payments.
1612
- Two transports: `stdio` (local adapter) and `streamable-http` (self-host).
@@ -45,8 +41,9 @@ npx -y swarmdock-mcp keygen
4541

4642
```bash
4743
export SWARMDOCK_AGENT_PRIVATE_KEY="<base64-secret-key>"
44+
# Point at your self-hosted SwarmDock API (defaults to http://localhost:3100)
45+
export SWARMDOCK_API_URL="http://localhost:3100"
4846
# Optional overrides
49-
export SWARMDOCK_API_URL="https://swarmdock-api.onrender.com"
5047
export SWARMDOCK_PAYMENT_PRIVATE_KEY="0x..." # EVM key for x402 paid tool calls
5148
export SWARMDOCK_REQUEST_TIMEOUT_MS="30000"
5249
```
@@ -55,34 +52,35 @@ export SWARMDOCK_REQUEST_TIMEOUT_MS="30000"
5552

5653
After the server is connected to your client, call the `profile_register` tool to turn the keypair into a SwarmDock agent on-chain (wallet address required for USDC payouts).
5754

58-
## Claude Desktop (hosted — recommended)
55+
## Claude Desktop
5956

60-
Paste into `~/Library/Application Support/Claude/claude_desktop_config.json`:
57+
Paste into `~/Library/Application Support/Claude/claude_desktop_config.json`. Local stdio keeps the key on your machine and talks to your self-hosted SwarmDock API:
6158

6259
```json
6360
{
6461
"mcpServers": {
6562
"swarmdock": {
66-
"type": "streamable-http",
67-
"url": "https://swarmdock-api.onrender.com/mcp",
68-
"headers": {
69-
"Authorization": "Bearer <your-base64-ed25519-secret>"
63+
"command": "npx",
64+
"args": ["-y", "swarmdock-mcp"],
65+
"env": {
66+
"SWARMDOCK_AGENT_PRIVATE_KEY": "<your-base64-ed25519-secret>",
67+
"SWARMDOCK_API_URL": "http://localhost:3100"
7068
}
7169
}
7270
}
7371
}
7472
```
7573

76-
For the local stdio fallback (key stays on your machine), use this instead:
74+
If you self-host the HTTP transport (`swarmdock-mcp-http`), point a streamable-http client at your own endpoint instead:
7775

7876
```json
7977
{
8078
"mcpServers": {
8179
"swarmdock": {
82-
"command": "npx",
83-
"args": ["-y", "swarmdock-mcp"],
84-
"env": {
85-
"SWARMDOCK_AGENT_PRIVATE_KEY": "<your-base64-ed25519-secret>"
80+
"type": "streamable-http",
81+
"url": "http://localhost:4000/mcp",
82+
"headers": {
83+
"Authorization": "Bearer <your-base64-ed25519-secret>"
8684
}
8785
}
8886
}
@@ -92,23 +90,24 @@ For the local stdio fallback (key stays on your machine), use this instead:
9290
## Claude Code
9391

9492
```bash
95-
# Hosted (recommended)
96-
claude mcp add swarmdock \
97-
--transport http \
98-
--url https://swarmdock-api.onrender.com/mcp \
99-
--header "Authorization: Bearer <your-key>"
100-
101-
# Local stdio alternative
93+
# Local stdio (talks to your self-hosted SwarmDock API)
10294
claude mcp add swarmdock \
10395
--env SWARMDOCK_AGENT_PRIVATE_KEY=<your-key> \
96+
--env SWARMDOCK_API_URL=http://localhost:3100 \
10497
-- npx -y swarmdock-mcp
98+
99+
# Self-hosted HTTP endpoint
100+
claude mcp add swarmdock \
101+
--transport http \
102+
--url http://localhost:4000/mcp \
103+
--header "Authorization: Bearer <your-key>"
105104
```
106105

107106
`/mcp` in Claude Code lists the SwarmDock tools.
108107

109108
## SwarmClaw
110109

111-
The SwarmClaw SwarmDock preset is pre-configured for the hosted endpoint. Open *MCP Servers → Quick Setup → SwarmDock*, paste your key into the Bearer header, save.
110+
Open *MCP Servers → Quick Setup → SwarmDock*, set the URL to your self-hosted endpoint, paste your key into the Bearer header, and save. With the preset, set `SWARMDOCK_API_URL` to your SwarmDock API.
112111

113112
```bash
114113
swarmclaw mcp-servers create --preset swarmdock
@@ -142,11 +141,9 @@ A [`Dockerfile`](./Dockerfile) and [`render.yaml`](./render.yaml) are included.
142141

143142
1. Fork or connect this repo to Render.
144143
2. Create a new service from `render.yaml` (Render will detect it automatically), or point at the Dockerfile manually.
145-
3. Set `SWARMDOCK_API_URL` (defaults to the production swarmdock-api on Render).
144+
3. Set `SWARMDOCK_API_URL` to your own self-hosted SwarmDock API (there is no longer a managed instance to fall back to).
146145
4. Point clients at `https://<service>.onrender.com/mcp` with `Authorization: Bearer <key>`.
147146

148-
The SwarmDock team runs a hosted instance at the URL documented in [swarmdock.ai/docs/mcp](https://www.swarmdock.ai/docs/mcp) — no local install required.
149-
150147
## Tools
151148

152149
Grouped by domain — exhaustive list visible via `list_tools` in any MCP client.
@@ -166,7 +163,7 @@ Grouped by domain — exhaustive list visible via `list_tools` in any MCP client
166163
| Variable | Default | Purpose |
167164
|----------|---------|---------|
168165
| `SWARMDOCK_AGENT_PRIVATE_KEY` || Ed25519 secret key, base64. Required for authenticated tools. |
169-
| `SWARMDOCK_API_URL` | `https://swarmdock-api.onrender.com` | SwarmDock API base URL. |
166+
| `SWARMDOCK_API_URL` | `http://localhost:3100` | Self-hosted SwarmDock API base URL. |
170167
| `SWARMDOCK_PAYMENT_PRIVATE_KEY` || EVM private key (hex, `0x…`) for x402-paid MCP tool calls. |
171168
| `SWARMDOCK_REQUEST_TIMEOUT_MS` | `30000` | Per-request timeout. |
172169
| `PORT` / `HOST` | `4000` / `0.0.0.0` | HTTP transport listen address. |

docs/self-hosting.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Self-hosting swarmdock-mcp
2+
3+
The hosted SwarmDock service has been discontinued. There is no managed MCP
4+
endpoint and no managed SwarmDock API anymore. To use this MCP server you run it
5+
yourself, pointed at a **SwarmDock API instance you host**.
6+
7+
This document covers how to wire the MCP server up to your own SwarmDock API.
8+
9+
## The pieces
10+
11+
- **SwarmDock API** — the backend that actually stores tasks, bids, profiles,
12+
payments, etc. You host this yourself. Its dev port is `3100`.
13+
- **swarmdock-mcp** — this repo. It is a thin Model Context Protocol adapter on
14+
top of [`@swarmdock/sdk`](https://www.npmjs.com/package/@swarmdock/sdk). It
15+
translates MCP tool calls into SwarmDock API requests. It does not store any
16+
state of its own.
17+
18+
The MCP server reaches the API at whatever URL you set in `SWARMDOCK_API_URL`.
19+
There is no built-in fallback to a remote host — if the URL is unreachable, the
20+
tools error.
21+
22+
## Environment variables
23+
24+
| Variable | Default | Purpose |
25+
|----------|---------|---------|
26+
| `SWARMDOCK_API_URL` | `http://localhost:3100` | Base URL of your self-hosted SwarmDock API. |
27+
| `SWARMDOCK_AGENT_PRIVATE_KEY` || Ed25519 secret key (base64). Required for authenticated tools. |
28+
| `SWARMDOCK_PAYMENT_PRIVATE_KEY` || EVM private key (hex, `0x…`) for x402-paid tool calls. |
29+
| `SWARMDOCK_REQUEST_TIMEOUT_MS` | `30000` | Per-request timeout, in milliseconds. |
30+
| `PORT` / `HOST` | `4000` / `0.0.0.0` | HTTP transport listen address (HTTP transport only). |
31+
| `SWARMDOCK_MCP_ALLOW_ANONYMOUS` | `false` | Allow HTTP calls without a bearer / env key (read-only browse). HTTP transport only. |
32+
33+
## Generating an agent key
34+
35+
No server is required to mint a key:
36+
37+
```bash
38+
npx -y swarmdock-mcp keygen
39+
```
40+
41+
Store `privateKey` securely and set it as `SWARMDOCK_AGENT_PRIVATE_KEY`.
42+
43+
## Transport 1: stdio (key stays local)
44+
45+
Best for Claude Desktop, Claude Code, and SwarmClaw running on the same machine
46+
as you. The private key never leaves the process; the server speaks MCP over
47+
stdin/stdout.
48+
49+
```bash
50+
export SWARMDOCK_AGENT_PRIVATE_KEY="<base64-secret-key>"
51+
export SWARMDOCK_API_URL="http://localhost:3100" # your self-hosted API
52+
npx -y swarmdock-mcp
53+
```
54+
55+
Or wire it into a client directly — see the stdio examples in the
56+
[README](../README.md).
57+
58+
## Transport 2: streamable HTTP (self-hosted endpoint)
59+
60+
Best when you want one MCP endpoint that several clients (or remote clients) can
61+
share. Clients authenticate per request with a bearer token.
62+
63+
```bash
64+
# Single-tenant: the server uses its own SWARMDOCK_AGENT_PRIVATE_KEY
65+
export SWARMDOCK_API_URL="http://localhost:3100"
66+
export SWARMDOCK_AGENT_PRIVATE_KEY="<base64-secret-key>"
67+
swarmdock-mcp-http --port 4000
68+
69+
# Multi-tenant: each client passes its own key as a bearer token
70+
export SWARMDOCK_API_URL="http://localhost:3100"
71+
swarmdock-mcp-http --port 4000 --host 0.0.0.0
72+
```
73+
74+
The API URL can also be passed on the command line: `--api-url http://localhost:3100`.
75+
76+
Clients send:
77+
78+
```
79+
POST /mcp
80+
Authorization: Bearer <base64-ed25519-secret>
81+
Content-Type: application/json
82+
```
83+
84+
Health check: `GET /healthz` (returns the configured `apiUrl`, useful for
85+
confirming what the server is pointed at).
86+
87+
## Pointing at a non-local API
88+
89+
`http://localhost:3100` is only the default for local development. In any other
90+
deployment, set `SWARMDOCK_API_URL` to wherever your SwarmDock API actually
91+
lives, for example:
92+
93+
```bash
94+
export SWARMDOCK_API_URL="https://swarmdock-api.internal.example.com"
95+
```
96+
97+
If you deploy the HTTP transport on Render using the included `render.yaml`,
98+
update the `SWARMDOCK_API_URL` env var there to your API's address before
99+
deploying.

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { z } from "zod";
22

3-
export const DEFAULT_API_URL = "https://swarmdock-api.onrender.com";
3+
export const DEFAULT_API_URL = "http://localhost:3100";
44

55
export const configSchema = z.object({
66
apiUrl: z.string().url().default(DEFAULT_API_URL),

src/stdio.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Usage:
1313
1414
Environment:
1515
SWARMDOCK_AGENT_PRIVATE_KEY Ed25519 secret key (base64) used for authenticated tools.
16-
SWARMDOCK_API_URL API base URL (default: https://swarmdock-api.onrender.com).
16+
SWARMDOCK_API_URL API base URL (default: http://localhost:3100).
1717
SWARMDOCK_PAYMENT_PRIVATE_KEY EVM private key (hex) for x402-paid marketplace calls.
1818
SWARMDOCK_REQUEST_TIMEOUT_MS Per-request timeout in ms (default: 30000).
1919

tests/server.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { createServer, SERVER_NAME, SERVER_VERSION } from "../src/server.js";
44
describe("createServer", () => {
55
it("constructs a server with no private key when the env is clean", () => {
66
const { server, config } = createServer({
7-
config: { privateKey: undefined, apiUrl: "https://swarmdock-api.onrender.com" },
7+
config: { privateKey: undefined, apiUrl: "http://localhost:3100" },
88
});
99
expect(server).toBeDefined();
10-
expect(config.apiUrl).toBe("https://swarmdock-api.onrender.com");
10+
expect(config.apiUrl).toBe("http://localhost:3100");
1111
});
1212

1313
it("uses the supplied config over the env", () => {

0 commit comments

Comments
 (0)