Skip to content

Commit edc91f5

Browse files
committed
fmt
1 parent b02859a commit edc91f5

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

client/transport/oauth.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ func (h *OAuthHandler) getServerMetadata(ctx context.Context) (*AuthServerMetada
427427
// Use the first authorization server
428428
authServerURL := protectedResource.AuthorizationServers[0]
429429

430-
431430
// Try OAuth Authorization Server Metadata first
432431
h.fetchMetadataFromURL(ctx, authServerURL+"/.well-known/oauth-authorization-server")
433432
if h.serverMetadata != nil {

examples/elicitation/main.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -248,20 +248,20 @@ func main() {
248248
if session == nil {
249249
return nil, fmt.Errorf("no active session")
250250
}
251-
251+
252252
// Generate unique elicitation ID
253253
elicitationID := uuid.New().String()
254-
254+
255255
// Create URL with elicitation ID for tracking
256256
// In a real application, you would store the ID and associate it with the user session
257257
url := fmt.Sprintf("https://myserver.com/set-api-key?elicitationId=%s", elicitationID)
258258

259259
// Request URL mode elicitation
260260
result, err := mcpServer.RequestURLElicitation(
261-
ctx,
262-
session,
263-
elicitationID,
264-
url,
261+
ctx,
262+
session,
263+
elicitationID,
264+
url,
265265
"Please authenticate in your browser to continue.",
266266
)
267267
if err != nil {
@@ -281,14 +281,14 @@ func main() {
281281
// Log error but continue
282282
fmt.Fprintf(os.Stderr, "Failed to send completion notification: %v\n", err)
283283
}
284-
284+
285285
return &mcp.CallToolResult{
286286
Content: []mcp.Content{
287287
mcp.NewTextContent("Authentication flow initiated. User accepted URL open request."),
288288
},
289289
}, nil
290290
}
291-
291+
292292
return &mcp.CallToolResult{
293293
Content: []mcp.Content{
294294
mcp.NewTextContent(fmt.Sprintf("User declined authentication: %s", result.Action)),
@@ -311,7 +311,7 @@ func main() {
311311
if !isAuthorized {
312312
// When a request needs authorization that hasn't been set up
313313
elicitationID := uuid.New().String()
314-
314+
315315
// Return a special error that tells the client to start elicitation
316316
return nil, mcp.URLElicitationRequiredError{
317317
Elicitations: []mcp.ElicitationParams{

mcp/elicitation_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ func TestElicitationParamsSerialization(t *testing.T) {
5757
var decoded ElicitationParams
5858
err = json.Unmarshal(data, &decoded)
5959
require.NoError(t, err)
60-
60+
6161
assert.Equal(t, tt.params.Message, decoded.Message)
6262
assert.Equal(t, tt.params.Mode, decoded.Mode)
63-
63+
6464
if tt.params.Mode == ElicitationModeURL {
6565
assert.Equal(t, tt.params.ElicitationID, decoded.ElicitationID)
6666
assert.Equal(t, tt.params.URL, decoded.URL)

mcp/errors.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ var (
2828

2929
// ErrResourceNotFound indicates a requested resource was not found (code: RESOURCE_NOT_FOUND).
3030
ErrResourceNotFound = errors.New("resource not found")
31-
3231
)
3332

3433
// URLElicitationRequiredError is returned when the server requires URL elicitation to proceed.

mcp/errors_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ func TestURLElicitationRequiredError(t *testing.T) {
191191
jsonRPCError := err.JSONRPCError()
192192
require.Equal(t, URL_ELICITATION_REQUIRED, jsonRPCError.Error.Code)
193193
require.Equal(t, expectedMsg, jsonRPCError.Error.Message)
194-
194+
195195
dataMap, ok := jsonRPCError.Error.Data.(map[string]any)
196196
require.True(t, ok, "Expected Data to be map[string]any")
197-
197+
198198
elicitations, ok := dataMap["elicitations"].([]ElicitationParams)
199199
require.True(t, ok, "Expected elicitations in Data")
200-
200+
201201
require.Equal(t, 1, len(elicitations))
202202
require.Equal(t, "123", elicitations[0].ElicitationID)
203203
}

0 commit comments

Comments
 (0)