feat: add OAuth login and MCP session connect

This commit is contained in:
2026-09-01 12:06:01 -05:00
parent 3983d0b335
commit 9915ff0c5f
7 changed files with 408 additions and 6 deletions
+6 -1
View File
@@ -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)
}