mcp: make request headers available to tools (#333)
Add HTTP request headers to RequestExtra, so tools and other user-defined handlers can access them. Fixes #331.
This commit is contained in:
parent
48abccbf6b
commit
73b8a7f134
1 changed files with 10 additions and 9 deletions
|
|
@ -16,6 +16,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"slices"
|
||||
"strings"
|
||||
|
|
@ -400,6 +401,7 @@ type ServerRequest[P Params] struct {
|
|||
// the transport layer.
|
||||
type RequestExtra struct {
|
||||
TokenInfo *auth.TokenInfo // bearer token info (e.g. from OAuth) if any
|
||||
Header http.Header // header from HTTP request, if any
|
||||
}
|
||||
|
||||
func (*ClientRequest[P]) isRequest() {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue