TutorialMar 14, 2026 · 7 min read

How to connect Claude to your PostgreSQL database in 5 minutes

AI assistants like Claude are incredibly powerful — but they can only work with the information you give them. Copy-pasting data into a chat window doesn't scale. What if Claude could query your database directly, in real time, and give you answers based on live data?

That's exactly what the Model Context Protocol (MCP) enables. MCP is an open standard (originally developed by Anthropic) that lets AI assistants connect to external data sources — databases, APIs, file systems — through a standardized interface. Think of it as a USB port for AI: plug in a data source, and the AI can use it immediately.

In this tutorial, you'll connect Claude to your PostgreSQL database using conexor.io in five steps. No backend code. No infrastructure to manage. Just a connection string and five minutes.

Step 1: Create a free conexor.io account

Head to app.conexor.io/register and create your account. The free tier includes one database connection and up to 1,000 queries per month — more than enough to evaluate the platform.

Once you're in, you'll land on the dashboard. This is where you'll manage your database connections and see query logs.

Step 2: Add your PostgreSQL connection

Click "Add Connection" and select PostgreSQL. You'll need your connection details: host, port (usually 5432), database name, username, and password. Paste your connection string or fill in the individual fields.

conexor.io encrypts your connection string with AES-256-GCM in your browser before it ever leaves your machine. We never see the plaintext. Once saved, conexor.io connects to your database, discovers the schema, and auto-generates MCP tools for each table.

🔒 Use read-only credentials

We strongly recommend creating a dedicated read-only PostgreSQL user for conexor.io. This ensures that no matter what query the AI generates, it can only SELECT data — never modify or delete anything. Create one with: CREATE USER conexor_reader WITH PASSWORD '...'; GRANT SELECT ON ALL TABLES IN SCHEMA public TO conexor_reader;

Step 3: Copy your MCP server URL and API key

After your connection is set up, go to the MCP Settings page. You'll see two things you need: your MCP server URL (something like https://mcp.conexor.io/sse?apiKey=YOUR_KEY) and your API key. Copy both.

Step 4: Configure Claude Desktop (or any MCP client)

Open Claude Desktop and go to Settings → MCP Servers → Add Server. Paste your MCP server URL. Claude will connect to conexor.io, discover the available tools (one per table in your database), and make them available in your conversations.

This works with any MCP-compatible client — not just Claude. Cursor, Continue, n8n, and custom agents all support MCP. The configuration is always the same: point the client at your MCP server URL.

Step 5: Ask your first question

Open a new conversation in Claude and ask something like:

"What were our top 10 customers by revenue last quarter?"

Claude will automatically select the right MCP tool, generate a SQL query, execute it against your database through conexor.io, and return the results in a readable format. You didn't write any SQL. You didn't build an API. You just asked a question.

What's possible once you're connected

With your database connected, you can ask Claude to do things that previously required a data analyst or custom dashboards:

  • Generate ad-hoc reports: "Show me monthly revenue trends for the last 12 months"
  • Investigate anomalies: "Why did order volume drop last Tuesday?"
  • Answer business questions: "Which product categories have the highest return rates?"
  • Cross-reference data: "Compare our top customers this quarter vs. last quarter"

Every query is logged, parameterized for SQL injection safety, and visible in your conexor.io dashboard. Your data never leaves the query-response cycle — conexor.io doesn't store results.

Ready to try it? Create your free account and connect your first database in under five minutes.

Relay

Quick questions

Relay

Quick questions