News
Google Expands Managed Agents in Gemini API With Background Tasks and Remote MCP
Google added background execution for long-running agentic tasks to the Gemini API, along with direct connections to remote MCP servers and custom functions, making it easier to build production agents without writing custom middleware.
Contents
Google published an update to the Managed Agents feature in the Gemini API on July 7, 2026, a mechanism that lets developers run fully managed AI agents without building their own infrastructure for code execution and tool calling. The updates focus on four areas: background tasks, integration with remote MCP servers, custom functions, and network credential refresh.
Background tasks without an open connection
Previously, a long-running agentic task required keeping an HTTP connection open for the entire duration of its execution, something Google describes as fragile and prone to network interruptions. The new background option lets developers hand a task off to the server, immediately receive an interaction ID, and poll for progress, stream results, or return to the task later, even after closing and reopening the client application.
Remote MCP instead of custom proxies
The second change concerns the Model Context Protocol, a standard for connecting language models to external tools and data that has become a common reference point across the AI agent industry over the past year. Instead of writing a custom middleware layer to reach private databases or internal company APIs, developers can now pass an mcp_server parameter directly when calling an interaction and combine remote tools with built-in sandbox capabilities such as Google Search or code execution.
Custom functions and credential management
The third feature lets developers add their own functions alongside tools built into the sandbox. The system distinguishes between the two types through a step-matching mechanism: built-in tools execute automatically on the server side, while calling a custom function switches the interaction to a requires_action status, meaning execution must happen locally on the client side.
The fourth change addresses a practical problem for long-running agents whose access tokens expire mid-task. Passing an existing environment_id along with new network configuration lets developers refresh credentials without losing the state of the environment, including installed packages and cloned code repositories.
What it means for Polish teams
For companies building their own agents on top of the Gemini API, these changes mean less infrastructure code to maintain. Support for remote MCP is especially relevant for teams that have already invested in MCP servers for their internal systems, since it lets them connect those servers to Google's agent without an extra middleware layer. Background tasks, in turn, could make it easier to build agents that handle longer business processes, such as analyzing large document sets or multi-step programming tasks.
Google did not disclose pricing details or full regional availability for the new features in the announcement. Sample code in the documentation uses the @google/genai package in JavaScript, with versions also available for Python and examples in cURL.
Sources: Expanding Managed Agents in Gemini API: background tasks, remote MCP and more (blog.google)

