Commit baa7153
authored
Http headers (#480)
* Add HTTP headers to Request
- Pass headers from request via ctx
- Add headers from ctx to CallToolRequest to further pass it to handlers.
* Add http-headers field to all Request Structs
* Use request_handler.tmpl to add http headers
* Add tests and documentation for Header passthrough
* Chore: fix comment in CallToolRequest struct
* Fix Race condition while setting context1 parent ffea75f commit baa7153
File tree
12 files changed
+367
-1
lines changed- mcp
- server
- internal/gen
- www/docs/pages/transports
12 files changed
+367
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
399 | 400 | | |
400 | 401 | | |
401 | 402 | | |
| 403 | + | |
402 | 404 | | |
403 | 405 | | |
404 | 406 | | |
| |||
489 | 491 | | |
490 | 492 | | |
491 | 493 | | |
| 494 | + | |
492 | 495 | | |
493 | 496 | | |
494 | 497 | | |
| |||
541 | 544 | | |
542 | 545 | | |
543 | 546 | | |
| 547 | + | |
544 | 548 | | |
545 | 549 | | |
546 | 550 | | |
| |||
554 | 558 | | |
555 | 559 | | |
556 | 560 | | |
| 561 | + | |
557 | 562 | | |
558 | 563 | | |
559 | 564 | | |
| |||
567 | 572 | | |
568 | 573 | | |
569 | 574 | | |
| 575 | + | |
570 | 576 | | |
571 | 577 | | |
572 | 578 | | |
| |||
598 | 604 | | |
599 | 605 | | |
600 | 606 | | |
| 607 | + | |
601 | 608 | | |
602 | 609 | | |
603 | 610 | | |
| |||
612 | 619 | | |
613 | 620 | | |
614 | 621 | | |
| 622 | + | |
615 | 623 | | |
616 | 624 | | |
617 | 625 | | |
| |||
717 | 725 | | |
718 | 726 | | |
719 | 727 | | |
| 728 | + | |
720 | 729 | | |
721 | 730 | | |
722 | 731 | | |
| |||
980 | 989 | | |
981 | 990 | | |
982 | 991 | | |
| 992 | + | |
983 | 993 | | |
984 | 994 | | |
985 | 995 | | |
| |||
1032 | 1042 | | |
1033 | 1043 | | |
1034 | 1044 | | |
| 1045 | + | |
1035 | 1046 | | |
1036 | 1047 | | |
1037 | 1048 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
| |||
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
| 101 | + | |
93 | 102 | | |
94 | 103 | | |
95 | 104 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | | - | |
| 507 | + | |
| 508 | + | |
508 | 509 | | |
509 | 510 | | |
510 | 511 | | |
| |||
0 commit comments