No-Code

Connect to enterprise-grade MCP servers instantly!

Get Started →


For Developer

Follow the instructions below to integrate Postgres MCP server to your AI application using our API or SDK.

Prerequisites

1. Create a Postgres MCP Server

Use the following endpoint to create a new remote Postgres MCP server instance:

Request

from klavis import Klavis
from klavis.types import McpServerName, ConnectionType

klavis_client = Klavis(api_key="<YOUR_API_KEY>")

# Create a Postgres MCP server instance
postgres_server = klavis_client.mcp_server.create_server_instance(
    server_name=McpServerName.POSTGRES,
    user_id="<YOUR_USER_ID>",
    platform_name="<YOUR_PLATFORM_NAME>",
)

Response

{
  "serverUrl": "https://postgres-mcp-server.klavis.ai/sse?instance_id=<instance-id>",
  "instanceId": "<instance-id>"
}
serverUrl specifies the endpoint of the Postgres MCP server, which allows you to interact with PostgreSQL databases.
instanceId is used for authentication and identification of your server instance.

2. Configure Postgres Connection

To connect to your PostgreSQL database, you need to configure the MCP server with your database credentials. They are usually in the form of postgresql://<user>:<password>@<host>:<port>/<database_name>.

Setting up Postgres Connection

curl --request POST \
  --url https://api.klavis.ai/mcp-server/instance/set-auth-token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "instanceId": "<string>",
  "authToken": "<string>"
}'

Response

{
  "success": true,
  "message": "<string>"
}

Explore MCP Server Tools

No-Code

Connect to enterprise-grade MCP servers instantly!

Get Started →


For Developer

Follow the instructions below to integrate Postgres MCP server to your AI application using our API or SDK.

Prerequisites

1. Create a Postgres MCP Server

Use the following endpoint to create a new remote Postgres MCP server instance:

Request

from klavis import Klavis
from klavis.types import McpServerName, ConnectionType

klavis_client = Klavis(api_key="<YOUR_API_KEY>")

# Create a Postgres MCP server instance
postgres_server = klavis_client.mcp_server.create_server_instance(
    server_name=McpServerName.POSTGRES,
    user_id="<YOUR_USER_ID>",
    platform_name="<YOUR_PLATFORM_NAME>",
)

Response

{
  "serverUrl": "https://postgres-mcp-server.klavis.ai/sse?instance_id=<instance-id>",
  "instanceId": "<instance-id>"
}
serverUrl specifies the endpoint of the Postgres MCP server, which allows you to interact with PostgreSQL databases.
instanceId is used for authentication and identification of your server instance.

2. Configure Postgres Connection

To connect to your PostgreSQL database, you need to configure the MCP server with your database credentials. They are usually in the form of postgresql://<user>:<password>@<host>:<port>/<database_name>.

Setting up Postgres Connection

curl --request POST \
  --url https://api.klavis.ai/mcp-server/instance/set-auth-token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "instanceId": "<string>",
  "authToken": "<string>"
}'

Response

{
  "success": true,
  "message": "<string>"
}

Explore MCP Server Tools