Connectto Postgres, Plai, Mem0 MCP Servers

Create powerful AI workflows by connecting multiple MCP servers including Postgres, Plai, Mem0 for enhanced automation capabilities in Klavis AI.

Postgres icon

Postgres

featured

PostgreSQL is a powerful, open source object-relational database system

Available Tools:

  • query
Plai icon

Plai

featured

Plai is an AI-powered advertising platform that simplifies creating, managing, and optimizing Facebook, Instagram, and LinkedIn ad campaigns. It provides tools for lead generation, campaign insights, and automated ad management to help businesses scale their digital marketing efforts effectively.

Available Tools:

  • plai_create_user_profile
  • plai_get_user_profile
  • plai_create_link
  • +7 more tools
Mem0 icon

Mem0

featured

Mem0 is an intelligent memory layer for AI applications that provides long-term memory storage and retrieval. Store code snippets, implementation details, and programming knowledge for seamless context retention across conversations

Available Tools:

  • mem0_add_memory
  • mem0_get_all_memories
  • mem0_search_memories
  • +2 more tools

Quick Setup Guide

Follow these steps to connect LlamaIndex to these MCP servers

1

Create Your Account

Sign up for KlavisAI to access our MCP server management platform.

2

Configure Connections

Add your desired MCP servers to LlamaIndex and configure authentication settings.

3

Test & Deploy

Verify your connections work correctly and start using your enhanced AI capabilities.

LlamaIndex + KlavisAI Integration Snippets

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"))

postgres_mcp_instance = klavis_client.mcp_server.create_server_instance(
    server_name=McpServerName.POSTGRES,
    user_id="1234",
    platform_name="Klavis",
    connection_type=ConnectionType.STREAMABLE_HTTP,
)

plai_mcp_instance = klavis_client.mcp_server.create_server_instance(
    server_name=McpServerName.PLAI,
    user_id="1234",
    platform_name="Klavis",
    connection_type=ConnectionType.STREAMABLE_HTTP,
)

mem0_mcp_instance = klavis_client.mcp_server.create_server_instance(
    server_name=McpServerName.MEM0,
    user_id="1234",
    platform_name="Klavis",
    connection_type=ConnectionType.STREAMABLE_HTTP,
)
postgres_tools = await aget_tools_from_mcp_url(
    postgres_mcp_instance.server_url, 
    client=BasicMCPClient(postgres_mcp_instance.server_url)
)
plai_tools = await aget_tools_from_mcp_url(
    plai_mcp_instance.server_url, 
    client=BasicMCPClient(plai_mcp_instance.server_url)
)
mem0_tools = await aget_tools_from_mcp_url(
    mem0_mcp_instance.server_url, 
    client=BasicMCPClient(mem0_mcp_instance.server_url)
)

postgres_agent = FunctionAgent(
    name="postgres_agent",
    tools=postgres_tools,
    llm=llm,
)

plai_agent = FunctionAgent(
    name="plai_agent",
    tools=plai_tools,
    llm=llm,
)

mem0_agent = FunctionAgent(
    name="mem0_agent",
    tools=mem0_tools,
    llm=llm,
)
workflow = AgentWorkflow(
    agents=[postgres_agent, plai_agent, mem0_agent],
    root_agent="postgres_agent",
)

Frequently Asked Questions

Everything you need to know about connecting to these MCP servers

Ready to Get Started?

Join developers who are already using KlavisAI to power their LlamaIndex applications with these MCP servers.

Start For Free