diff --git a/README.md b/README.md index c162ba4b1..13ee3d0ab 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,14 @@ mcpproxy review show context7 # 3. approve (with no --tools/--all, only read-only tools with a clean scan are allowed) mcpproxy review approve context7 --yes -# 4. one harmless read, then see it in the activity log +# 4. check that context7 is Online and has discovered tools before calling it +mcpproxy upstream list +``` + +If Context7 shows `Connecting` or lists zero tools, run `mcpproxy upstream list` again. Once it shows `Online` with discovered tools, make the first call. + +```bash +# 5. one harmless read, then see it in the activity log mcpproxy call tool-read -t context7:resolve-library-id -j '{"libraryName":"vue-router","query":"routing"}' mcpproxy activity list --limit 3 ``` diff --git a/docs/getting-started/quick-start.mdx b/docs/getting-started/quick-start.mdx index 105a3c277..98cc110f5 100644 --- a/docs/getting-started/quick-start.mdx +++ b/docs/getting-started/quick-start.mdx @@ -361,8 +361,10 @@ Approved server context7: 2 tools approved, 0 blocked, 0 still pending, 0 change `mcpproxy security approve context7` is an alias. -The header flips to `Connected (2 tools)`, **Admin state** to **Enabled**, and -the tab to `Tools (2)`. The Review tab confirms *"context7 is approved"*. +The Review tab confirms *"context7 is approved"*. The upstream can take a moment +to connect after approval or a daemon restart. Before making the first tool call, +run the command below. If Context7 shows `Connecting` or lists zero tools, run it again. +Continue once its status is `Online` and the tool count is greater than zero. ```bash mcpproxy upstream list diff --git a/internal/upstream/core/oauth_login_pair_race_test.go b/internal/upstream/core/oauth_login_pair_race_test.go index d6f2fa87e..d46c156f1 100644 --- a/internal/upstream/core/oauth_login_pair_race_test.go +++ b/internal/upstream/core/oauth_login_pair_race_test.go @@ -3,6 +3,7 @@ package core import ( "context" "encoding/json" + "fmt" "go/ast" "go/parser" "go/token" @@ -98,8 +99,18 @@ func TestLoginCompletion_TokenAndClientStoredAsOnePair(t *testing.T) { // completion time may hold a replacement listener on another port. replacement, err := oauth.GetGlobalCallbackManager().StartCallbackServer(f.name, 0) require.NoError(t, err) - cbA := &oauth.CallbackServer{Port: 41001, RedirectURI: "http://127.0.0.1:41001" + oauth.DefaultRedirectPath} - cbB := &oauth.CallbackServer{Port: 41002, RedirectURI: "http://127.0.0.1:41002" + oauth.DefaultRedirectPath} + // The OS can assign either synthetic port to the replacement listener. + portA, portB := 41001, 41002 + if replacement.Port == portA || replacement.Port == portB { + portA, portB = 41003, 41004 + } + newCallback := func(port int) *oauth.CallbackServer { + return &oauth.CallbackServer{ + Port: port, + RedirectURI: fmt.Sprintf("http://127.0.0.1:%d%s", port, oauth.DefaultRedirectPath), + } + } + cbA, cbB := newCallback(portA), newCallback(portB) ctx := context.Background() doneA := make(chan error, 1)