> Markdown version of [/events/world-congress-2026-europe-virtual-stage/sessions/1586-plan-to-link-your](https://www.wearedevelopers.com/events/world-congress-2026-europe-virtual-stage/sessions/1586-plan-to-link-your). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Plan to link your LLM to your production database? What could possibly go wrong? - **Event:** World Congress 2026 Europe - Virtual Stage ## Recording [Watch recording](https://www.wearedevelopers.com/videos/2088-plan-to-link-your-llm-to-your-production-database-what-could-possibly-go-wrong) ## Description TL;DR: LLMs are a powerful way to interact with databases, but can cause security risks. We link a LLM to a database via a MCP server and then build a table reservation assistant. LLMs are a powerful way to interact with databases, but cause all sorts of security risks. Users can trick the LLM to read out data that shouldn't be read or even worse trick the LLM to perform SQL insertion attacks that delete huge swaths of data. Not only does the risk come from the user, but anything the LLM reads from the database could contain a prompt injection attack. Clearly in such a threat environment, we need to ensure the database access is closely regulated. Model Context Protocol (MCP) servers fill the need for cases like this, acting as a bridge and a gatekeeper, allowing the AI to access external tools such as databases while standardizing communication through a unified protocol. With an MCP server in place users can interact with the database in natural language, not with SELECT … FROM … like statements but through clearly defined whitelisted tools that ensure compliant database access. In this way, AI assistants are able to interact with the database, discovering interaction patterns, reading data and writing new entries. In this hands-on tutorial, we will go through the process of setting up an MCP server for a Postgres database and demonstrate how to use the MCP server. Next, we'll link the LLM with a simple streamlit webapp and show how it can be used by end users to quickly search and update the datbase. All material to recreate what I'm demonstrating can be found here: <https://gitlab.com/cseward/psql-mcp> ## Speaker ### [Calvin Seward](https://www.wearedevelopers.com/@calvin-seward) Senior Data Scientist @ HMS analytical software ## Related talks at this congress - [Command and Conquer: How we let an LLM control our Software](https://www.wearedevelopers.com/events/world-congress-2026-europe-virtual-stage/sessions/1515-command-and-conquer) — Simon A.T. Jiménez - [Why LLMs Need Observability and How to Do It](https://www.wearedevelopers.com/events/world-congress-2026-europe-virtual-stage/sessions/1645-why-llms-need) — Rahul Gupta - [Security in Model Context Protocol: An Analysis of the OWASP MCP Top 10](https://www.wearedevelopers.com/events/world-congress-2026-europe-virtual-stage/sessions/1596-security-in-model) — Jose Manuel Ortega - [Bridging AI and Nomad: a Go-based MCP Server for Cluster Control](https://www.wearedevelopers.com/events/world-congress-2026-europe-virtual-stage/sessions/1503-bridging-ai-and) — Erik Koci