Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package mcp_test
package main

import (
"context"
Expand All @@ -15,10 +15,9 @@ var nextProgressToken atomic.Int64

// This middleware function adds a progress token to every outgoing request
// from the client.
func Example_progressMiddleware() {
c := mcp.NewClient(testImpl, nil)
func main() {
c := mcp.NewClient(&mcp.Implementation{Name: "test"}, nil)
c.AddSendingMiddleware(addProgressToken[*mcp.ClientSession])
_ = c
}

func addProgressToken[S mcp.Session](h mcp.MethodHandler) mcp.MethodHandler {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package mcp_test
package main

import (
"context"
Expand All @@ -16,7 +16,7 @@ import (
)

// This example demonstrates server side logging using the mcp.Middleware system.
func Example_loggingMiddleware() {
func main() {
// Create a logger for demonstration purposes.
logger := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
Level: slog.LevelInfo,
Expand Down
9 changes: 0 additions & 9 deletions mcp/mcp-repo-replace.txt

This file was deleted.