Skip to content

Commit 058a530

Browse files
Robert0622roberttwangclaude
authored
fix(authz): align Runner, account, and MCP access checks (#1328)
* fix(authz): enforce runner, account, and MCP ownership boundaries * fix(authz): keep market MCPs and predictable install IDs working Cloning a shared role from a project the caller cannot write dropped its market MCPs. Market entries carry no project settings, so install them from the catalog in the target project instead. Install IDs for market, custom and cloned MCPs are predictable. Any signed-in user could create a personal MCP under such an ID and make every later install or clone into that project fail with 409. When the ID is held outside the destination, use an alternate ID keyed with the session secret, so retries still find the same row. Treat SSO as configured only when both the app token and login URL are set, the same condition the login page uses, so an install with only the app token keeps its browser setup step. Explain why a login listed in AGENTFLOW_PLATFORM_ADMINS cannot self-register, and document it. Co-Authored-By: Claude Code <noreply@anthropic.com> * test(authz): cover import rollback and unshared role clones over HTTP Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(mcp): keep alternate install IDs stable when the first one is taken When the predictable install ID and its keyed alternate were both held by another user, every clone or custom install fell back to a random ID. A project then got a new copy of the cloned MCP on each clone, and a repeated custom install created a row instead of returning 409. Try a fixed sequence of keyed alternates, and prefer a row the destination already holds under any candidate over a free one. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: roberttwang <u_dc6754cd1ee5@users.noreply.local> Co-authored-by: Claude Code <noreply@anthropic.com>
1 parent 2e6ce79 commit 058a530

20 files changed

Lines changed: 888 additions & 176 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Platform releases use `vX.Y.Z` tags and publish `ghcr.io/tencent/loopforge`. Loo
66

77
### Platform
88

9+
- Authorization boundaries for Runners, accounts and MCP servers are stricter. Runner re-registration renews a machine only for its current owner; a platform bootstrap token registers a new machine instead of adopting a user's. Browser setup and self-registration are limited to password installations, and login names listed in `AGENTFLOW_PLATFORM_ADMINS` must be created with the operator account command. Personal MCP writes are bound to the signed-in user. An MCP import is saved as a whole or not at all, so a payload with a forbidden entry or a repeated ID now fails, and a platform administrator can no longer import other users' personal MCPs. Cloning a role copies MCP servers only from projects the caller can write; market MCPs are installed from the catalog instead.
910
- **Upgrade action for personal execution machines.** Existing project conversations bound to a personal machine require a project grant before the next message can run. The machine owner can grant access in **Settings → Execution machines → Shared projects**, then resume the conversation on the same machine. [Upgrade instructions](docs/deployment.md#upgrading-existing-project-conversations)
1011
- **Breaking:** the `local` sandbox type is removed and native sandboxes only carry environment variables. A native sandbox runs on whichever machine executes the work (a user's execution machine, a cloud runner or the platform host) with that machine's own toolchains; environment install scripts, `$PREFIX` and install PATH entries are gone, and settings such as `JAVA_HOME` go into the sandbox's environment variables. SOPs and conversation workspaces can use Docker or native sandboxes; the default sandbox is `generic-docker`, and `AGENTFLOW_LOCAL_SANDBOX` is removed. A local row that was not migrated reads as native; a run frozen with a local sandbox asks to be started again with a native one.
1112
- Native SOP checkouts use a private repository cache on each execution machine. The platform or Runner refreshes the bare repository with the checkout's Git credentials and copies Git objects into the worktree. This reuses the network fetch and leaves each worktree and checkpoint independent. Docker sandboxes keep direct clones. Conversation workspaces start empty and the agent clones using the current speaker's credentials. Runner 0.12.0 supports cached SOP checkouts.

‎docs/deployment.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ MIRROR=ghcr.nju.edu.cn ./start.sh pull
8686

8787
Pushing a `vX.Y.Z` tag on `main` runs the `release` workflow once the `platform` workflow has passed on that commit. The tagged `compose.yaml` must already pin `loopforge:X.Y.Z`. It publishes `ghcr.io/<owner>/loopforge` as `X.Y.Z`, `X.Y`, `latest` and `sha-<commit>`, smoke-tests the pushed digest with `./start.sh`, and creates the GitHub Release. Forks publish under their own owner; set the GHCR package visibility/access for your team before distributing the image. Images are pulled only when missing by default; use an immutable tag/digest, or set `LOOPFORGE_PULL_POLICY=always` when updating a mutable tag. Existing `.env` values take precedence; change the saved image or URL there when updating an installation. Compose waits for the API's health check with a bounded timeout before installing schema extensions and seeds.
8888

89-
Open the platform and create the first account in the browser; it receives platform administration. Until that account exists the login page only offers this setup step.
89+
On a password-only installation, open the platform and create the first account in the browser. If no administrator is configured, the login page offers this setup step and grants the account platform administration.
9090

9191
During initial setup, restrict the cloud security group or firewall to the operator's IP. Do not expose the first-account setup page to arbitrary Internet clients before the administrator account has been created.
9292

@@ -97,6 +97,8 @@ Enterprise authentication gateways can sign users in by header with `AGENTFLOW_T
9797
- Set `AGENTFLOW_IDENTITY_HEADER_SECRET` to a random value, and have the gateway send it in `X-AgentFlow-Gateway-Secret`. The gateway must overwrite, never pass through, the client's `Staffname`, `Staffid`, `x-staff-name` and `X-AgentFlow-Gateway-Secret` headers.
9898
- Without a secret, any request carrying `X-Forwarded-For`, `Forwarded` or `X-Real-IP` is treated as a forwarded client, and its identity headers are ignored. This only protects proxies that add one of those headers: a same-host proxy that passes client headers through without adding them (for example nginx `proxy_pass` without `proxy_set_header X-Forwarded-For`), and any other process on the host, can still sign in as any user. Set the secret whenever header sign-in is on; the platform logs a warning at startup when it is missing.
9999

100+
Browser self-registration is available on password-only installations. SSO counts as configured only when both `AGENTFLOW_SSO_APP_TOKEN` and `AGENTFLOW_SSO_LOGIN_URL` are set. For gateway or SSO sign-in, provision administrators by setting `AGENTFLOW_PLATFORM_ADMINS` to their authenticated login names or by using the operator account command below. On a password installation that sets `AGENTFLOW_PLATFORM_ADMINS`, the browser offers no first-account setup and the listed login names cannot self-register; create those accounts with the operator account command.
101+
100102
### Project credentials
101103

102104
The installer and `./start.sh pull` configure `AGENTFLOW_PROJECT_CREDENTIAL_KEY` in `.env` when the setting is missing or blank. They preserve an existing nonempty setting. For a custom deployment, set it in the platform environment to a Base64-encoded 32-byte random key, which you can generate with `openssl rand -base64 32`. Share the same key across instances and keep it with database backups. After replacing the key, enter every value again on each existing credential to keep its bindings. Leaving values blank requires the previous ciphertext to be readable with the configured key.
@@ -217,7 +219,7 @@ The retention cleanup runs hourly in each process that runs the Bot workers and
217219

218220
## Accounts
219221

220-
The first account created in the browser becomes the platform administrator. After that, anyone who can reach the login page may sign up as a regular user while `AGENTFLOW_ALLOW_SIGNUP` is `true` (the default). Registered users can create requirements and run SOPs on your workers, so set `AGENTFLOW_ALLOW_SIGNUP=false` for any installation reachable from untrusted networks and create accounts explicitly instead.
222+
On a password-only installation, the first browser account becomes the platform administrator when there is no existing password account or configured administrator. Regular users can sign up while `AGENTFLOW_ALLOW_SIGNUP` is `true` (the default). Registered users can create requirements and run SOPs on your workers, so set `AGENTFLOW_ALLOW_SIGNUP=false` for any installation reachable from untrusted networks and provision accounts explicitly.
221223

222224
Platform administrators create accounts under **Platform administration → Member accounts** (平台管理 → 成员账号): enter a login name and an initial password, optionally grant administration, and hand the password to the teammate. The same page lists every account and resets the password of a password account; accounts that sign in through GitHub or a gateway cannot be given a password there. New accounts join the welcome project, like self sign-ups.
223225

‎internal/httpapi/auth_register.go‎

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,31 @@ func signupEnabled() bool {
3131
return true
3232
}
3333

34+
// Local browser enrollment belongs to password installations. An external
35+
// identity deployment may never create a password account through this path.
36+
// SSO counts only when both the app token and login URL are set, the same
37+
// condition under which auth.Client.LoginURL leaves the password login page.
38+
func (h *authHandlers) localSignupOptions() (needsSetup, allowed bool, err error) {
39+
cfg := h.getAuthClient().Config()
40+
sso := strings.TrimSpace(cfg.AppToken) != "" && strings.TrimSpace(cfg.LoginURL) != ""
41+
if trustGatewayIdentityHeaders() || sso {
42+
return false, false, nil
43+
}
44+
count, err := h.repo.LocalAccountCount()
45+
if err != nil {
46+
return false, false, err
47+
}
48+
needsSetup = count == 0 && len(repo.EnvPlatformAdmins()) == 0 && len(repo.BuiltinPlatformAdmins) == 0
49+
return needsSetup, needsSetup || signupEnabled(), nil
50+
}
51+
3452
func (h *authHandlers) authSetup(c *gin.Context) {
35-
needsSetup := h.repo != nil && h.repo.LocalAccountCount() == 0
36-
c.JSON(http.StatusOK, gin.H{"needsSetup": needsSetup, "signupEnabled": needsSetup || signupEnabled()})
53+
needsSetup, allowed, err := h.localSignupOptions()
54+
if err != nil {
55+
c.JSON(http.StatusServiceUnavailable, gin.H{"error": "无法读取注册状态"})
56+
return
57+
}
58+
c.JSON(http.StatusOK, gin.H{"needsSetup": needsSetup, "signupEnabled": allowed})
3759
}
3860

3961
const welcomeProjectID = "welcome"
@@ -89,12 +111,22 @@ func (h *authHandlers) authRegister(c *gin.Context) {
89111
return
90112
}
91113
registerMu.Lock()
92-
first := h.repo.LocalAccountCount() == 0
93-
if !first && !signupEnabled() {
114+
first, allowed, err := h.localSignupOptions()
115+
if err != nil {
116+
registerMu.Unlock()
117+
c.JSON(http.StatusServiceUnavailable, gin.H{"error": "无法读取注册状态"})
118+
return
119+
}
120+
if !allowed {
94121
registerMu.Unlock()
95122
c.JSON(http.StatusForbidden, gin.H{"error": "自助注册已关闭,请联系管理员创建账号"})
96123
return
97124
}
125+
if repo.IsAllowlistedPlatformAdmin(input.Login) {
126+
registerMu.Unlock()
127+
c.JSON(http.StatusForbidden, gin.H{"error": "该用户名是已配置的平台管理员,请由运维用账号命令创建,不能在浏览器中注册"})
128+
return
129+
}
98130
u, err := h.repo.CreateLocalAccount(input.Login, input.Password, first)
99131
if err == nil && !first {
100132
h.joinWelcomeProject(u.ID)

‎internal/httpapi/auth_register_test.go‎

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,102 @@ import (
1212
"testing"
1313
)
1414

15+
func TestLocalSignupOptionsForExternalIdentity(t *testing.T) {
16+
for _, mode := range []struct {
17+
name string
18+
env map[string]string
19+
}{
20+
{name: "gateway", env: map[string]string{"AGENTFLOW_TRUST_IDENTITY_HEADERS": "true"}},
21+
{name: "SSO", env: map[string]string{"AGENTFLOW_SSO_APP_TOKEN": "app-token", "AGENTFLOW_SSO_LOGIN_URL": "https://sso.example.test/login"}},
22+
} {
23+
t.Run(mode.name, func(t *testing.T) {
24+
t.Setenv("AGENTFLOW_TRUST_IDENTITY_HEADERS", "false")
25+
t.Setenv("AGENTFLOW_SSO_APP_TOKEN", "")
26+
t.Setenv("AGENTFLOW_SSO_LOGIN_URL", "")
27+
for key, value := range mode.env {
28+
t.Setenv(key, value)
29+
}
30+
t.Setenv("AGENTFLOW_ALLOW_SIGNUP", "true")
31+
h := &authHandlers{deps: &deps{}}
32+
needsSetup, signup, err := h.localSignupOptions()
33+
if err != nil || needsSetup || signup {
34+
t.Fatalf("setup=%v signup=%v err=%v", needsSetup, signup, err)
35+
}
36+
})
37+
}
38+
}
39+
40+
// Only the app token and the login URL together switch the login page to
41+
// SSO. Either one alone still serves password sign-in, so a fresh install
42+
// must keep its browser setup step.
43+
func TestLocalSignupOptionsPartialSSOKeepsPasswordSetup(t *testing.T) {
44+
for _, key := range []string{"AGENTFLOW_SSO_APP_TOKEN", "AGENTFLOW_SSO_LOGIN_URL"} {
45+
t.Run(key, func(t *testing.T) {
46+
t.Setenv("AGENTFLOW_TRUST_IDENTITY_HEADERS", "false")
47+
t.Setenv("AGENTFLOW_SSO_APP_TOKEN", "")
48+
t.Setenv("AGENTFLOW_SSO_LOGIN_URL", "")
49+
t.Setenv("AGENTFLOW_PLATFORM_ADMINS", "")
50+
t.Setenv("AGENTFLOW_ALLOW_SIGNUP", "false")
51+
t.Setenv(key, "configured")
52+
s, err := repo.OpenTest()
53+
if err != nil {
54+
t.Fatal(err)
55+
}
56+
t.Cleanup(s.Close)
57+
h := &authHandlers{deps: &deps{repo: s}}
58+
needsSetup, signup, err := h.localSignupOptions()
59+
if err != nil || !needsSetup || !signup {
60+
t.Fatalf("setup=%v signup=%v err=%v", needsSetup, signup, err)
61+
}
62+
})
63+
}
64+
}
65+
66+
func TestRegisterRejectsConfiguredPlatformAdmin(t *testing.T) {
67+
t.Setenv("AGENTFLOW_AUTH_REQUIRED", "true")
68+
t.Setenv("AGENTFLOW_SCHEDULER_ENABLED", "false")
69+
t.Setenv("AGENTFLOW_TRUST_IDENTITY_HEADERS", "false")
70+
t.Setenv("AGENTFLOW_SSO_APP_TOKEN", "")
71+
t.Setenv("AGENTFLOW_SSO_LOGIN_URL", "")
72+
t.Setenv("AGENTFLOW_PLATFORM_ADMINS", "alice")
73+
t.Setenv("AGENTFLOW_ALLOW_SIGNUP", "true")
74+
s, err := repo.OpenTest()
75+
if err != nil {
76+
t.Fatal(err)
77+
}
78+
t.Cleanup(s.Close)
79+
h := New(s, engine.New(s, runtime.NewManager(t.TempDir())), nil, "", "")
80+
call := func(method, path, body string) *httptest.ResponseRecorder {
81+
r := httptest.NewRequest(method, "http://localhost"+path, bytes.NewBufferString(body))
82+
r.Header.Set("Content-Type", "application/json")
83+
r.Header.Set("Origin", "http://localhost")
84+
w := httptest.NewRecorder()
85+
h.ServeHTTP(w, r)
86+
return w
87+
}
88+
w := call("GET", "/api/auth/setup", "")
89+
var setup struct{ NeedsSetup, SignupEnabled bool }
90+
if w.Code != 200 || json.Unmarshal(w.Body.Bytes(), &setup) != nil || setup.NeedsSetup || !setup.SignupEnabled {
91+
t.Fatalf("setup with a configured admin: %d %s", w.Code, w.Body.String())
92+
}
93+
w = call("POST", "/api/auth/register", `{"login":"alice","password":"a-long-enough-password"}`)
94+
if w.Code != 403 || !strings.Contains(w.Body.String(), "账号命令") {
95+
t.Fatalf("configured admin register: %d %s", w.Code, w.Body.String())
96+
}
97+
w = call("POST", "/api/auth/register", `{"login":"bob","password":"a-long-enough-password"}`)
98+
if w.Code != 200 || s.IsPlatformAdmin("bob") {
99+
t.Fatalf("regular signup while an admin is configured: %d admin=%v %s", w.Code, s.IsPlatformAdmin("bob"), w.Body.String())
100+
}
101+
}
102+
15103
func TestRegisterFirstAccountBecomesAdminAndSignupToggle(t *testing.T) {
16104
t.Setenv("AGENTFLOW_AUTH_REQUIRED", "true")
17105
t.Setenv("AGENTFLOW_SCHEDULER_ENABLED", "false")
106+
t.Setenv("AGENTFLOW_TRUST_IDENTITY_HEADERS", "false")
107+
t.Setenv("AGENTFLOW_SSO_APP_TOKEN", "")
108+
t.Setenv("AGENTFLOW_SSO_LOGIN_URL", "")
109+
t.Setenv("AGENTFLOW_PLATFORM_ADMINS", "")
110+
t.Setenv("AGENTFLOW_ALLOW_SIGNUP", "true")
18111
s, err := repo.OpenTest()
19112
if err != nil {
20113
t.Fatal(err)

‎internal/httpapi/catalog.go‎

Lines changed: 74 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"fmt"
77
"net/http"
88
"slices"
9-
"strconv"
109
"strings"
1110
"time"
1211

@@ -488,36 +487,50 @@ func (h *catalogHandlers) agent(c *gin.Context) {
488487
c.JSON(400, map[string]string{"error": "id and name are required"})
489488
return
490489
}
491-
v, _ := h.repo.Agent(id)
492-
if _, ok := h.repo.Project(strings.TrimSpace(req.ProjectID)); !ok {
490+
v := current
491+
targetProject := strings.TrimSpace(req.ProjectID)
492+
if _, ok := h.repo.Project(targetProject); !ok {
493493
c.JSON(http.StatusNotFound, map[string]string{"error": "project not found"})
494494
return
495495
}
496496
taken, _ := h.repo.Agent(req.ID)
497-
if !h.requireProjectWriter(c, strings.TrimSpace(req.ProjectID), taken.ProjectID) {
497+
if !h.requireProjectWriter(c, targetProject, taken.ProjectID) {
498498
return
499499
}
500-
if v.Shared {
500+
userID := int64(0)
501+
if user, ok := h.requestUser(c.Request, true); ok {
502+
userID = user.ID
503+
}
504+
sourceWritable := h.projectWriterAllowed(c, v.ProjectID, userID)
505+
if !v.Shared && !sourceWritable {
506+
project, ok := h.repo.Project(v.ProjectID)
507+
if !ok || userID <= 0 || !slices.ContainsFunc(project.Members, func(member domain.ProjectMember) bool {
508+
return member.UserID == userID
509+
}) {
510+
c.JSON(http.StatusForbidden, gin.H{"error": "无权复制源项目中未共享的角色"})
511+
return
512+
}
513+
}
514+
if v.Shared && sourceWritable {
501515
if err := h.shareAgentAssets(v); err != nil {
502516
respond(c, err)
503517
return
504518
}
505519
}
506-
userID := int64(0)
507-
if current, ok := h.requestUser(c.Request, true); ok {
508-
userID = current.ID
509-
}
510-
mcpServers, err := h.cloneAgentMCPServers(v.MCPServers, strings.TrimSpace(req.ProjectID), userID)
520+
mcpServers, err := h.cloneAgentMCPServers(v.MCPServers, targetProject, userID, func(projectID string) bool {
521+
_, exists := h.repo.Project(projectID)
522+
return exists && h.projectWriterAllowed(c, projectID, userID)
523+
})
511524
if err != nil {
512525
if errors.Is(err, errPersonalMCPCloneRequiresLogin) {
513-
c.JSON(http.StatusUnauthorized, map[string]string{"error": err.Error()})
526+
c.JSON(http.StatusUnauthorized, gin.H{"error": err.Error()})
514527
} else {
515-
respond(c, err)
528+
respondMCPWriteError(c, err)
516529
}
517530
return
518531
}
519532
v.ID, v.Name = req.ID, req.Name
520-
v.ProjectID = strings.TrimSpace(req.ProjectID)
533+
v.ProjectID = targetProject
521534
v.MCPServers = mcpServers
522535
v.Shared = false
523536
v.Version = 1
@@ -533,54 +546,75 @@ func (h *catalogHandlers) agent(c *gin.Context) {
533546
}
534547
}
535548

536-
var errPersonalMCPCloneRequiresLogin = errors.New("复制包含个人 MCP 的角色前请先登录")
537-
538549
func (h *catalogHandlers) shareAgentAssets(agent domain.AgentDefinition) error {
539550
return h.repo.ShareAgentAssets(agent)
540551
}
541552

542-
func (h *catalogHandlers) cloneAgentMCPServers(ids []string, projectID string, userID int64) ([]string, error) {
553+
var errPersonalMCPCloneRequiresLogin = errors.New("复制包含个人 MCP 的角色前请先登录")
554+
555+
func (h *catalogHandlers) cloneAgentMCPServers(ids []string, projectID string, userID int64, canCopyProject func(string) bool) ([]string, error) {
543556
out := make([]string, 0, len(ids))
557+
var changes []repo.MCPServerChange
544558
for _, id := range ids {
545559
source, ok := h.repo.MCPServer(id)
546-
if !ok || source.Scope == "" {
560+
if !ok {
547561
continue
548562
}
549-
ownerKey := projectID
550-
if source.Scope == "project" {
551-
if source.ProjectID == projectID {
552-
out = append(out, source.ID)
553-
continue
554-
}
555-
for _, existing := range h.repo.MCPServers() {
556-
if source.MarketID != "" && existing.Scope == "project" && existing.ProjectID == projectID && existing.MarketID == source.MarketID {
557-
out = append(out, existing.ID)
558-
goto nextMCP
559-
}
560-
}
561-
source.ProjectID, source.OwnerUserID = projectID, 0
562-
} else if source.Scope == "personal" {
563+
switch source.Scope {
564+
case "personal":
563565
if userID <= 0 {
564566
return nil, errPersonalMCPCloneRequiresLogin
565567
}
566568
if source.OwnerUserID == userID {
567569
out = append(out, source.ID)
570+
}
571+
continue
572+
case "project":
573+
if source.ProjectID == projectID {
574+
out = append(out, source.ID)
568575
continue
569576
}
570-
ownerKey = strconv.FormatInt(userID, 10)
571-
source.ProjectID, source.OwnerUserID, source.MarketID = "", userID, ""
572-
} else {
577+
default:
573578
continue
574579
}
575-
source.ID = mcpInstallID("clone-"+id, source.Scope, ownerKey)
576-
source.UpdatedAt = time.Time{}
577-
if _, exists := h.repo.MCPServer(source.ID); !exists {
578-
if err := h.repo.PutMCPServer(source); err != nil {
579-
return nil, fmt.Errorf("clone MCP %q: %w", id, err)
580+
if source.MarketID != "" {
581+
servers := h.repo.MCPServers()
582+
index := slices.IndexFunc(servers, func(existing domain.MCPServerDefinition) bool {
583+
return existing.Scope == "project" && existing.ProjectID == projectID && existing.MarketID == source.MarketID
584+
})
585+
if index >= 0 {
586+
out = append(out, servers[index].ID)
587+
continue
588+
}
589+
}
590+
if !canCopyProject(source.ProjectID) {
591+
// A market entry carries no project settings. Install it from
592+
// the catalog when the source project's copy is not readable.
593+
if source.MarketID != "" {
594+
if installed, _, err := installMarketMCP(h.repo, source.MarketID, projectID); err == nil {
595+
if !slices.Contains(out, installed.ID) {
596+
out = append(out, installed.ID)
597+
}
598+
} else if !errors.Is(err, errMCPMarketItemMissing) {
599+
return nil, err
600+
}
580601
}
602+
continue
603+
}
604+
source.ID = destinationMCPInstallID(h.repo, h.mcpInstallIDKey(), "clone-"+source.ID, "project", projectID)
605+
if slices.Contains(out, source.ID) {
606+
continue
607+
}
608+
if _, exists := h.repo.MCPServer(source.ID); !exists {
609+
source.ProjectID, source.OwnerUserID = projectID, 0
610+
changes = append(changes, repo.MCPServerChange{Definition: source})
581611
}
582612
out = append(out, source.ID)
583-
nextMCP:
613+
}
614+
if len(changes) > 0 {
615+
if _, err := h.repo.SaveMCPServers(changes...); err != nil {
616+
return nil, err
617+
}
584618
}
585619
return out, nil
586620
}

0 commit comments

Comments
 (0)