- 10,000+ ready-to-use tools. Nango keeps them up to date and improves them using insights from hundreds of millions of production calls.
- Fewer tokens. On-demand tool search and concise tool responses keep the agent’s context small.
- You control access. Choose whose accounts the agent uses and what it can do. The agent never sees provider API credentials.
- Traceable calls. See what the agent called and why in Nango Logs.
How sessions work
Your backend creates a session and gives the agent an MCP URL and a scoped token.- Tenant selects whose connections the agent can use.
- Toolset selects which integrations and tools it can call.
- Meta tools let it find and run tools and connect integrations.
Quickstart
1
Create a session from your backend
By default, a session covers every tool on the integrations the tenant has a connection for.To define the tenant, select the connections the agent may use with tag selectors:Requires an API key with the
environment:agent_sessions:write scope. See API key scopes.This returns a ready-to-use session:2
Pass the MCP server to your agent
Pass the The Responses API never stores the Your agent can now use every tool the session exposes.
mcp_url to your agent, with the session_token as bearer auth:- OpenAI
- Anthropic
- Vercel AI SDK
- LangChain
- Mastra
authorization value, so send it on every request.Session basics
Creating a session
Set the tenant, toolset, and session lifetime when you create a session.session_id and a scoped session_token. Treat the token as a secret and set the shortest lifetime your agent needs.
Session MCP server
Connect to the session’smcp_url over Streamable HTTP with session_token as the bearer token.
tools/list returns enabled meta tools and pinned tools, 50 per page. Pass nextCursor to fetch the next page. Call pinned tools by name and put their arguments in input. The agent can find unpinned tools with nango_tool_search and call them with nango_execute.
Tool changes
Tool availability and schemas can change during a session, including for meta tools. Fetch tool definitions from the session’s MCP server at runtime. Do not hardcode tool names or schemas.- If an error suggests a tool is unavailable or its schema may have changed, refresh the tool definitions before retrying.
- Pass tool errors to the model so it can adjust the call.
Terminating a session
Sessions expire afterexpires_in. Create a new session if you need more time. To end a session early, call DELETE /sessions/{session_id}.
environment:agent_sessions:write scope, the same one session creation uses.
401, and calls already in progress can finish.
Repeating the request returns the original ended_at and reason. An unknown session or a session in another environment returns 404.
Go deeper
Tenant
Select the connections a session uses to decide whose accounts the agent can act on.
Toolsets & tools
Control what the agent can do by choosing which integrations and tools it can use.
Meta tools
Let the agent find and run tools on demand and help users connect integrations when needed.