Prerequisites Before you begin, create an account and get the API Key.
Strata
One MCP server that lets AI agents handle any tools progressively.- UI
- API
- Open Source
1
Open Dashboard
Go to your Dashboard.

Klavis enables all integrations for you by default. Click the ellipsis button if you want to disable a specific integration.


2
Authenticate
Complete authentication by clicking the “Authorize” button. Most of the applications has OAuth support. Just follow the OAuth flow to authorize them.Some applications might need you to provide API keys or other kinds of secrets to authorize.Some applications don’t have “Authorize” buttons. It means they don’t require authentication and you can access them directly.

We also provide an authentication handler tool in MCP that will prompt to authenticate when if you didn’t authorize them.


3
Use in your app
Add to your favorite MCP-supported clients, such as Cursor, Claude Code, VS Code, ChatGPT, etc.To get the MCP server URL and access token, click the “Add to Other Clients” button on the top right corner of the dashboard.

Both the URL with access token and the direct URL provide you with the same MCP. But it’s recommended to use the URL with access token as it’s a more secure way to connect.DO NOT share your access token or direct URL publicly as they provide access to your connected accounts and data.


1
Install the SDKs
Copy
Ask AI
pip install klavis
2
Create Strata MCP Server
userId specifies whose connected accounts and data you are accessing in Klavis. It should be a unique id for yourself, your team, or your organization.Copy
Ask AI
curl -X POST "https://api.klavis.ai/mcp-server/strata/create" \
-H "Authorization: Bearer YOUR_KLAVIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"userId": "user123",
"servers": ["Gmail", "YouTube"]
}'
Response Information: The API returns:
strataServerUrl: The URL you’ll use to connect your MCP client to the Strata MCP ServeroauthUrls: Authorization links for services that require OAuth authenticationapiKeyUrls: Links to configure API keys for services that use API key authentication
API Reference
Full Strata API endpoints
3
Authenticate required apps
Copy
Ask AI
Copy and paste the OAuth URL into your web browser
Authentication Methods:
- API Key: See API Key authentication guide for details.
- OAuth: See OAuth authentication guide for details.
🎉 Your MCP Server URL is ready to use! Once authentication is complete, you can use your MCP server URL with any MCP-compatible client.
4
(Optional) Connect to your AI application
- LangChain
- LlamaIndex
- CrewAI
- AutoGen
Copy
Ask AI
import os
import asyncio
import webbrowser
from klavis import Klavis
from klavis.types import McpServerName
from langchain_openai import ChatOpenAI
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from dotenv import load_dotenv
load_dotenv()
async def main():
klavis_client = Klavis(api_key=os.getenv("KLAVIS_API_KEY"))
# Step 1: Create a Strata MCP server with Gmail and YouTube integrations
response = klavis_client.mcp_server.create_strata_server(
user_id="demo_user",
servers=[McpServerName.GMAIL, McpServerName.YOUTUBE],
)
# Step 2: Handle OAuth authorization if needed
if response.oauth_urls:
for server_name, oauth_url in response.oauth_urls.items():
webbrowser.open(oauth_url)
input(f"Press Enter after completing {server_name} OAuth authorization...")
# Step 3: Create LangChain Agent with MCP Tools
mcp_client = MultiServerMCPClient({
"strata": {
"transport": "streamable_http",
"url": response.strata_server_url,
}
})
# Get all available tools from Strata
tools = await mcp_client.get_tools()
# Setup LLM
llm = ChatOpenAI(model="gpt-4o-mini", api_key=os.getenv("OPENAI_API_KEY"))
# Step 4: Create LangChain agent with MCP tools
agent = create_react_agent(
model=llm,
tools=tools,
prompt=(
"You are a helpful assistant that can use MCP tools. "
),
)
my_email = "golden-kpop@example.com" # TODO: Replace with your email
# Step 5: Invoke the agent
result = await agent.ainvoke({
"messages": [{"role": "user", "content": f"summarize this video - https://youtu.be/yebNIHKAC4A?si=1Rz_ZsiVRz0YfOR7 and send the summary to my email {my_email}"}],
})
# Print only the final AI response content
print(result["messages"][-1].content)
if __name__ == "__main__":
asyncio.run(main())
Copy
Ask AI
import os
import asyncio
import webbrowser
from klavis import Klavis
from klavis.types import McpServerName
from llama_index.llms.openai import OpenAI
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.tools.mcp import BasicMCPClient
from llama_index.tools.mcp import (
aget_tools_from_mcp_url,
)
from dotenv import load_dotenv
load_dotenv()
async def main():
klavis_client = Klavis(api_key=os.getenv("KLAVIS_API_KEY"))
# Step 1: Create a Strata MCP server with Gmail and YouTube integrations
response = klavis_client.mcp_server.create_strata_server(
user_id="1234",
servers=[McpServerName.GMAIL, McpServerName.YOUTUBE],
)
# Step 2: Handle OAuth authorization if needed
if response.oauth_urls:
for server_name, oauth_url in response.oauth_urls.items():
webbrowser.open(oauth_url)
input(f"Press Enter after completing {server_name} OAuth authorization...")
# Get all available tools from Strata
tools = await aget_tools_from_mcp_url(
response.strata_server_url,
client=BasicMCPClient(response.strata_server_url)
)
# Setup LLM
llm = OpenAI(model="gpt-4o-mini", api_key=os.getenv("OPENAI_API_KEY"))
# Step 3: Create LlamaIndex agent with MCP tools
agent = FunctionAgent(
name="my_first_agent",
description="Agent using MCP-based tools",
tools=tools,
llm=llm,
system_prompt="You are an AI assistant that uses MCP tools.",
)
my_email = "golden-kpop@example.com" # TODO: Replace with your email
youtube_video_url = "https://youtu.be/yebNIHKAC4A?si=1Rz_ZsiVRz0YfOR7" # TODO: Replace with your favorite youtube video URL
# Step 4: Invoke the agent
response = await agent.run(
f"summarize this video - {youtube_video_url} and mail this summary to my email {my_email}"
)
print(response)
if __name__ == "__main__":
asyncio.run(main())
Coming soon
Copy
Ask AI
import os
import asyncio
import webbrowser
from dotenv import load_dotenv
from klavis import Klavis
from klavis.types import McpServerName
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.ui import Console
from autogen_core import CancellationToken
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext.tools.mcp import StreamableHttpServerParams
from autogen_ext.tools.mcp import mcp_server_tools
load_dotenv()
async def main() -> None:
klavis_client = Klavis(api_key=os.getenv("KLAVIS_API_KEY"))
# Step 1: Create a Strata MCP server with Gmail and YouTube integrations
response = klavis_client.mcp_server.create_strata_server(
user_id="demo_user",
servers=[McpServerName.GMAIL, McpServerName.YOUTUBE],
)
# Handle OAuth authorization if required
if response.oauth_urls:
for server_name, oauth_url in response.oauth_urls.items():
webbrowser.open(oauth_url)
input(f"Press Enter after completing {server_name} OAuth authorization...")
server_params = StreamableHttpServerParams(
url=response.strata_server_url,
timeout=30.0,
sse_read_timeout=300.0,
terminate_on_close=True,
)
adapters = await mcp_server_tools(server_params)
model_client = OpenAIChatCompletionClient(model="gpt-4")
agent = AssistantAgent(
name="MultiAI",
model_client=model_client,
tools=adapters,
system_message="You are a helpful AI assistant.",
)
await Console(
agent.run_stream(
task="Get my latest mails.",
cancellation_token=CancellationToken(),
)
)
if __name__ == "__main__":
asyncio.run(main())
Visit https://github.com/Klavis-AI/klavis to view the source code and find more information
1
Install Strata MCP
Copy
Ask AI
pipx install strata-mcp
2
Add your MCP servers
Configure your MCP servers using the CLI tool.
Copy
Ask AI
strata add
3
Run Strata MCP Server
Start the Strata server to manage all your tools.
Copy
Ask AI
strata
4
Connect to your AI application
Use the Strata tool to add your AI client.
Copy
Ask AI
strata tool add claude
If you’re interested in 1:1 mapping between API and tool using our MCP Server Instance, check here.
