Bootstrap the SynapBus project — a local-first, MCP-native agent-to-agent messaging service written in Go. Includes: - Project constitution (10 architectural principles) - 10 feature specs with implementation tasks: 001 Core Messaging, 002 Agent Registry, 003 Human Auth (OAuth 2.1), 004 Channels, 005 Web UI, 006 MCP Server, 007 Trace Logging, 008 Semantic Search, 009 Attachments, 010 Swarm Patterns - Go project scaffold (cobra CLI, SQLite schema, Makefile) - Speckit templates and commands Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3.6 KiB
3.6 KiB
SynapBus
Local-first, MCP-native agent-to-agent messaging service. Single Go binary with embedded storage, semantic search, and a Slack-like Web UI.
Repo: github.com/smart-mcp-proxy/synapbus License: Apache 2.0
Tech Stack
| Component | Technology | Notes |
|---|---|---|
| Language | Go 1.23+ | Single binary, cross-compilation, zero CGO |
| Database | modernc.org/sqlite | Pure Go SQLite, no CGO required |
| Vectors | TFMV/hnsw | Pure Go HNSW vector index |
| MCP | mark3labs/mcp-go | MCP server library |
| HTTP | go-chi/chi | Lightweight router |
| Auth | ory/fosite | OAuth 2.1 framework |
| Web UI | Svelte 5 + Tailwind | Embedded via go:embed |
| Logging | slog | Structured logging |
| Attachments | Content-addressable FS | SHA-256 dedup |
Critical constraint: ZERO CGO. The binary must cross-compile cleanly for linux/amd64, darwin/arm64.
Directory Structure
synapbus/
├── cmd/synapbus/ # main.go entry point (cobra CLI)
├── internal/
│ ├── auth/ # OAuth 2.1, API keys, sessions
│ ├── messaging/ # core message engine
│ ├── channels/ # channel management
│ ├── agents/ # agent registry
│ ├── search/ # semantic search (embeddings + HNSW)
│ ├── storage/ # SQLite + migrations
│ ├── attachments/ # content-addressable FS
│ ├── mcp/ # MCP server (tools, transport)
│ ├── api/ # REST API handlers (internal, for Web UI only)
│ ├── web/ # embedded Web UI (Svelte SPA)
│ └── trace/ # agent activity logging
├── web/ # Svelte source (built → internal/web/dist/)
├── schema/ # SQLite migrations
├── docs/ # documentation
├── .specify/ # speckit specs
└── Makefile
Build & Run
make build # Build Go binary
make test # Run all tests
make dev # Run with hot reload
make web # Build Svelte SPA
make clean # Clean build artifacts
make lint # Run linters
./synapbus serve --port 8080 --data ./data
Environment Variables
| Variable | Description | Default |
|---|---|---|
SYNAPBUS_PORT |
HTTP server port | 8080 |
SYNAPBUS_DATA_DIR |
Data directory (SQLite DB, attachments, vector index) | ./data |
SYNAPBUS_EMBEDDING_PROVIDER |
Embedding provider: openai, gemini, ollama |
(none) |
SYNAPBUS_EMBEDDING_API_KEY |
API key for embedding provider | (none) |
SYNAPBUS_OLLAMA_URL |
Ollama server URL | http://localhost:11434 |
Conventions
- Go standard project layout with
internal/for non-public packages - Table-driven tests
- Context propagation through all function signatures
- Structured logging via
slog - SQL migrations in
schema/directory, numbered sequentially - MCP is THE agent interface — REST API is for internal Web UI use only
- Every agent action must be traceable by the human owner
- All storage in a single
--datadirectory (SQLite DB + attachments + vector index)
Architecture Principles
- Local-first, single binary — no external dependencies at runtime
- MCP-native — agents interact exclusively through MCP protocol tools
- Pure Go, zero CGO — all dependencies must be pure Go
- Multi-tenant with ownership — every agent has a human owner
- Observable by default — all agent actions traced, searchable, auditable
- Progressive complexity — basic messaging first, advanced features layered on top