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
Copy file name to clipboardExpand all lines: README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1401,6 +1401,18 @@ client.tools # will make the call using Bearer auth
1401
1401
1402
1402
You can add any custom headers needed for your authentication scheme, or for any other purpose. The client will include these headers on every request.
1403
1403
1404
+
#### Customizing the Faraday Connection
1405
+
1406
+
You can pass a block to `MCP::Client::HTTP.new` to customize the underlying Faraday connection.
1407
+
The block is called after the default middleware is configured, so you can add middleware or swap the HTTP adapter:
1408
+
1409
+
```ruby
1410
+
http_transport =MCP::Client::HTTP.new(url:"https://api.example.com/mcp") do |faraday|
1411
+
faraday.use MyApp::Middleware::HttpRecorder
1412
+
faraday.adapter :typhoeus
1413
+
end
1414
+
```
1415
+
1404
1416
### Tool Objects
1405
1417
1406
1418
The client provides a wrapper class for tools returned by the server:
0 commit comments