You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Differences from mcp-go**: Version 0.26.0 of mcp-go defines 24 server hooks. Each hook consists of a field in the `Hooks` struct, a `Hooks.Add` method, and a type for the hook function. These are rarely used. The most common is `OnError`, which occurs fewer than ten times in open-source code.
472
472
473
+
#### Rate Limiting
474
+
475
+
Rate limiting can be configured using middleware.
476
+
477
+
As an example, this code adds a per-session rate limiter using the [golang.org/x/time/rate](https://pkg.go.dev/golang.org/x/time/rate) package.
478
+
479
+
```go
480
+
// PerSessionRateLimiterMiddleware creates a middleware that applies rate limiting
With the exception of tool handler errors, protocol errors are handled transparently as Go errors: errors in server-side feature handlers are propagated as errors from calls from the `ClientSession`, and vice-versa.
0 commit comments