Agent Deployment + Connecting to Local MCPs #2796
-
Hi, I'm a little confused about the agent deployment process, when deploying to Agent Engine or Cloud Run (or similar).
If so, what's the underlying technology supporting this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: A deployed agent on Cloud Run runs in a container and can't directly access your local files. However, it can connect to a local MCP server on your machine to access the filesystem. The ADK framework does support OAuth and OIDC, and will redirect the auth flow to the user when a tool requires it. Hello! Here is some information regarding your questions about agent deployment. Accessing the Local FilesystemWhen you deploy an agent to a remote environment like Cloud Run, it operates within a containerized environment. This means the agent has its own isolated filesystem and cannot directly access the local files on the user's machine. However, the Agent Development Kit (ADK) provides a solution for this through the Model Context Protocol (MCP). You can run an MCP server on the user's local machine, and the remotely deployed agent can connect to this local MCP server. This connection allows the agent to access the user's local files indirectly. For remote connections to an MCP server, you would typically use Authentication and OAuth FlowThe ADK framework is designed to handle authentication for tools that require it, including OAuth 2.0 and OpenID Connect (OIDC). When a tool needs authentication, the ADK framework will pause its execution and signal the agent client application to initiate the authentication flow. Here is a general overview of the process:
This process ensures that the authentication flow is properly handled, even when the agent is deployed remotely. I hope this helps clarify the deployment process! [1] https://google.github.io/adk-docs/tools/mcp-tools/ |
Beta Was this translation helpful? Give feedback.
I think the bot's answer is confusing. Agent engine is also deployed to cloud run, that means your codes runs in a container, I think you should be able to access the container's filesystem (at least /tmp) , you can try to use the stdio MCP server to access the filesystem as you mentioned. as for oauth flow, adk did surface some special event to the client if you are using ADK web as your agent client, you get it for free. (ADK web will be available if you run 'adk deploy cloud_run --with_ui', but won't be available for agent engine). To handle the special event yourself in your own client, please reference : https://google.github.io/adk-docs/tools/authentication/#2-handling-the-interacti…