File tree Expand file tree Collapse file tree 3 files changed +5
-15
lines changed Expand file tree Collapse file tree 3 files changed +5
-15
lines changed Original file line number Diff line number Diff line change 2
2
// Use of this source code is governed by an MIT-style
3
3
// license that can be found in the LICENSE file.
4
4
5
- package mcp_test
5
+ package main
6
6
7
7
import (
8
8
"context"
@@ -15,10 +15,9 @@ var nextProgressToken atomic.Int64
15
15
16
16
// This middleware function adds a progress token to every outgoing request
17
17
// from the client.
18
- func Example_progressMiddleware () {
19
- c := mcp .NewClient (testImpl , nil )
18
+ func main () {
19
+ c := mcp .NewClient (& mcp. Implementation { Name : "test" } , nil )
20
20
c .AddSendingMiddleware (addProgressToken [* mcp .ClientSession ])
21
- _ = c
22
21
}
23
22
24
23
func addProgressToken [S mcp.Session ](h mcp.MethodHandler ) mcp.MethodHandler {
Original file line number Diff line number Diff line change 2
2
// Use of this source code is governed by an MIT-style
3
3
// license that can be found in the LICENSE file.
4
4
5
- package mcp_test
5
+ package main
6
6
7
7
import (
8
8
"context"
@@ -16,7 +16,7 @@ import (
16
16
)
17
17
18
18
// This example demonstrates server side logging using the mcp.Middleware system.
19
- func Example_loggingMiddleware () {
19
+ func main () {
20
20
// Create a logger for demonstration purposes.
21
21
logger := slog .New (slog .NewTextHandler (os .Stdout , & slog.HandlerOptions {
22
22
Level : slog .LevelInfo ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments