Use inter-app agents and MCP servers¶
This topic describes how a Snowflake Native App can use inter-app communication (IAC) to let its Cortex Agent call another app’s agent or MCP server.
When apps include Cortex Agents and MCP servers, two inter-app patterns become available:
- Agent-to-agent: one app’s agent runs another app’s agent through a wrapper procedure.
- Agent-to-MCP server: one app’s agent uses another app’s MCP server as a tool.
Each app keeps its own data and logic private. Agents can only reach across apps through the tools and permissions that providers expose and consumers approve.
Before you begin¶
Before using inter-app agent communication, you should be familiar with the following topics:
How it works¶
Inter-app agent communication builds on the IAC connection handshake:
- The client app (the app whose agent initiates calls) requests a connection to the server app (the app that provides agents and/or MCP servers).
- The consumer admin approves the connection, granting the server app’s application roles to the client app.
- With the server’s application roles, the client app’s agent can use the server app’s agents and MCP servers in its own agent specification.
Example: inter-app portfolio analysis¶
This example uses two apps:
- Financial Toolbox App (server): provides historical market data through a Cortex Agent, and ML-based price forecasting through a custom MCP server on SPCS.
- Portfolio App (client): knows the consumer’s stock holdings and orchestrates across both apps to answer questions.
The Portfolio agent is the entry point (for example, in Snowflake Intelligence, select the Portfolio agent). It can look up the consumer’s holdings locally, delegate historical analysis to the Financial Toolbox agent (agent-to-agent), and request price forecasts from the Financial Toolbox MCP server (agent-to-MCP).
Server app: Financial Toolbox¶
The Financial Toolbox app exposes two inter-app capabilities: an agent (wrapped in a stored procedure) and a custom MCP server. Both are created in the app’s setup script and granted to an application role so that connected client apps can use them.
Agent for historical market analysis¶
Custom MCP server for price forecasting¶
The Financial Toolbox also runs an ML forecasting model on SPCS, registered as a custom MCP server:
Client app: Portfolio App¶
The Portfolio app wires up inter-app tools in two parts: an APPLICATION_NAME
configuration definition to request the server app name from the consumer, and an
agent specification that references the Financial Toolbox’s agent and MCP server.
Connection request¶
The setup script creates an APPLICATION_NAME configuration definition to request
the server app name from the consumer. This follows the standard
IAC connection request workflow.
A before_configuration_change callback then creates the connection request and the
Portfolio agent. When the consumer provides the server app name, this callback runs
automatically. It uses the server app name to build fully qualified references to
the Financial Toolbox’s wrapper procedure and MCP server:
The app’s manifest.yml registers this callback:
Because tool identifiers in the agent specification are resolved at runtime (not
creation time), the agent can be created before the connection is approved. The
fully qualified names (for example, FINANCIAL_TOOLBOX.CORE.RUN_FINANCIAL_AGENT)
only need to be accessible when the agent actually invokes those tools.
When the consumer approves the connection, the Portfolio app is granted the Financial
Toolbox’s fin_app_user role, which includes USAGE on the agent-wrapper procedure
and the MCP server.
Consumer setup¶
The consumer installs both apps and approves the connection:
The consumer also configures caller grants so that the Portfolio app can use Financial Toolbox objects on the consumer’s behalf:
After the caller grants are configured, the Portfolio agent can run the Financial
Toolbox agent and use its MCP server. The agent is available in Snowflake
Intelligence, through the REST API, or through SQL (SNOWFLAKE.CORTEX.DATA_AGENT_RUN).
Runtime behavior¶
With the connection approved, the Portfolio agent orchestrates across both apps at runtime.
Agent-to-agent: historical analysis¶
When a consumer asks “What are the top 3 stocks in my portfolio by returns over the past 6 months?”, the Portfolio agent:
- Calls
PortfolioLookupto retrieve the consumer’s holdings from the Portfolio app’s data. - Calls
FinancialToolboxAgent, which triggers the Financial Toolbox agent. That agent uses its ownMarketDatatool to query historical stock data. - Combines the results and returns an analysis.
The invocation chain is: Portfolio agent → Financial Toolbox agent-wrapper procedure
(FINANCIAL_TOOLBOX.CORE.RUN_FINANCIAL_AGENT) → Financial Toolbox agent.
Note
While both agents run in restricted caller’s rights (RCR) mode, caller grant requirements do not chain through this flow. The owner’s-rights wrapper procedure resets the caller context, so each RCR agent’s caller grant requirement applies independently.
In this example, the Financial Toolbox agent is invoked by its own app’s owner’s-rights procedure, so the caller of the RCR agent is the Financial Toolbox app itself. As a result, unlike the Portfolio agent, the Financial Toolbox agent can access the consumer’s data only if regular grants of that data are granted directly to the Financial Toolbox app, in addition to the caller grants.
Agent-to-MCP: price forecasting¶
When the consumer asks “Given my average cost basis of a certain stock, should I buy, hold, or sell tomorrow?”, the Portfolio agent:
- Calls
PortfolioLookupto get the consumer’s cost basis for the stock. - Calls a tool from
FINANCIAL_TOOLBOX.SERVICES.FORECAST_MCPto get the predicted price for the next day. - Returns a recommendation based on the cost basis and forecast.