@@ -28,23 +28,30 @@ Only halt execution and ask a human IF:
2828
2929MCPProxy is a Go-based desktop application that acts as a smart proxy for AI agents using the Model Context Protocol (MCP). It provides intelligent tool discovery, massive token savings, and built-in security quarantine against malicious MCP servers.
3030
31- ## Editions (Personal & Teams )
31+ ## Editions (Personal & Server )
3232
3333MCPProxy is built in two editions from the same codebase using Go build tags:
3434
3535| Edition | Build Command | Binary | Distribution |
3636| ---------| --------------| --------| -------------|
3737| ** Personal** (default) | ` go build ./cmd/mcpproxy ` | ` mcpproxy ` | macOS DMG, Windows installer, Linux tar.gz |
38- | ** Teams** | ` go build -tags teams ./cmd/mcpproxy ` | ` mcpproxy-teams ` | Docker image, .deb package, Linux tar.gz |
38+ | ** Server** | ` go build -tags server ./cmd/mcpproxy ` | ` mcpproxy-server ` | Docker image, .deb package, Linux tar.gz |
39+
40+ > Every feature decision should ask: "Does this make the personal edition so good that developers tell their teammates about it?"
3941
4042### Key Directories
4143
4244| Directory | Purpose |
4345| -----------| ---------|
4446| ` cmd/mcpproxy/edition.go ` | Default edition = "personal" |
45- | ` cmd/mcpproxy/edition_teams.go ` | Build-tagged override for teams |
46- | ` cmd/mcpproxy/teams_register.go ` | Teams feature registration entry point |
47- | ` internal/teams/ ` | Teams-only code (all files have ` //go:build teams ` ) |
47+ | ` cmd/mcpproxy/edition_teams.go ` | Build-tagged override for server edition |
48+ | ` cmd/mcpproxy/teams_register.go ` | Server feature registration entry point |
49+ | ` internal/teams/ ` | Server-only code (all files have ` //go:build server ` ) |
50+ | ` internal/teams/auth/ ` | OAuth authentication, session management, JWT tokens, middleware |
51+ | ` internal/teams/users/ ` | User/session models, BBolt store, user server management |
52+ | ` internal/teams/workspace/ ` | Per-user workspace manager for personal upstream servers |
53+ | ` internal/teams/multiuser/ ` | Multi-user router, tool filtering, activity isolation |
54+ | ` internal/teams/api/ ` | Server REST API endpoints (user, admin, auth) |
4855| ` native/macos/ ` | Future Swift tray app (placeholder) |
4956| ` native/windows/ ` | Future C# tray app (placeholder) |
5057
@@ -54,6 +61,66 @@ The binary self-identifies its edition:
5461- ` mcpproxy version ` → ` MCPProxy v0.21.0 (personal) darwin/arm64 `
5562- ` /api/v1/status ` → ` {"edition": "personal", ...} `
5663
64+ ## Server Multi-User Authentication (Spec 024)
65+
66+ Server edition supports OAuth-based multi-user authentication with Google, GitHub, or Microsoft identity providers.
67+
68+ ### Server Configuration
69+
70+ ``` json
71+ {
72+ "teams" : {
73+ "enabled" : true ,
74+ "admin_emails" : [" admin@company.com" ],
75+ "oauth" : {
76+ "provider" : " google" ,
77+ "client_id" : " xxx.apps.googleusercontent.com" ,
78+ "client_secret" : " GOCSPX-xxx" ,
79+ "tenant_id" : " " ,
80+ "allowed_domains" : [" company.com" ]
81+ },
82+ "session_ttl" : " 24h" ,
83+ "bearer_token_ttl" : " 24h" ,
84+ "workspace_idle_timeout" : " 30m" ,
85+ "max_user_servers" : 20
86+ }
87+ }
88+ ```
89+
90+ ### Server API Endpoints
91+
92+ | Endpoint | Auth | Description |
93+ | ----------| ------| -------------|
94+ | ` GET /api/v1/auth/login ` | Public | Initiate OAuth login flow |
95+ | ` GET /api/v1/auth/callback ` | Public | OAuth callback (creates session) |
96+ | ` GET /api/v1/auth/me ` | Session/JWT | Get current user profile |
97+ | ` POST /api/v1/auth/token ` | Session | Generate JWT bearer token for MCP |
98+ | ` POST /api/v1/auth/logout ` | Session | Invalidate session |
99+ | ` GET /api/v1/user/servers ` | Session/JWT | List user's servers (personal + shared) |
100+ | ` POST /api/v1/user/servers ` | Session/JWT | Add personal upstream server |
101+ | ` GET /api/v1/user/activity ` | Session/JWT | User's activity log |
102+ | ` GET /api/v1/user/diagnostics ` | Session/JWT | Server health for user's servers |
103+ | ` GET /api/v1/admin/users ` | Admin | List all users |
104+ | ` POST /api/v1/admin/users/{id}/disable ` | Admin | Disable a user |
105+ | ` GET /api/v1/admin/activity ` | Admin | All users' activity logs |
106+ | ` GET /api/v1/admin/sessions ` | Admin | List active sessions |
107+
108+ ### Server Architecture
109+
110+ - ** Auth flow** : OAuth 2.0 + PKCE → Session cookie (Web UI) + JWT bearer (MCP/API)
111+ - ** Server types** : Shared (config file, single connection) + Personal (DB, per-user connections)
112+ - ** Isolation** : Users see only shared + own personal servers. Activity logs user-scoped.
113+ - ** Admin** : Identified by ` admin_emails ` config. Sees all activity, manages users.
114+ - ** Build tag** : All server code behind ` //go:build server ` . Personal edition unaffected.
115+
116+ ### Server Testing
117+
118+ ``` bash
119+ go test -tags server ./internal/teams/... -v -race # All server unit + integration tests
120+ go build -tags server ./cmd/mcpproxy # Build server edition
121+ go build ./cmd/mcpproxy # Verify personal edition unaffected
122+ ```
123+
57124## Architecture: Core + Tray Split
58125
59126- ** Core Server** (` mcpproxy ` ): Headless HTTP API server with MCP proxy functionality
@@ -66,11 +133,11 @@ The binary self-identifies its edition:
66133### Build
67134``` bash
68135go build -o mcpproxy ./cmd/mcpproxy # Core server (personal)
69- go build -tags teams -o mcpproxy-teams ./cmd/mcpproxy # Core server (teams )
136+ go build -tags server -o mcpproxy-server ./cmd/mcpproxy # Core server (server edition )
70137GOOS=darwin CGO_ENABLED=1 go build -o mcpproxy-tray ./cmd/mcpproxy-tray # Tray app
71138make build # Frontend and backend (personal)
72- make build-teams # Frontend and backend (teams )
73- make build-docker # Teams Docker image
139+ make build-server # Frontend and backend (server )
140+ make build-docker # Server Docker image
74141./scripts/build.sh # Cross-platform build
75142```
76143
@@ -546,6 +613,8 @@ See `docs/prerelease-builds.md` for download instructions.
546613- ` ~/.mcpproxy/mcp_config.json ` (config file), ` ~/.mcpproxy/config.db ` (BBolt - not directly used) (027-status-command)
547614- Go 1.24 (toolchain go1.24.10) + Cobra (CLI), Chi router (HTTP), BBolt (storage), Zap (logging), mcp-go (MCP protocol), crypto/hmac + crypto/sha256 (token hashing) (028-agent-tokens)
548615- BBolt database (` ~/.mcpproxy/config.db ` ) — new ` agent_tokens ` bucket (028-agent-tokens)
616+ - Go 1.24 (toolchain go1.24.10) + TypeScript 5.9 / Vue 3.5 + Chi router, BBolt, Zap logging, mcp-go, golang-jwt/jwt/v5, Vue 3, Pinia, DaisyUI (024-teams-multiuser-oauth)
617+ - BBolt database (` ~/.mcpproxy/config.db ` ) - new buckets for users, sessions, user servers (024-teams-multiuser-oauth)
549618
550619## Recent Changes
551620- 001-update-version-display: Added Go 1.24 (toolchain go1.24.10)
0 commit comments