Agent Context MCP Setup Guide Public Preview
Learn how to connect your organization's context layer to the AI tools your team already uses.
Prerequisites
To use Agent Context MCP, you need:
- A context layer built with Fivetran Context Layer. If you don't have one yet, follow the steps in the Context Layer Setup Guide.
- A Fivetran account with admin access.
- Admin access to the AI tool that you want to connect to your context layer. Popular tools include Claude, Cursor, ChatGPT, Codex, and Gemini.
Setup instructions
(Optional) Select the MCP query role
- Log in to the Fivetran dashboard.
- Navigate to the Context tab.
- Go to MCP Access > MCP Query Role and choose how Agent Context MCP authenticates to your data warehouse when querying your context layer. Options vary by warehouse type.
- Use existing warehouse role: Reuses the existing credential in your data warehouse. Recommended for testing.
- Use a dedicated read-only role: A read-only role scoped to your selected schemas. Enter a role name (defaults to
FIVETRAN_CONTEXT_ROLE), then click Test & Save. If you haven't created the role yet, generate a setup script from this page. You need to update the schema grants as you add or remove sources from your context layer.
Role-based query access is not yet supported for BigQuery.
Role-based query access is not yet supported for Databricks.
Give users access
Navigate to the Context tab, then go to MCP Access > Users and add the Fivetran accounts of anyone who needs to query your context layer through Agent Context MCP.
Create system keys
Go to MCP Access > System keys and create a system key if your organization wants to authenticate custom agents or automated workflows without an individual user account.
Connect your AI tool
Follow the setup instructions below to connect your AI tool.
Fivetran's MCP endpoint is https://api.fivetran.ai/mcp. If your organization uses system keys, go to the playground, click Connect, and select your AI client to get the authorization header to copy. Expand the instructions for your client below.
Claude
- Go to Agent Context MCP in the Claude Connector Directory.
- Click Add to your team.
Claude Code
Run the following command in Claude Code:
claude mcp add --transport http --client-id claude fivetran_ai "https://api.fivetran.ai/mcp"
If your organization uses system keys, include the authorization header instead:
claude mcp add --transport http fivetran_ai "https://api.fivetran.ai/mcp" \
--header "Authorization: Bearer <token>"
ChatGPT
- Open your workspace menu and go to Workspace settings.
- Go to Apps, then click Create.
- Name the app (for example
AgentContext). - Add a description, such as "Contains all context about our company for employees."
- Paste
https://api.fivetran.ai/mcpas the MCP URL. - Set Authentication to OAuth (add the authorization header if your organization uses system keys).
- Under Advanced, select User-Defined OAuth Client and set the OAuth Client ID to
chatgpt. - Click Create.
Codex CLI
Run the following command in Codex CLI:
codex mcp add AgentContext \
--url "https://api.fivetran.ai/mcp"
If your organization uses system keys, set your API key as an environment variable first, then include it in the command:
export FIVETRAN_AI_API_KEY="<your-api-key>"
codex mcp add AgentContext --url "https://api.fivetran.ai/mcp" --bearer-token-env-var FIVETRAN_AI_API_KEY
Cursor
- Open Cursor Settings (Cmd+, on macOS or Ctrl+, on Windows/Linux).
- Go to Tools & Integrations > MCP.
- Click + New MCP Server.
- Name the server (for example
AgentContext). - Set Type to HTTP.
- Paste
https://api.fivetran.ai/mcpas the URL (add the authorization header if your organization uses system keys). - Click Save, then reload Cursor.
Gemini CLI
Run the following command in Gemini CLI:
gemini mcp add --scope user --transport http AgentContext "https://api.fivetran.ai/mcp"
Start or restart Gemini CLI, run /mcp to verify the connection, then complete the browser authentication flow.
If your organization builds custom AI agents with an SDK instead of using a client's UI, use one of the following code snippets. They connect to Fivetran's MCP endpoint at https://api.fivetran.ai/mcp.
OpenAI Agents SDK
TypeScript
import { Agent, MCPServerStreamableHttp } from '@openai/agents';
const businessContext = new MCPServerStreamableHttp({
name: 'AgentContext',
url: 'https://api.fivetran.ai/mcp',
});
export const agent = new Agent({
name: 'AgentContext',
mcpServers: [businessContext],
});
If your organization uses system keys, pass the authorization header in requestInit:
const businessContext = new MCPServerStreamableHttp({
name: 'AgentContext',
url: 'https://api.fivetran.ai/mcp',
requestInit: {
headers: {
Authorization: `Bearer ${process.env.FIVETRAN_AI_API_KEY}`,
},
},
});
Python
import os
from agents import Agent
from agents.mcp import MCPServerStreamableHttp
business_context = MCPServerStreamableHttp(
name="AgentContext",
params={
"url": "https://api.fivetran.ai/mcp",
},
)
agent = Agent(
name="AgentContext",
mcp_servers=[business_context],
)
If your organization uses system keys, pass the authorization header in params:
business_context = MCPServerStreamableHttp(
name="AgentContext",
params={
"url": "https://api.fivetran.ai/mcp",
"headers": {
"Authorization": f"Bearer {os.environ['FIVETRAN_AI_API_KEY']}",
},
},
)
Claude Agent SDK
TypeScript
import { query } from '@anthropic-ai/claude-agent-sdk';
for await (const message of query({
prompt: 'Use AgentContext to answer a question about our company.',
options: {
mcpServers: {
AgentContext: {
type: 'http',
url: 'https://api.fivetran.ai/mcp',
},
},
allowedTools: ['mcp__AgentContext__*'],
},
})) {
if (message.type === 'result' && message.subtype === 'success') {
console.log(message.result);
}
}
If your organization uses system keys, pass the authorization header alongside the URL:
AgentContext: {
type: 'http',
url: 'https://api.fivetran.ai/mcp',
headers: {
Authorization: `Bearer ${process.env.FIVETRAN_AI_TOKEN}`,
},
},
Python
import asyncio
from claude_agent_sdk import ClaudeAgentOptions, query
async def main():
async for message in query(
prompt="Use AgentContext to answer a question about our company.",
options=ClaudeAgentOptions(
mcp_servers={
"AgentContext": {
"type": "http",
"url": "https://api.fivetran.ai/mcp",
},
},
allowed_tools=["mcp__AgentContext__*"],
),
):
if hasattr(message, "result"):
print(message.result)
asyncio.run(main())
If your organization uses system keys, pass the authorization header alongside the URL:
"AgentContext": {
"type": "http",
"url": "https://api.fivetran.ai/mcp",
"headers": {
"Authorization": f"Bearer {os.environ['FIVETRAN_AI_TOKEN']}",
},
},
Google Agent Development Kit (ADK)
import os
from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StreamableHTTPConnectionParams
fivetran_ai_mcp = MCPToolset(
connection_params=StreamableHTTPConnectionParams(
url="https://api.fivetran.ai/mcp",
headers={"Authorization": f"Bearer {os.environ['FIVETRANAI_API_KEY']}"},
),
)
system_prompt = "You are a helpful assistant! Use the connected Fivetran AI MCP tools to answer questions. Cite sources where appropriate."
root_agent = LlmAgent(
name="qna_agent",
model="gemini-2.5-pro",
instruction=system_prompt,
tools=[fivetran_ai_mcp],
)