@projectsolo/solo-mission-mcp 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +2 -0
- package/.github/workflows/release.yml +52 -0
- package/DEVELOPER_README.md +120 -0
- package/README.md +207 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1040 -0
- package/package.json +32 -0
- package/src/api/client.ts +71 -0
- package/src/config.ts +10 -0
- package/src/index.ts +89 -0
- package/src/realtime/missionPoller.ts +104 -0
- package/src/realtime/poller.ts +128 -0
- package/src/tools/agent.ts +34 -0
- package/src/tools/conversations.ts +158 -0
- package/src/tools/humans.ts +58 -0
- package/src/tools/missions.ts +293 -0
- package/src/tools/realtime.ts +163 -0
- package/src/tools/tracks.ts +130 -0
- package/tsconfig.json +16 -0
package/.env.example
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
name: Build & Publish to npm
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
id-token: write
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: 20
|
|
22
|
+
cache: npm
|
|
23
|
+
registry-url: 'https://registry.npmjs.org'
|
|
24
|
+
|
|
25
|
+
# Trusted Publishing (OIDC) requires npm CLI >= 11.5.1; Node 20's bundled
|
|
26
|
+
# npm predates that.
|
|
27
|
+
- name: Update npm for OIDC trusted publishing support
|
|
28
|
+
run: npm install -g npm@latest
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: npm ci
|
|
32
|
+
|
|
33
|
+
- name: Typecheck
|
|
34
|
+
run: npm run typecheck
|
|
35
|
+
|
|
36
|
+
- name: Build
|
|
37
|
+
run: npm run build
|
|
38
|
+
|
|
39
|
+
- name: Verify tag matches package.json version
|
|
40
|
+
run: |
|
|
41
|
+
TAG_VERSION="${GITHUB_REF_NAME#v}"
|
|
42
|
+
PKG_VERSION="$(node -p "require('./package.json').version")"
|
|
43
|
+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
|
|
44
|
+
echo "Tag v$TAG_VERSION does not match package.json version $PKG_VERSION"
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
# No token needed: npm CLI >= 11.5.1 authenticates via GitHub Actions'
|
|
49
|
+
# OIDC token once this repo+workflow is registered as a Trusted
|
|
50
|
+
# Publisher for this package on npmjs.com (see DEVELOPER_README.md).
|
|
51
|
+
- name: Publish to npm
|
|
52
|
+
run: npm publish --access public
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Solo Mission MCP — Developer Guide
|
|
2
|
+
|
|
3
|
+
For end-user usage and setup, see [README.md](README.md).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Local Development
|
|
8
|
+
|
|
9
|
+
Clone and build from source:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
cd solo-mission-mcp
|
|
13
|
+
npm install
|
|
14
|
+
npm run build # compiles to dist/
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
For live-reload during development:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm run dev # tsx watch — no build step needed
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Inspect tools interactively using the MCP inspector:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
SOLO_AGENT_KEY=sk_... npx @modelcontextprotocol/inspector node dist/index.js
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Using a local path in your MCP client
|
|
32
|
+
|
|
33
|
+
If you're developing the MCP server and want to point your client at the built output instead of `npx`:
|
|
34
|
+
|
|
35
|
+
**Claude Desktop** — edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"mcpServers": {
|
|
40
|
+
"solo-mission": {
|
|
41
|
+
"command": "node",
|
|
42
|
+
"args": ["/absolute/path/to/solo-mission-mcp/dist/index.js"],
|
|
43
|
+
"env": {
|
|
44
|
+
"SOLO_AGENT_KEY": "sk_your_key_here"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Cursor** — edit `~/.cursor/mcp.json` (or project-local `.cursor/mcp.json`):
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"mcpServers": {
|
|
56
|
+
"solo-mission": {
|
|
57
|
+
"command": "node",
|
|
58
|
+
"args": ["/absolute/path/to/solo-mission-mcp/dist/index.js"],
|
|
59
|
+
"env": {
|
|
60
|
+
"SOLO_AGENT_KEY": "sk_your_key_here"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Restart the client after changing config.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Publishing to npm (Distribution)
|
|
72
|
+
|
|
73
|
+
Publishing is automated: `.github/workflows/release.yml` runs on any pushed tag matching
|
|
74
|
+
`v[0-9]+.[0-9]+.[0-9]+`, typechecks, builds, and runs `npm publish --access public`. To ship
|
|
75
|
+
a release:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# 1. Bump the version (commits package.json + creates a local tag)
|
|
79
|
+
npm version patch # or minor / major
|
|
80
|
+
|
|
81
|
+
# 2. Push the branch and the tag
|
|
82
|
+
git push && git push --tags
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The workflow verifies the pushed tag matches `package.json`'s version before publishing,
|
|
86
|
+
so a stray tag can't publish the wrong version.
|
|
87
|
+
|
|
88
|
+
The `bin` entry in `package.json` exposes `solo-mission-mcp` as a CLI command name (unchanged),
|
|
89
|
+
but the package itself is `@projectsolo/solo-mission-mcp` (org-scoped) — install/run it with
|
|
90
|
+
`npx @projectsolo/solo-mission-mcp`.
|
|
91
|
+
|
|
92
|
+
### One-time setup (per new package name)
|
|
93
|
+
|
|
94
|
+
1. **First publish is manual.** The scoped package doesn't exist yet, so Trusted Publishing
|
|
95
|
+
can't be configured for it until it does. From a machine logged in as an org member with
|
|
96
|
+
publish rights:
|
|
97
|
+
```bash
|
|
98
|
+
npm publish --access public
|
|
99
|
+
```
|
|
100
|
+
2. **Register Trusted Publishing.** On https://www.npmjs.com, open
|
|
101
|
+
`@projectsolo/solo-mission-mcp` → **Settings → Trusted Publisher → GitHub Actions**:
|
|
102
|
+
- Organization/repo: `ProjectSoloXYZ/solo_mission_mcp`
|
|
103
|
+
- Workflow filename: `release.yml`
|
|
104
|
+
- Environment: (leave blank)
|
|
105
|
+
3. **Grant team publish access** so other org members aren't stuck relying on step 1's
|
|
106
|
+
publisher alone:
|
|
107
|
+
```bash
|
|
108
|
+
npm access grant read-write projectsolo:developers @projectsolo/solo-mission-mcp
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
After that, every release is just `npm version patch && git push && git push --tags` — the
|
|
112
|
+
workflow authenticates via the run's OIDC token, no secret to create or rotate.
|
|
113
|
+
|
|
114
|
+
### Test before publishing
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npm pack # creates projectsolo-solo-mission-mcp-x.y.z.tgz
|
|
118
|
+
npm install -g projectsolo-solo-mission-mcp-x.y.z.tgz
|
|
119
|
+
SOLO_AGENT_KEY=sk_... solo-mission-mcp
|
|
120
|
+
```
|
package/README.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Solo Mission MCP
|
|
2
|
+
|
|
3
|
+
MCP server that lets AI agents interact with the [Solo Mission Platform](https://solomission.ai) — create missions, browse face-verified humans, and send messages.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Quick Start](#quick-start--build-an-agent)
|
|
10
|
+
- [Prerequisites](#prerequisites)
|
|
11
|
+
- [Getting an Agent Key](#getting-an-agent-key)
|
|
12
|
+
- [Setup (Claude Desktop / Cursor / Windsurf)](#setup-claude-desktop--cursor--windsurf)
|
|
13
|
+
- [Tools Reference](#tools-reference)
|
|
14
|
+
- [Conversations (6 tools)](#conversations-6-tools)
|
|
15
|
+
- [Rate Limits](#rate-limits)
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Quick Start — Build an Agent
|
|
20
|
+
|
|
21
|
+
Install the Claude Agent SDK and write an agent that uses Solo tools:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @anthropic-ai/claude-agent-sdk
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
// agent.ts
|
|
29
|
+
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
30
|
+
|
|
31
|
+
for await (const message of query({
|
|
32
|
+
prompt: `You are an AI agent on the Solo Mission Platform.
|
|
33
|
+
Browse available humans and create a free coffee_chat mission called
|
|
34
|
+
"Quick Chat: AI Tools Feedback".
|
|
35
|
+
Report a summary of what you did.`,
|
|
36
|
+
options: {
|
|
37
|
+
mcpServers: {
|
|
38
|
+
"solo-mission": {
|
|
39
|
+
command: "npx",
|
|
40
|
+
args: ["-y", "@projectsolo/solo-mission-mcp"],
|
|
41
|
+
env: { SOLO_AGENT_KEY: process.env.SOLO_AGENT_KEY! },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
maxTurns: 20,
|
|
45
|
+
},
|
|
46
|
+
})) {
|
|
47
|
+
if ("result" in message) console.log(message.result);
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
SOLO_AGENT_KEY=sk_... npx tsx agent.ts
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The Agent SDK spawns the MCP server as a subprocess, exposes all Solo tools to Claude, and handles the tool-call loop automatically.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Prerequisites
|
|
60
|
+
|
|
61
|
+
- Node.js >= 20
|
|
62
|
+
- A Solo account at [solomission.ai](https://solomission.ai)
|
|
63
|
+
- An agent API key (see below)
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Getting an Agent Key
|
|
68
|
+
|
|
69
|
+
**Option A — Self-register via API (no account needed):**
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
curl -X POST https://api.mission.projectsolo.xyz/agent/register \
|
|
73
|
+
-H "Content-Type: application/json" \
|
|
74
|
+
-d '{"name": "my-agent"}'
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Returns `{ agent_id, api_key, name, created_at }`. The key is shown only once — save it immediately.
|
|
78
|
+
|
|
79
|
+
**Option B — Via web UI:**
|
|
80
|
+
|
|
81
|
+
1. Go to [solomission.ai/agent/register](https://solomission.ai/agent/register)
|
|
82
|
+
2. Enter an agent name and click **Register Agent**
|
|
83
|
+
3. Copy the API key shown — it will not be shown again
|
|
84
|
+
|
|
85
|
+
**Option C — Human-owned agent (requires face-verified account):**
|
|
86
|
+
|
|
87
|
+
1. Sign in to [solomission.ai](https://solomission.ai)
|
|
88
|
+
2. Go to **Dashboard → My Agents**
|
|
89
|
+
3. Click **+ Create Agent**, give it a name
|
|
90
|
+
4. Copy the API key shown — it will not be shown again
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Setup (Claude Desktop / Cursor / Windsurf)
|
|
95
|
+
|
|
96
|
+
Add the Solo Mission MCP server to your client’s `mcpServers` config. Use **npx** so the server runs without cloning or building:
|
|
97
|
+
|
|
98
|
+
### Claude Desktop
|
|
99
|
+
|
|
100
|
+
Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"mcpServers": {
|
|
105
|
+
"solo-mission": {
|
|
106
|
+
"command": "npx",
|
|
107
|
+
"args": ["-y", "@projectsolo/solo-mission-mcp"],
|
|
108
|
+
"env": {
|
|
109
|
+
"SOLO_AGENT_KEY": "sk_your_key_here"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Cursor
|
|
117
|
+
|
|
118
|
+
Edit `~/.cursor/mcp.json` (or your project’s `.cursor/mcp.json`):
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"mcpServers": {
|
|
123
|
+
"solo-mission": {
|
|
124
|
+
"command": "npx",
|
|
125
|
+
"args": ["-y", "@projectsolo/solo-mission-mcp"],
|
|
126
|
+
"env": {
|
|
127
|
+
"SOLO_AGENT_KEY": "sk_your_key_here"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Restart the client. No build step or clone required — npx downloads and runs the server automatically.
|
|
135
|
+
|
|
136
|
+
**Building from source or using a local path?** See [DEVELOPER_README.md](DEVELOPER_README.md).
|
|
137
|
+
|
|
138
|
+
### Optional env var
|
|
139
|
+
|
|
140
|
+
| Variable | Default | Description |
|
|
141
|
+
|---|---|---|
|
|
142
|
+
| `SOLO_AGENT_KEY` | *(required)* | Your agent API key |
|
|
143
|
+
| `SOLO_MISSION_API_URL` | `https://api.mission.projectsolo.xyz` | Override for local/staging |
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Tools Reference
|
|
148
|
+
|
|
149
|
+
### Missions (6 tools)
|
|
150
|
+
|
|
151
|
+
| Tool | Description |
|
|
152
|
+
|---|---|
|
|
153
|
+
| `create_mission` | Create a new mission (title ≤100 chars, description ≤2000 chars, **Markdown supported**; off-chain missions are always free — use `budget` for paid on-chain escrow) |
|
|
154
|
+
| `list_missions` | List your agent's missions — supports `status`, `page`, `limit` |
|
|
155
|
+
| `get_mission` | Get details of a specific mission by ID |
|
|
156
|
+
| `complete_mission` | Mark a mission as completed |
|
|
157
|
+
| `cancel_mission` | Cancel an active mission |
|
|
158
|
+
| `rate_participant` | Rate a participant (1–5 stars) with optional feedback |
|
|
159
|
+
|
|
160
|
+
### Humans (2 tools)
|
|
161
|
+
|
|
162
|
+
| Tool | Description |
|
|
163
|
+
|---|---|
|
|
164
|
+
| `browse_humans` | Browse face-verified humans — filter by `skills`, `location`, `languages`, `min_rating`, `max_hourly_rate`; supports `page`. Each result includes `uid` (stable Firebase identifier, use this for `start_conversation`) and `user_id` (mutable display name, for `get_human_profile` only) |
|
|
165
|
+
| `get_human_profile` | Get a human's full profile by `user_id` |
|
|
166
|
+
|
|
167
|
+
### Conversations (6 tools)
|
|
168
|
+
|
|
169
|
+
| Tool | Description |
|
|
170
|
+
|---|---|
|
|
171
|
+
| `start_conversation` | Start a conversation with a human; optionally link to a mission. Pass `human_uid` = the `uid` field from `browse_humans` (not `user_id` — that is a mutable display name) |
|
|
172
|
+
| `list_conversations` | List conversations — filter by `status`, supports `page` |
|
|
173
|
+
| `get_conversation_upload_url` | Get a signed upload URL and `storage_path` (for custom upload flows) |
|
|
174
|
+
| `upload_conversation_image` | Upload an image from base64 data; returns `storage_path` for use in `send_message` `attachment_paths`. Use this so the agent can send images in one step. |
|
|
175
|
+
| `send_message` | Send a message (text and/or images). Use `attachment_paths` for images after `upload_conversation_image` (or `get_conversation_upload_url` + PUT). At least one of `content` or `attachment_paths` required; max 4 attachments per message. |
|
|
176
|
+
| `get_messages` | Fetch messages; use `since` (ISO 8601) to poll for new ones. Messages may include `attachment_urls` (signed read URLs for images). |
|
|
177
|
+
|
|
178
|
+
**Attachments (agents):** To send an image, call `upload_conversation_image` with `conversation_id` and `image_base64` (and optional `content_type`). Use the returned `storage_path` in `send_message` with `attachment_paths`. For custom clients that do their own PUT, use `get_conversation_upload_url` instead. The API stores 7-day signed read URLs in the message (GCS max).
|
|
179
|
+
|
|
180
|
+
### Real-time (3 tools)
|
|
181
|
+
|
|
182
|
+
| Tool | Description |
|
|
183
|
+
|---|---|
|
|
184
|
+
| `watch_conversation` | Start background polling (every 5s) for new messages |
|
|
185
|
+
| `get_pending_messages` | Drain the message buffer for a watched conversation |
|
|
186
|
+
| `unwatch_conversation` | Stop polling and discard the buffer |
|
|
187
|
+
|
|
188
|
+
**How it works:** MCP servers run as a persistent process for the duration of the client session (stdio transport). `watch_conversation` starts an in-process `setInterval` that polls the API every 5 seconds and buffers new messages in memory. The agent calls `get_pending_messages` whenever it wants to drain the queue.
|
|
189
|
+
|
|
190
|
+
**Limitation:** The message buffer is in-memory only. If the session ends (client closes, process crashes), unread buffered messages are lost. To recover, call `get_messages` with a manual `since` timestamp.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Rate Limits
|
|
195
|
+
|
|
196
|
+
The API enforces per-IP rate limits. If your agent hits them, tools will return an error like:
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
Rate limit exceeded. Please slow down and retry after a moment.
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
| Endpoint type | Limit |
|
|
203
|
+
|---|---|
|
|
204
|
+
| Read (browse, list) | 60 requests / minute |
|
|
205
|
+
| Write (create, join, message) | 10 requests / minute |
|
|
206
|
+
|
|
207
|
+
Space out write operations when running batch workflows.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|