Create powerful AI workflows by connecting multiple MCP servers including Dropbox, Affinity, Hacker News for enhanced automation capabilities in Klavis AI.
Complete file management solution for Dropbox cloud storage. Upload, download, organize files and folders, manage sharing and collaboration, handle file versions, create file requests, and perform batch operations on your Dropbox files and folders
Affinity is a relationship intelligence platform that helps teams manage relationships, track deals, and leverage network insights to drive business growth with powerful CRM and relationship mapping capabilities
Access the latest tech news, discussions, and stories from Hacker News. Fetch top stories, newest posts, best stories, show HN posts, ask HN posts, job listings, and user profiles from the popular tech community platform
Follow these steps to connect LlamaIndex to these MCP servers
Sign up for KlavisAI to access our MCP server management platform.
Add your desired MCP servers to LlamaIndex and configure authentication settings.
Verify your connections work correctly and start using your enhanced AI capabilities.
import os
from klavis import Klavis
from klavis.types import McpServerName, ConnectionType
from llama_index.tools.mcp import (
BasicMCPClient,
get_tools_from_mcp_url,
aget_tools_from_mcp_url,
)
from llama_index.core.agent.workflow import FunctionAgent, AgentWorkflow
# Initialize clients
klavis_client = Klavis(api_key=os.getenv("KLAVIS_API_KEY"))
dropbox_mcp_instance = klavis_client.mcp_server.create_server_instance(
server_name=McpServerName.DROPBOX,
user_id="1234",
platform_name="Klavis",
connection_type=ConnectionType.STREAMABLE_HTTP,
)
affinity_mcp_instance = klavis_client.mcp_server.create_server_instance(
server_name=McpServerName.AFFINITY,
user_id="1234",
platform_name="Klavis",
connection_type=ConnectionType.STREAMABLE_HTTP,
)
hacker_news_mcp_instance = klavis_client.mcp_server.create_server_instance(
server_name=McpServerName.HACKER_NEWS,
user_id="1234",
platform_name="Klavis",
connection_type=ConnectionType.STREAMABLE_HTTP,
)
dropbox_tools = await aget_tools_from_mcp_url(
dropbox_mcp_instance.server_url,
client=BasicMCPClient(dropbox_mcp_instance.server_url)
)
affinity_tools = await aget_tools_from_mcp_url(
affinity_mcp_instance.server_url,
client=BasicMCPClient(affinity_mcp_instance.server_url)
)
hacker_news_tools = await aget_tools_from_mcp_url(
hacker_news_mcp_instance.server_url,
client=BasicMCPClient(hacker_news_mcp_instance.server_url)
)
dropbox_agent = FunctionAgent(
name="dropbox_agent",
tools=dropbox_tools,
llm=llm,
)
affinity_agent = FunctionAgent(
name="affinity_agent",
tools=affinity_tools,
llm=llm,
)
hacker_news_agent = FunctionAgent(
name="hacker_news_agent",
tools=hacker_news_tools,
llm=llm,
)
workflow = AgentWorkflow(
agents=[dropbox_agent, affinity_agent, hacker_news_agent],
root_agent="dropbox_agent",
)
Everything you need to know about connecting to these MCP servers
Join developers who are already using KlavisAI to power their LlamaIndex applications with these MCP servers.
Start For Free