MCP Server Setup

Step-by-step guide to connect the Person CRUD MCP server to Claude Desktop, enabling AI-powered database operations through natural language.

What is MCP?

Model Context Protocol (MCP) is an open standard that allows AI models like Claude to connect to external tools and data sources. This MCP server exposes Person CRUD operations as tools that Claude Desktop can call directly.

Once configured, you can ask Claude things like "List all persons", "Create a person named John Doe", or "Delete person with ID 1" and Claude will execute the database operations automatically.

Available MCP Tools

list_personsREAD

Get all persons from the database

get_personREAD

Get a single person by ID

create_personCREATE

Create a new person record

update_personUPDATE

Update an existing person by ID

delete_personDELETE

Delete a person record by ID

search_personsREAD

Search persons by name or email

Setup Steps

01

Install Claude Desktop

Download and install Claude Desktop from the official Anthropic website.

https://claude.ai/download
02

Clone the MCP Server Repository

Clone the Person CRUD MCP server to your local machine.

git clone https://github.com/Pearlshaline/person_mcp_server.git
cd person_mcp_server
npm install
03

Configure Environment Variables

Create a .env file in the MCP server folder with your database connection.

DATABASE_URL=postgresql://neondb_owner:YOUR_PASSWORD@ep-your-project-pooler.c-6.us-east-1.aws.neon.tech/neondb?sslmode=require&channel_binding=require
DIRECT_URL=postgresql://neondb_owner:YOUR_PASSWORD@ep-your-project.c-6.us-east-1.aws.neon.tech/neondb?sslmode=require&channel_binding=require
04

Build the MCP Server

Compile the TypeScript MCP server to JavaScript.

npm run build
05

Configure Claude Desktop

Open your Claude Desktop config file and add the MCP server. Config location:

Windows: %APPDATA%\Claude\claude_desktop_config.json

Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "person-crud": {
      "command": "node",
      "args": ["C:/path/to/person-mcp-server/dist/index.js"],
      "env": {
        "DATABASE_URL": "your-pooled-connection-string",
        "DIRECT_URL": "your-direct-connection-string"
      }
    }
  }
}
06

Restart Claude Desktop

Fully quit and reopen Claude Desktop. You should see the MCP tools available.

# Look for the hammer icon in Claude Desktop
# This confirms MCP tools are loaded

Verify It Works

After restarting Claude Desktop, test the MCP connection by typing these prompts:

1List all persons in the database
2Create a new person named John Doe with the email john.doe@email.com, age 25, phone number +63 946 882 2314, and address Ilagan City, Isabela
3Get person with ID 2
4Update person 2's age to 36
5Search for persons named Ana Reyes
6Delete person with ID 1

Troubleshooting

MCP tools not showing in Claude Desktop

Make sure you fully quit (not just close) and reopen Claude Desktop after editing the config file.

Database connection error

Double-check your DATABASE_URL and DIRECT_URL in the MCP server .env file. Make sure the Neon database is active.

Command not found: node

Install Node.js from nodejs.org. Make sure the path in claude_desktop_config.json points to the built dist/index.js file.

Config file not found

Create the file manually at the path shown above. Make sure the JSON is valid with no trailing commas.