From cbad83383e36cfe6f5bfeb3ef7caa1a6b61358f5 Mon Sep 17 00:00:00 2001 From: wolo Date: Tue, 8 Sep 2026 13:23:42 +0000 Subject: [PATCH 1/2] docs(integrations): document Go support for the Postman MCP server The Postman page carried Python and TypeScript tabs only, so Go users had no documented way to reach the Postman MCP server even though adk-go needs no new code for it. Both transports the page describes are already covered by google.golang.org/adk/v2/tool/mcptoolset: mcp.CommandTransport for the local npx server, and Config.Endpoint plus Config.Auth for the remote streamable HTTP server, where auth.StaticToken produces the same Authorization: Bearer header the Python and TypeScript samples set by hand. Add the lst-go language-support span and a Go tab with the same Local and Remote sub-tabs as the other two languages, following the pattern used by agent-registry.md and mcp-toolbox-for-databases.md. The optional server flags are held in an args slice so the Configuration section's "add --full or --code to the args list" reads correctly for Go as well. --- docs/integrations/postman.md | 136 ++++++++++++++++++++++++++++++++++- 1 file changed, 135 insertions(+), 1 deletion(-) diff --git a/docs/integrations/postman.md b/docs/integrations/postman.md index 8fae203b63..af9177377d 100644 --- a/docs/integrations/postman.md +++ b/docs/integrations/postman.md @@ -8,7 +8,7 @@ catalog_tags: ["mcp"] # Postman MCP tool for ADK
- Supported in ADKPythonTypeScript + Supported in ADKPythonTypeScriptGo
The [Postman MCP Server](https://github.com/postmanlabs/postman-mcp-server) @@ -174,6 +174,140 @@ natural language interactions. export { rootAgent }; ``` +=== "Go" + + === "Local MCP Server" + + ```go + package main + + import ( + "context" + "log" + "os" + "os/exec" + + "github.com/modelcontextprotocol/go-sdk/mcp" + "google.golang.org/genai" + + "google.golang.org/adk/v2/agent" + "google.golang.org/adk/v2/agent/llmagent" + "google.golang.org/adk/v2/cmd/launcher" + "google.golang.org/adk/v2/cmd/launcher/full" + "google.golang.org/adk/v2/model/gemini" + "google.golang.org/adk/v2/tool" + "google.golang.org/adk/v2/tool/mcptoolset" + ) + + const postmanAPIKey = "YOUR_POSTMAN_API_KEY" + + func main() { + ctx := context.Background() + + model, err := gemini.NewModel(ctx, "gemini-flash-latest", &genai.ClientConfig{ + APIKey: os.Getenv("GOOGLE_API_KEY"), + }) + if err != nil { + log.Fatalf("Failed to create the model: %v", err) + } + + args := []string{"-y", "@postman/postman-mcp-server"} + // args = append(args, "--full") // Use all 100+ tools + // args = append(args, "--code") // Use code generation tools + // args = append(args, "--region", "eu") // Use EU region + + server := exec.CommandContext(ctx, "npx", args...) + server.Env = append(os.Environ(), "POSTMAN_API_KEY="+postmanAPIKey) + + postman, err := mcptoolset.New(mcptoolset.Config{ + Transport: &mcp.CommandTransport{Command: server}, + }) + if err != nil { + log.Fatalf("Failed to create the Postman tool set: %v", err) + } + + rootAgent, err := llmagent.New(llmagent.Config{ + Model: model, + Name: "postman_agent", + Instruction: "Help users manage their Postman workspaces and collections", + Toolsets: []tool.Toolset{postman}, + }) + if err != nil { + log.Fatalf("Failed to create the agent: %v", err) + } + + l := full.NewLauncher() + cfg := &launcher.Config{AgentLoader: agent.NewSingleLoader(rootAgent)} + if err := l.Execute(ctx, cfg, os.Args[1:]); err != nil { + log.Fatalf("Run failed: %v\n\n%s", err, l.CommandLineSyntax()) + } + } + ``` + + === "Remote MCP Server" + + ```go + package main + + import ( + "context" + "log" + "os" + + "google.golang.org/genai" + + "google.golang.org/adk/v2/agent" + "google.golang.org/adk/v2/agent/llmagent" + "google.golang.org/adk/v2/auth" + "google.golang.org/adk/v2/cmd/launcher" + "google.golang.org/adk/v2/cmd/launcher/full" + "google.golang.org/adk/v2/model/gemini" + "google.golang.org/adk/v2/tool" + "google.golang.org/adk/v2/tool/mcptoolset" + ) + + const postmanAPIKey = "YOUR_POSTMAN_API_KEY" + + func main() { + ctx := context.Background() + + model, err := gemini.NewModel(ctx, "gemini-flash-latest", &genai.ClientConfig{ + APIKey: os.Getenv("GOOGLE_API_KEY"), + }) + if err != nil { + log.Fatalf("Failed to create the model: %v", err) + } + + postman, err := mcptoolset.New(mcptoolset.Config{ + // (Optional) Use "/minimal" for essential tools only + // (Optional) Use "/code" for code generation tools + // (Optional) Use "https://mcp.eu.postman.com/mcp" for EU region + Endpoint: "https://mcp.postman.com/mcp", + // Auth sets "Authorization: Bearer " on every request. + Auth: auth.StaticToken(postmanAPIKey), + }) + if err != nil { + log.Fatalf("Failed to create the Postman tool set: %v", err) + } + + rootAgent, err := llmagent.New(llmagent.Config{ + Model: model, + Name: "postman_agent", + Instruction: "Help users manage their Postman workspaces and collections", + Toolsets: []tool.Toolset{postman}, + }) + if err != nil { + log.Fatalf("Failed to create the agent: %v", err) + } + + l := full.NewLauncher() + cfg := &launcher.Config{AgentLoader: agent.NewSingleLoader(rootAgent)} + if err := l.Execute(ctx, cfg, os.Args[1:]); err != nil { + log.Fatalf("Run failed: %v\n\n%s", err, l.CommandLineSyntax()) + } + } + ``` + ## Configuration Postman offers three tool configurations: From 1bab17bb4c0b4399d33fa03f9d7833968d64ff08 Mon Sep 17 00:00:00 2001 From: wolo Date: Fri, 11 Sep 2026 07:45:57 +0000 Subject: [PATCH 2/2] docs(integrations): scope the env passed to the Postman MCP server The Go sample forwarded the whole parent environment to a package fetched from npm at run time, including the GOOGLE_API_KEY it reads a few lines earlier. Pass an allowlist instead: the Postman key plus the variables npx needs on POSIX and Windows. --- docs/integrations/postman.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/integrations/postman.md b/docs/integrations/postman.md index af9177377d..2dfa68c196 100644 --- a/docs/integrations/postman.md +++ b/docs/integrations/postman.md @@ -217,7 +217,17 @@ natural language interactions. // args = append(args, "--region", "eu") // Use EU region server := exec.CommandContext(ctx, "npx", args...) - server.Env = append(os.Environ(), "POSTMAN_API_KEY="+postmanAPIKey) + // Forward only what npx needs, plus the Postman key. The parent environment + // may hold unrelated secrets, such as the GOOGLE_API_KEY read above. + server.Env = []string{"POSTMAN_API_KEY=" + postmanAPIKey} + for _, k := range []string{ + "PATH", "HOME", // POSIX + "APPDATA", "LOCALAPPDATA", "TEMP", "USERPROFILE", // Windows + } { + if v, ok := os.LookupEnv(k); ok { + server.Env = append(server.Env, k+"="+v) + } + } postman, err := mcptoolset.New(mcptoolset.Config{ Transport: &mcp.CommandTransport{Command: server},