Commit b9a56bf
committed
fix: add required Accept header for streamable HTTP transport
When connecting to MCP servers via streamable HTTP, mcptools was not
setting the Accept header. Some servers like mcp.grep.app require
clients to accept both application/json and text/event-stream, and
return 405 errors when this header is missing.
This change ensures the Accept header is always set for both HTTP
and SSE transports, fixing compatibility with servers that enforce
this requirement.
Tested with mcp.grep.app and existing unit tests pass.1 parent 3666180 commit b9a56bf
1 file changed
+9
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
121 | 123 | | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
125 | 131 | | |
126 | 132 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 133 | + | |
132 | 134 | | |
133 | 135 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 136 | + | |
139 | 137 | | |
140 | 138 | | |
141 | 139 | | |
| |||
0 commit comments