Skip to content

Commit 0875267

Browse files
committed
Merge origin/main into fix/security-hardening-phase2
2 parents bad87d3 + 888f250 commit 0875267

30 files changed

Lines changed: 1810 additions & 446 deletions

.githooks/pre-commit

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
mapfile -t staged_rust_files < <(git diff --cached --name-only --diff-filter=ACMR -- '*.rs')
6+
7+
if [ "${#staged_rust_files[@]}" -eq 0 ]; then
8+
exit 0
9+
fi
10+
11+
if ! git diff --quiet -- "${staged_rust_files[@]}"; then
12+
echo "pre-commit: staged Rust files have unstaged changes." >&2
13+
echo "Please stage or stash those changes, then commit again." >&2
14+
exit 1
15+
fi
16+
17+
echo "pre-commit: running cargo fmt --all"
18+
cargo fmt --all
19+
20+
git add -- "${staged_rust_files[@]}"

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,31 @@ spacebot skill add anthropics/skills/pdf
211211
spacebot skill list
212212
```
213213

214+
### MCP Integration
215+
216+
Connect workers to external [MCP](https://modelcontextprotocol.io/) (Model Context Protocol) servers for arbitrary tool access -- databases, APIs, SaaS products, custom integrations -- without native Rust implementations:
217+
218+
- **Per-agent config** — each agent declares its own MCP servers in `config.toml`
219+
- **Both transports** — stdio (subprocess) for local tools, streamable HTTP for remote servers
220+
- **Automatic tool discovery** — tools are discovered via the MCP protocol and registered on worker ToolServers with namespaced names (`{server}_{tool}`)
221+
- **Automatic retry** — failed connections retry in the background with exponential backoff (5s initial, 60s cap, 12 attempts). A broken server never blocks agent startup
222+
- **Hot-reloadable** — add, remove, or change servers in config and they reconcile live
223+
- **API management** — full CRUD API under `/api/mcp/` for managing server definitions and monitoring connection status programmatically
224+
225+
```toml
226+
[[mcp_servers]]
227+
name = "filesystem"
228+
transport = "stdio"
229+
command = "npx"
230+
args = ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
231+
232+
[[mcp_servers]]
233+
name = "sentry"
234+
transport = "http"
235+
url = "https://mcp.sentry.io"
236+
headers = { Authorization = "Bearer ${SENTRY_TOKEN}" }
237+
```
238+
214239
---
215240

216241
## How It Works
@@ -455,6 +480,7 @@ No server dependencies. Single binary. All data lives in embedded databases in a
455480
| [Messaging](docs/content/docs/(messaging)/messaging.mdx) | Adapter architecture (Discord, Slack, Telegram, Twitch, Webchat, webhook) |
456481
| [Discord Setup](docs/content/docs/(messaging)/discord-setup.mdx) | Discord bot setup guide |
457482
| [Browser](docs/content/docs/(features)/browser.mdx) | Headless Chrome for workers |
483+
| [MCP](docs/content/docs/(features)/mcp.mdx) | External tool servers via Model Context Protocol |
458484
| [OpenCode](docs/content/docs/(features)/opencode.mdx) | OpenCode as a worker backend |
459485
| [Philosophy](docs/content/docs/(core)/philosophy.mdx) | Why Rust |
460486

@@ -476,8 +502,11 @@ Contributions welcome. Read [RUST_STYLE_GUIDE.md](RUST_STYLE_GUIDE.md) before wr
476502

477503
1. Fork the repo
478504
2. Create a feature branch
479-
3. Make your changes
480-
4. Submit a PR
505+
3. Run `./scripts/install-git-hooks.sh` once (installs pre-commit formatting hook)
506+
4. Make your changes
507+
5. Submit a PR
508+
509+
Formatting is still enforced in CI, but the hook catches it earlier by running `cargo fmt --all` before each commit.
481510

482511
---
483512

docs/PRD-slack-enhancements.md

Lines changed: 0 additions & 275 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"title": "Features",
3-
"pages": ["workers", "opencode", "tools", "browser", "cron", "skills", "ingestion"]
3+
"pages": ["workers", "opencode", "tools", "mcp", "browser", "cron", "skills", "ingestion"]
44
}

0 commit comments

Comments
 (0)