feat: add OAuth login and MCP session connect
This commit is contained in:
+6
-1
@@ -4,6 +4,8 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
mcp "github.com/modelcontextprotocol/go-sdk/mcp"
|
||||
)
|
||||
|
||||
// Client is a Robinhood Agentic MCP client.
|
||||
@@ -11,7 +13,7 @@ type Client struct {
|
||||
URL, Token, Name, Version string
|
||||
HTTP *http.Client
|
||||
Hook Caller
|
||||
session any
|
||||
session *mcp.ClientSession
|
||||
}
|
||||
|
||||
// Call invokes an MCP tool by name and returns its JSON result.
|
||||
@@ -19,5 +21,8 @@ func (c *Client) Call(ctx context.Context, name string, args map[string]any) (js
|
||||
if c.Hook != nil {
|
||||
return c.Hook.Call(ctx, name, args)
|
||||
}
|
||||
if c.session != nil {
|
||||
return c.sessionCall(ctx, name, args)
|
||||
}
|
||||
return c.rpcCall(ctx, name, args)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user