Database Lookup Protocol MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "DATABASE_URL=${DATABASE_URL}" database-lookup-protocol -- npx -y database-lookup-protocol
Required:DATABASE_URL
README.md

DLP lets your AI coding assistant read your database

Database Lookup Protocol (DLP)

DLP lets your AI coding assistant read your database — so it writes better code, faster.

Ever had your AI assistant guess what your database looks like, only to generate wrong column names or miss relationships? DLP solves that. It gives tools like Claude Code, Cursor, VS Code Copilot, and antigravity (Gemini) read-only access to your database schema and data — no debug code needed, no copy-pasting table structures into chat.

🌐 dlp-mcp.vercel.app — Give Your AI Database Eyes


What does DLP do?

Think of DLP as a bridge between your AI assistant and your database. Once set up:

  • Your AI can see your tables, columns, and relationships automatically
  • It can preview actual data to understand what's stored
  • It can run safe read-only queries to answer questions about your data
  • All of this happens without you writing any code or pasting schema dumps

Example: Instead of telling your AI "I have a users table with id, name, email columns...", it can just look at the database itself.


How it works

DLP uses the Model Context Protocol (MCP) — an open standard that lets AI assistants use external tools. When you set up DLP:

  1. Your IDE spawns DLP as a background process
  2. DLP connects to your database using the DATABASE_URL from your project
  3. Your AI assistant gets four new tools to inspect the database
  4. Everything runs locally on your machine — your data never leaves
Your AI Assistant  <-->  DLP (MCP Server)  <-->  Your Database
   (Claude, etc.)         (runs locally)        (Postgres, MySQL, etc.)

Installation

npm install database-lookup-protocol

Or use it directly without installing (via npx):

npx database-lookup-protocol set cursor

Quick Start

Setting up DLP takes two steps and under a minute.

Prerequisites

  • Node.js v18 or higher installed
  • A database you want to connect to (PostgreSQL, MySQL, MongoDB, SQL Server, or Prisma)
  • An IDE that supports MCP (Claude Code, Cursor, VS Code, or antigravity)

Step 1: Add your database connection to `.env`

Make sure your project has a .env file with your database connection. If you already have one (most projects do), you're good — skip to Step 2.

Option A: Single connection string (most common)

DATABASE_URL=postgresql://user:password@localhost:5432/mydb

Option B: Individual variables (if your project uses separate host/user/password vars)

# PostgreSQL
PG_HOST=localhost
PG_PORT=5432
PG_DATABASE=mydb
PG_USER=admin
PG_PASSWORD=secret

# MySQL
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_DATABASE=mydb
MYSQL_USER=admin
MYSQL_PASSWORD=secret

# MongoDB
MONGODB_URI=mongodb://localhost:27017/mydb

# SQL Server
MSSQL_HOST=localhost
MSSQL_PORT=1433
MSSQL_DATABASE=mydb
MSSQL_USER=admin
MSSQL_PASSWORD=secret

DLP automatically detects whichever format you use — DATABASE_URL or individual variables.

Not sure what your DATABASE_URL looks like? See the Connection String Formats section below for examples for each database.

Step 2: Connect DLP to your IDE

Open a terminal inside your project folder (where your .env file is) and run:

# For antigravity (Gemini)
npx dlp set antigravity

# For Cursor
npx dlp set cursor

# For VS Code
npx dlp set vscode

# For Claude Code
npx dlp set claude

# For all IDEs at once
npx dlp set all

That's it! Restart your IDE and DLP is ready to use.

What just happened? The dlp set command read your database connection variables from your project's .env file (either DATABASE_URL or individual vars like PG_HOST, MYSQL_HOST, etc.) and wrote the MCP configuration to your IDE's global config directory. Your AI assistant will now see DLP as an available tool.


Using DLP in your AI assistant

Once set up, your AI assistant automatically has access to four database tools. You don't need to do anything special — just ask questions about your database naturally:

  • "What tables are in my database?"
  • "Show me some sample data from the users table"
  • "What columns does the orders table have?"
  • "Find all users who signed up in the last week"

Your AI will use DLP tools behind the scenes to answer these questions.

Available tools

Tool What it does Example use
dlp_get_schema Shows all

Tools (1)

dlp_get_schemaRetrieves the database schema including tables, columns, and relationships.

Environment Variables

DATABASE_URLrequiredConnection string for PostgreSQL, MySQL, MongoDB, or SQL Server

Configuration

claude_desktop_config.json
{"mcpServers": {"dlp": {"command": "npx", "args": ["-y", "database-lookup-protocol"]}}}

Try it

What tables are in my database?
Show me some sample data from the users table
What columns does the orders table have?
Find all users who signed up in the last week

Frequently Asked Questions

What are the key features of Database Lookup Protocol?

Automatic inspection of database tables, columns, and relationships. Read-only data preview capabilities. Safe execution of read-only queries. Support for PostgreSQL, MySQL, MongoDB, and SQL Server. Local execution ensuring data privacy.

What can I use Database Lookup Protocol for?

Helping AI coding assistants generate accurate SQL queries by providing real schema context. Debugging database-related code without manually pasting schema dumps. Quickly exploring database contents during development without external GUI tools. Validating data structures for AI-generated database migrations.

How do I install Database Lookup Protocol?

Install Database Lookup Protocol by running: npx database-lookup-protocol set all

What MCP clients work with Database Lookup Protocol?

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

Turn this server into reusable context

Keep Database Lookup Protocol docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare