Main differences
- Connection MCP uses an Environment API key and connection headers. Agent sessions use a session token.
- Connection MCP selects one connection for a request. Agent sessions define their connection scope when created and can include multiple integrations.
- Agent sessions use an explicit toolset to control which action functions are available.
- Action functions are searchable by default instead of appearing directly in
tools/list. - Session tool names include the integration ID, such as
notion__read_docinstead ofread_doc. - Agent sessions expire and cannot be extended.
Create an agent session
Create the session from your backend with an Environment API key that has theenvironment:agent_sessions:write scope.
Pin the connection previously used by your Connection MCP integration and allow the action functions your agent needs:
session_token and mcp_url.
You can select connections by tags instead of hardcoding a connection ID:
"*":
pinned_tools if they must appear directly in tools/list.
Connect your agent to the session MCP
Configure your MCP client with the returnedmcp_url and session_token:
connection-idprovider-config-key
Discover and call tools
Connection MCP listed available actions directly. To preserve that behavior, add the actions your agent relies on topinned_tools when creating the session. Otherwise, leave them searchable, which is useful when the toolset is large.
Searchable action functions can be used through:
nango_tool_searchto find a relevant action functionnango_executeto run the selected action function
read_doc becomes notion__read_doc when it is exposed directly by a session. See Toolsets & tools for details.
Handle session expiry
Agent sessions expire according toexpires_in. Create a new session when the current one expires. You can also terminate a session early when the agent task ends.
See the agent sessions guide for connection selectors, toolsets, meta tools, session lifecycle, and MCP client examples.