Pagila MCP MCP Server

$uv venv; .\.venv\Scripts\activate; uv pip install fastmcp "mcp[cli]" psycopg[binary] sqlparse
README.md

A read-only Model Context Protocol server for querying the Pagila database.

Pagila MCP (Read-Only)

Servidor MCP desarrollado con FastMCP para consultar la base de datos Pagila (PostgreSQL) de forma segura (solo lectura).

Requisitos

  • PostgreSQL 18 (o compatible)
  • Base de datos: pagila (cargada)
  • Python 3.x
  • uv recomendado

Instalación

uv venv
.\.venv\Scripts\activate
uv pip install fastmcp "mcp[cli]" psycopg[binary] sqlparse
v

#VARIABLES DE ENTORNO

$env:PG_HOST="localhost"
$env:PG_PORT="5432"
$env:PG_DB="pagila"
$env:PG_USER="postgres"
$env:PG_PASS="TU_PASSWORD"

# Modelo relacional (Pagila)

La base de datos Pagila contiene 15 tablas principales, entre ellas:
actor, address, category, city, country, customer, film, film_actor, film_category,
inventory, language, payment, rental, staff, store.

Relaciones principales:
- rental se relaciona con inventory mediante inventory_id.
- inventory se relaciona con film mediante film_id.
- payment se relaciona con rental mediante rental_id.
- film_actor es una tabla puente (muchos a muchos) entre film y actor.
- film_category es una tabla puente (muchos a muchos) entre film y category.
- customer se relaciona con rental mediante customer_id.

//Lyrken Calle V.//

Environment Variables

PG_HOSTrequiredPostgreSQL host address
PG_PORTrequiredPostgreSQL port number
PG_DBrequiredDatabase name (pagila)
PG_USERrequiredPostgreSQL username
PG_PASSrequiredPostgreSQL password

Configuration

claude_desktop_config.json
{"mcpServers":{"pagila":{"command":"uv","args":["run","pagila_mcp"],"env":{"PG_HOST":"localhost","PG_PORT":"5432","PG_DB":"pagila","PG_USER":"postgres","PG_PASS":"YOUR_PASSWORD"}}}}

Try it

List all the actors available in the Pagila database.
Find all films associated with the 'Action' category.
Show me the rental history for a specific customer.
Which movies are currently in the inventory?
Get a list of payments made by customers in the last month.

Frequently Asked Questions

What are the key features of Pagila MCP?

Read-only access to PostgreSQL databases for secure querying.. Built with FastMCP for high-performance model context protocol integration.. Supports complex relational queries across 15 main tables including films, actors, and rentals.. Compatible with PostgreSQL 18 and standard Pagila schema..

What can I use Pagila MCP for?

Analyzing movie rental trends and customer behavior using natural language.. Quickly retrieving actor and film metadata without writing manual SQL.. Educational tool for exploring relational database structures via AI.. Generating reports on inventory and payment history through Claude..

How do I install Pagila MCP?

Install Pagila MCP by running: uv venv; .\.venv\Scripts\activate; uv pip install fastmcp "mcp[cli]" psycopg[binary] sqlparse

What MCP clients work with Pagila MCP?

Pagila MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Use Pagila MCP with Conare

Manage MCP servers visually, upload persistent context, and never start from zero with Claude Code & Codex.

Try Free