This quickstart uses OpenAI as example to show how to connect to tools with Klavis in minutes.
Prerequisites
  • A Klavis account and API Key from your Dashboard
  • Optional: An LLM API Key (OpenAI, Claude)
  • Optional: Python 3.9+ or Node.js 18+

Getting started

Multi-app integration

Optimized to handle tool overload and context window limits, ideal when connecting to multiple integrations. Click to jump >

Individual-app integration

Best suited for vertical AI agents that only need to connect to a limited set of tools or a single MCP Server. Click to jump >

Multi-app integration

One MCP server for AI agents to handle thousands of tools progressively.
1

Install the SDKs (optional)

pip install klavis
2

Create a Strata server (multi-app)

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"]
  }'

API Reference

Full Strata API endpoints
3

Authenticate required apps

Use OAuth links when needed, then re-list tools.

OAuth APIs

Fetch OAuth URLs per app when required
4

Connect to your AI application

import asyncio
from mcp import ClientSession
from mcp.client.sse import sse_client

async def main(url: str):
    async with sse_client(url) as streams:
        async with ClientSession(*streams) as session:
            await session.initialize()
            tools = await session.list_tools()
            print([t.name for t in tools.tools])

# Replace with your actual Strata URL
asyncio.run(main("YOUR_STRATA_URL"))
5

Optional: Use with function calling

See SDK guides for OpenAI/Claude examples.

Individual-app integration

Connect a single integration (like Gmail or GitHub) as its own MCP server.
1

Install the SDKs (optional)

pip install klavis
2

Create a server instance

curl -X POST "https://api.klavis.ai/mcp-server/instance/create" \
  -H "Authorization: Bearer YOUR_KLAVIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "serverName": "Gmail",
    "userId": "user123"
  }'

API Reference

Create/Get/Delete server instance endpoints
3

Authenticate (OAuth or API key)

import webbrowser
if getattr(server, 'oauth_url', None):
    webbrowser.open(server.oauth_url)

OAuth APIs

Get OAuth URL and manage auth data
4

Connect to your AI application

import asyncio
from mcp import ClientSession
from mcp.client.sse import sse_client

async def main(url: str):
    async with sse_client(url) as streams:
        async with ClientSession(*streams) as session:
            await session.initialize()
            tools = await session.list_tools()
            print([t.name for t in tools.tools])

# Replace with your actual Gmail server URL
asyncio.run(main("YOUR_GMAIL_SERVER_URL"))
5

Optional: Use with function calling

Next steps

Troubleshooting