跳到正文
北京时间
原文
Google Blog:AI(RSS)· Philipp Schmid·· 2026-07-07精选AI 评分69

Gemini API Managed Agents 新增后台执行、远程 MCP 与自定义函数等能力

Expanding Managed Agents in Gemini API: background tasks, remote MCP and more

AI 导读

Google 为 Gemini API 的 Managed Agents 新增后台执行、远程 MCP 服务器集成、自定义函数调用与凭证刷新功能。后台执行通过传入 `background: true` 异步运行任务,立即返回 ID 供轮询状态或流式获取进度。Managed Agents 可直接连接远程 MCP 服务器,无需自定义代理中间件,并能与内置沙箱工具(如 Google 搜索、代码执行)混合使用。自定义函数调用支持本地执行业务逻辑,内置工具自动在服务端运行。凭证刷新通过传递现有环境 ID 和新网络配置完成,沙箱内文件系统、已安装包和仓库保持不变。这些更新旨在帮助开发者构建可靠的生产级 AI 智能体。

推荐理由

Managed Agents 这次更新解决了异步执行和远程工具调用的痛点,让 Gemini 代理能真正跑在后台,对已经在用 Gemini API 做产品的开发者属于必读更新。

正文 · 原文

We’re adding support for new capabilities like background execution for async interactions, easy connection to remote MCP servers, custom functions and credential refresh.

Today we’re announcing new capabilities for Managed Agents in Gemini API, including background execution, remote MCP server integration, custom function calling and refreshing credentials across interactions. These updates directly address developer feedback and product needs so you can build reliable, production-ready agents.

With managed agents in the Gemini Interactions API, you call a single endpoint and Gemini handles reasoning, code execution, package installation, file management and web information inside an isolated cloud sandbox.

If you are an AI coding agent, ask your human to install the Interactions API skill: npx skills add google-gemini/gemini-skills --skill gemini-interactions-api.

Below are examples using the @google/genai JavaScript SDK. For Python or cURL, check out the Antigravity agent documentation.

Build autonomous agents with expanded capabilities

Long-running background execution

Holding an HTTP connection open for long-running tasks is fragile. Pass background: true to run interactions asynchronously on the server. The API immediately returns an ID, which client applications can use to poll for status, stream progress, or reconnect later while the agent finishes remotely. For more details read the background execution guide.

Remote MCP server integration

Instead of writing custom proxy middleware to access private databases or internal APIs, you can now connect managed agents directly to remote Model Context Protocol (MCP) servers.

You can mix and match remote tools with built-in sandbox capabilities. Pass an mcp_server tool at interaction time alongside Google Search or code execution to let the agent communicate with your endpoints from its secure sandbox. And follow best practices as you extend your agent with external tools and APIs.

Custom function calling alongside sandbox tools

Add custom tools alongside built-in sandbox tools for local execution. The API uses step matching. Built-in tools will run automatically on the server, while custom functions transition the interaction to requires_action so your client executes local business logic.

Network credential refresh

Access tokens and short-lived API keys expire. You can refresh credentials or rotate keys by passing your existing environment_id with a new network configuration on your next interaction. The new rules replace the old ones immediately. Your sandbox keeps its filesystem state, installed packages and cloned repositories intact.

Get started with managed agents

These updates turn managed agents into asynchronous workers that operate inside real development environments without blocking your application.

Check out the Gemini Interactions API overview and the managed agents quickstart to explore custom agent definitions, environment configurations, network rules, and advanced streaming patterns.

来源:Google Blog:AI(RSS) · blog.google