Skip navigation

An MCP for your Postgres DB

Pamela Fox

Pamela Fox Pamela Fox

(Livestream 1)

Model Context Protocol (MCP) is an open standard that lets us connect LLMs to external systems through explicit, discoverable tools. When we build MCP servers that expose a PostgreSQL database, our design choices directly influence how accurately, efficiently, and predictably LLMs translate user input into queries.

In this talk, we’ll design MCP servers for PostgreSQL using Python and the FastMCP SDK, focusing on how different tool designs shape query behavior. We’ll examine common failure modes that arise when LLMs interact with databases—such as SQL injection, accidental DELETE or UPDATE operations, unbounded or expensive queries, and mismatches between user intent and executed SQL—and how various approaches either mitigate or amplify these issues.

We’ll compare multiple styles of MCP tool arguments, from free‑form SQL to structured, typed inputs. We’ll explore how MCP elicitation can improve tool success by allowing users to clarify intent in ambiguous or risky scenarios. Finally, we’ll also explore the tool selection problem: how to design MCP servers that expose multiple tables or databases in a way that helps LLMs reliably choose the right tool for the right job.

talk bubbles
Join the conversation

Use the hashtag #PosetteConf