mcp-server-demo
Allows interaction with a PostgreSQL database, providing tools for listing cases, retrieving case details, and adding notes to cases.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-demoshow me the list of cases"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server Demo — Node/Express + PostgreSQL + Model Context Protocol
A minimal, production-pattern example of an MCP server that exposes database-backed tools to an AI client, secured with an OAuth-style bearer flow. Built to demonstrate the architecture I use in real systems, with demo data only — no real records, keys, or credentials.
Author: Robert Mack · Full-stack / AI-automation engineer · Remote, contract/fractional
What this demonstrates
MCP server exposing typed tools an AI model can call (
list_cases,get_case,add_note)PostgreSQL as the backing store, with a clean data-access layer (no SQL in the route handlers)
OAuth 2.0–style bearer-token auth on the protected endpoints (PKCE-ready pattern)
Express REST API with input validation and structured error handling
Docker / docker-compose for one-command local spin-up (API + database)
Separation of concerns: routes → service layer → db layer
This is the same shape as the production systems I build — an operations platform with an AI control layer that can act on live data safely, because every tool call is authenticated, validated, and scoped.
Related MCP server: MCP Server
Architecture
AI client ──(MCP / bearer token)──> Express API ──> service layer ──> PostgreSQL
│
└── tool registry: list_cases, get_case, add_notesrc/server.js— Express app, auth middleware, MCP endpoint wiringsrc/mcp.js— tool registry: each tool's schema + handlersrc/db.js— PostgreSQL access layer (parameterized queries only)src/auth.js— bearer-token validation (OAuth2/PKCE-ready)schema.sql— demo table + seed datadocker-compose.yml— API + Postgres, one command
Run it locally
# 1. Start Postgres + API together
docker compose up --build
# 2. The API is now on http://localhost:3000
# A demo bearer token is printed on startup (demo only — never hardcode real tokens)
# 3. List the MCP tools
curl -H "Authorization: Bearer demo-token-123" http://localhost:3000/mcp/tools
# 4. Call a tool
curl -X POST http://localhost:3000/mcp/call \
-H "Authorization: Bearer demo-token-123" \
-H "Content-Type: application/json" \
-d '{"tool":"list_cases","args":{}}'Notes on production use
In a real deployment the bearer token is issued via a full OAuth 2.0 + PKCE flow (not the static demo token here), the database runs as a managed/containerized service with secrets injected at runtime (never committed), and the server runs behind TLS. This repo keeps those pieces deliberately simple so the patterns are readable in one sitting.
License
MIT — demo/educational use.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseBqualityDmaintenanceA Node.js-based MCP server that enables AI agents to generate embeddings, index documents, and perform semantic vector searches using OpenAI and Chroma. It facilitates the creation of retrieval-augmented generation (RAG) pipelines for internal knowledge assistants and document-based workflows.Last updated3
- Alicense-qualityDmaintenanceNode.js MCP server for ChatGPT with OAuth 2.0 authorization code flow + PKCE, refresh token rotation, and Supabase-backed persistence. Includes sample tools like calculator, get_weather, and search_web.Last updated312MIT
- Alicense-qualityCmaintenanceA production-ready MCP server that connects AI assistants to any PostgreSQL database with 25 tools and role-based access control.Last updated24MIT
- AlicenseAqualityDmaintenanceA production-grade MCP server that gives AI agents safe, authenticated access to a PostgreSQL database.Last updated3MIT
Related MCP Connectors
MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2
MCP server for managing Prisma Postgres.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/therobertmack/mcp-server-demo'
If you have feedback or need assistance with the MCP directory API, please join our Discord server