feat: Add AuthRequired to Tool Manifest (#433)

Add `AuthRequired` to Tool Manifest so SDK could throw an error early
for unauthorized Tool invocations.
SDK changes:
https://github.com/googleapis/mcp-toolbox-sdk-python/pull/72/files

Also added `authRequired` to Neo4j and dgraph tools.
This commit is contained in:
Wenxin Du
2025-04-23 12:52:04 -04:00
committed by GitHub
parent 8014eea033
commit d9388ad57e
22 changed files with 168 additions and 53 deletions

View File

@@ -316,6 +316,11 @@ func (c *ToolConfigs) UnmarshalYAML(ctx context.Context, unmarshal func(interfac
return fmt.Errorf("unable to unmarshal %q: %w", name, err)
}
// Make `authRequired` an empty list instead of nil for Tool manifest
if v["authRequired"] == nil {
v["authRequired"] = []string{}
}
kind, ok := v["kind"]
if !ok {
return fmt.Errorf("missing 'kind' field for %q", name)