Skip to content

Commit 6e605b5

Browse files
committed
refactor(config): rename Teams→ServerEdition; internal/teams→serveredition; teams→server_edition key (alias)
Renames the server-edition surface for clarity and to disambiguate from any "teams" collaboration concept (MCP-1086). Go: - config.TeamsConfig→ServerEditionConfig, TeamsOAuthConfig→ServerEditionOAuthConfig, DefaultTeamsConfig→DefaultServerEditionConfig; Config.Teams→Config.ServerEdition. - Config key/tag teams→server_edition. Legacy "teams" key still loads onto ServerEdition via normalize-on-load in loadConfigFile (new key wins). Compiles in both editions (ServerEditionConfig is a struct{} stub in personal builds). - Move internal/teams/→internal/serveredition/ (package teams→serveredition, incl. broker/ from #588); update all imports and selectors. - Rename exported symbols: TeamsAuthMiddleware→ServerEditionAuthMiddleware, TeamsStatusInfo→ServerEditionStatusInfo, TeamsInfo→ServerEditionInfo, wireTeamsOAuth→wireServerEditionOAuth. - `mcpproxy status -o json` server-edition block key teams→server_edition (aligns output with the rename). Edition strings ("personal"/"server"), the `server` build tag, and the edition_teams.go build-tag filename are unchanged per scope. Tests: - New file-load back-compat tests: new server_edition key, legacy teams key, and both-keys-new-wins (server-tagged). Docs: - CLAUDE.md path/config-key references (kept under the 40k char gate); active feature docs; specs config-key + code-path references. Spec directory slugs (029-mcpproxy-teams, 024-teams-multiuser-oauth) and historical narrative are preserved intact. swagger: teams config is swaggerignore — no REST surface change (verified). Related MCP-1086
1 parent cb9851c commit 6e605b5

78 files changed

Lines changed: 407 additions & 313 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ MCPProxy is built in two editions from the same codebase using Go build tags:
4545
|-----------|---------|
4646
| `cmd/mcpproxy/edition.go` | Default edition = "personal" |
4747
| `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) |
48+
| `cmd/mcpproxy/serveredition_register.go` | Server feature registration entry point |
49+
| `internal/serveredition/` | Server-only code (all files have `//go:build server`) |
50+
| `internal/serveredition/auth/` | OAuth, sessions, JWT tokens, middleware |
51+
| `internal/serveredition/users/` | User/session models, BBolt store |
52+
| `internal/serveredition/workspace/` | Per-user workspace for personal upstreams |
53+
| `internal/serveredition/multiuser/` | Multi-user router, tool filtering, activity isolation |
54+
| `internal/serveredition/api/` | Server REST API endpoints (user, admin, auth) |
5555
| `native/macos/MCPProxy/` | Swift macOS tray app (SwiftUI, macOS 13+) |
5656
| `native/macos/MCPProxyUITest/` | Swift MCP server for UI testing (accessibility + screenshots) |
5757
| `native/windows/` | Future C# tray app (placeholder) |
@@ -70,7 +70,7 @@ Server edition supports OAuth-based multi-user authentication with Google, GitHu
7070

7171
```json
7272
{
73-
"teams": {
73+
"server_edition": {
7474
"enabled": true,
7575
"admin_emails": ["admin@company.com"],
7676
"oauth": {
@@ -117,7 +117,7 @@ Server edition supports OAuth-based multi-user authentication with Google, GitHu
117117
### Server Testing
118118

119119
```bash
120-
go test -tags server ./internal/teams/... -v -race # All server unit + integration tests
120+
go test -tags server ./internal/serveredition/... -v -race # All server unit + integration tests
121121
go build -tags server ./cmd/mcpproxy # Build server edition
122122
go build ./cmd/mcpproxy # Verify personal edition unaffected
123123
```

cmd/mcpproxy/edition.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package main
22

33
// Edition identifies which MCPProxy edition this binary is.
4-
// This is the default value; teams edition overrides it via build tags.
4+
// This is the default value; server edition overrides it via build tags.
55
var Edition = "personal"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//go:build server
2+
3+
package main
4+
5+
// Server edition features are registered via init() functions in their
6+
// respective packages. The actual setup happens when the server calls
7+
// serveredition.SetupAll() during HTTP server initialization (see internal/server/serveredition_wire.go).
8+
//
9+
// This file imports the serveredition package for its init() side effects,
10+
// which register feature modules in the server registry.
11+
import _ "github.com/smart-mcp-proxy/mcpproxy-go/internal/serveredition"

cmd/mcpproxy/status_cmd.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@ import (
2121

2222
// StatusInfo holds the collected status data for display.
2323
type StatusInfo struct {
24-
State string `json:"state"`
25-
Edition string `json:"edition"`
26-
ListenAddr string `json:"listen_addr"`
27-
Uptime string `json:"uptime,omitempty"`
28-
UptimeSeconds float64 `json:"uptime_seconds,omitempty"`
29-
APIKey string `json:"api_key"`
30-
WebUIURL string `json:"web_ui_url"`
31-
RoutingMode string `json:"routing_mode"`
32-
Endpoints map[string]string `json:"endpoints"`
33-
Servers *ServerCounts `json:"servers,omitempty"`
34-
SocketPath string `json:"socket_path,omitempty"`
35-
ConfigPath string `json:"config_path,omitempty"`
36-
Version string `json:"version,omitempty"`
37-
TeamsInfo *TeamsStatusInfo `json:"teams,omitempty"`
24+
State string `json:"state"`
25+
Edition string `json:"edition"`
26+
ListenAddr string `json:"listen_addr"`
27+
Uptime string `json:"uptime,omitempty"`
28+
UptimeSeconds float64 `json:"uptime_seconds,omitempty"`
29+
APIKey string `json:"api_key"`
30+
WebUIURL string `json:"web_ui_url"`
31+
RoutingMode string `json:"routing_mode"`
32+
Endpoints map[string]string `json:"endpoints"`
33+
Servers *ServerCounts `json:"servers,omitempty"`
34+
SocketPath string `json:"socket_path,omitempty"`
35+
ConfigPath string `json:"config_path,omitempty"`
36+
Version string `json:"version,omitempty"`
37+
ServerEditionInfo *ServerEditionStatusInfo `json:"server_edition,omitempty"`
3838
}
3939

40-
// TeamsStatusInfo holds teams-specific status information.
41-
type TeamsStatusInfo struct {
40+
// ServerEditionStatusInfo holds server-edition-specific status information.
41+
type ServerEditionStatusInfo struct {
4242
OAuthProvider string `json:"oauth_provider"`
4343
AdminEmails []string `json:"admin_emails"`
4444
}
@@ -173,8 +173,8 @@ func collectStatusFromDaemon(cfg *config.Config, socketPath, configPath string)
173173
info.RoutingMode = config.RoutingModeRetrieveTools
174174
}
175175

176-
// Add teams info if available
177-
info.TeamsInfo = collectTeamsInfo(cfg)
176+
// Add server edition info if available
177+
info.ServerEditionInfo = collectServerEditionInfo(cfg)
178178

179179
// Get status data (running, listen_addr, upstream_stats)
180180
statusData, err := client.GetStatus(ctx)
@@ -247,7 +247,7 @@ func collectStatusFromConfig(cfg *config.Config, socketPath, configPath string)
247247
ConfigPath: configPath,
248248
}
249249

250-
info.TeamsInfo = collectTeamsInfo(cfg)
250+
info.ServerEditionInfo = collectServerEditionInfo(cfg)
251251

252252
return info
253253
}
@@ -416,11 +416,11 @@ func printStatusTable(info *StatusInfo) {
416416
}
417417
}
418418

419-
if info.TeamsInfo != nil {
419+
if info.ServerEditionInfo != nil {
420420
fmt.Println()
421421
fmt.Println("Server Edition")
422-
fmt.Printf(" %-12s %s\n", "OAuth:", info.TeamsInfo.OAuthProvider)
423-
fmt.Printf(" %-12s %s\n", "Admins:", strings.Join(info.TeamsInfo.AdminEmails, ", "))
422+
fmt.Printf(" %-12s %s\n", "OAuth:", info.ServerEditionInfo.OAuthProvider)
423+
fmt.Printf(" %-12s %s\n", "Admins:", strings.Join(info.ServerEditionInfo.AdminEmails, ", "))
424424
}
425425
}
426426

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//go:build server
2+
3+
package main
4+
5+
import "github.com/smart-mcp-proxy/mcpproxy-go/internal/config"
6+
7+
func collectServerEditionInfo(cfg *config.Config) *ServerEditionStatusInfo {
8+
if cfg.ServerEdition == nil || !cfg.ServerEdition.Enabled {
9+
return nil
10+
}
11+
info := &ServerEditionStatusInfo{
12+
AdminEmails: cfg.ServerEdition.AdminEmails,
13+
}
14+
if cfg.ServerEdition.OAuth != nil {
15+
info.OAuthProvider = cfg.ServerEdition.OAuth.Provider
16+
}
17+
return info
18+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ package main
44

55
import "github.com/smart-mcp-proxy/mcpproxy-go/internal/config"
66

7-
func collectTeamsInfo(_ *config.Config) *TeamsStatusInfo {
7+
func collectServerEditionInfo(_ *config.Config) *ServerEditionStatusInfo {
88
return nil
99
}

cmd/mcpproxy/status_teams.go

Lines changed: 0 additions & 18 deletions
This file was deleted.

cmd/mcpproxy/teams_register.go

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/features/settings-page.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ friendly, prioritized form sections instead of raw JSON:
1212
isolation, sensitive-data detection, output validation, output sanitisation,
1313
activity retention, logging, TLS, …).
1414
- **Raw JSON** — the full Monaco editor, kept as an escape hatch.
15-
- **Teams** — server edition only.
15+
- **Server edition** — server build only.
1616

1717
## How saving works
1818

internal/auth/agent_token.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type AgentToken struct {
4242
CreatedAt time.Time `json:"created_at"`
4343
LastUsedAt *time.Time `json:"last_used_at,omitempty"`
4444
Revoked bool `json:"revoked"`
45-
UserID string `json:"user_id,omitempty"` // Owner user ID (teams edition)
45+
UserID string `json:"user_id,omitempty"` // Owner user ID (server edition)
4646
}
4747

4848
// IsExpired returns true if the token has passed its expiry time.

0 commit comments

Comments
 (0)