mcp-dummy-server
Provides tools to query sample data (days of the week and postal codes) from a PostgreSQL database, including listing all records and searching by specific fields such as city or postal code.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-dummy-server
MCP server dengan data dari PostgreSQL, transport Streamable HTTP mode stateless — cocok untuk multi-instance/replica di Fly.io.
Struktur
src/
data/
db.js # koneksi pool PostgreSQL (pg)
hariRepository.js # query ke tabel `hari`
kodeposRepository.js # query ke tabel `kodepos`
apiKeysRepository.js # auth: bcrypt.compare ke tabel `api_keys`
tools/
index.js # definisi & registrasi semua MCP tools
server.js # express + StreamableHTTPServerTransport + auth middleware
db/
migrations/
001_create_tables.sql # schema: hari, kodepos, api_keys
seed.js # isi data awal (jalankan sekali setelah db:up)
docker-compose.yml # Postgres 16-alpine lokal, port 5435Pindah Provider DB (Dinamis): Cukup ganti nilai DATABASE_URL di .env (Docker Lokal ↔ Supabase ↔ Neon ↔ Fly Postgres) tanpa perlu mengubah kode sumber sama sekali.
Related MCP server: Homelab MCP starter
Tools yang tersedia
Tool | Input | Fungsi |
| - | Semua hari Senin-Minggu |
|
| Detail 1 hari |
| - | Semua data kodepos |
|
| Cari kodepos berdasarkan nama kota |
|
| Detail exact match kodepos |
Jalan lokal (dengan Postgres via Docker)
npm install
cp .env.example .env # isi MCP_API_KEY, sesuaikan DATABASE_URL dll.
# 1. Jalankan Postgres Docker (port 5435 — hindari conflict 5432/5433/5434)
npm run db:up
# 2. Seed: buat tabel + isi data awal + hash API key ke DB
npm run db:seed
# 3. Jalankan server
npm start
# server listen di http://localhost:8080/mcpTest cepat:
curl -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "x-api-key: $(grep MCP_API_KEY .env | cut -d= -f2)" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'Stop Postgres:
npm run db:downAuth
Server dilindungi API key berbasis database (tabel api_keys, key disimpan sebagai bcrypt hash — tidak pernah plaintext).
Kalau
DATABASE_URLtidak di-set → auth otomatis nonaktif (dev mode), muncul warning di log. Jangan biarkan di production.Kalau
DATABASE_URLdi-set → semua request ke/mcpwajib bawa headerx-api-keyyang cocok (diverifikasi via bcrypt.compare ke DB).last_used_atdi tabelapi_keysotomatis diupdate setiap kali key dipakai (fire-and-forget).
Jalankan lokal dengan auth aktif:
# Pastikan DATABASE_URL sudah di-.env dan db:seed sudah dijalankan
MCP_API_KEY=<your-key> npm startDeploy ke Fly.io
# install flyctl kalau belum: https://fly.io/docs/flyctl/install/
fly auth login
# dari folder project ini
fly launch --no-deploy # generate app, JANGAN overwrite fly.toml yang sudah ada
# WAJIB: set secrets (jangan taruh di fly.toml / git)
fly secrets set MCP_API_KEY="ganti-dengan-string-random-yang-panjang"
fly secrets set DATABASE_URL="postgresql://user:pass@host:5432/dbname"
fly deployCatatan: Untuk production, gunakan Postgres yang dihosting (mis. Fly Postgres, Supabase, Neon). Jalankan
npm run db:seedsekali saja terhadap DB production untuk inisialisasi tabel dan API key pertama.
Setelah deploy, endpoint MCP ada di:
https://<nama-app-kamu>.fly.dev/mcpKonek dari Antigravity IDE
{
"mcpServers": {
"dummy-data-mcp": {
"url": "https://<nama-app-kamu>.fly.dev/mcp",
"headers": {
"x-api-key": "ganti-dengan-string-random-yang-panjang"
}
}
}
}Kalau Antigravity IDE hanya mendukung MCP via stdio, pakai proxy mcp-remote:
{
"mcpServers": {
"dummy-data-mcp": {
"command": "npx",
"args": [
"-y", "mcp-remote", "https://<nama-app-kamu>.fly.dev/mcp",
"--header", "x-api-key:ganti-dengan-string-random-yang-panjang"
]
}
}
}Manajemen API Key
API key disimpan di tabel api_keys sebagai bcrypt hash. Untuk menambah key baru:
# Contoh: tambah key baru langsung ke DB
node -e "
import('bcrypt').then(async ({default: bcrypt}) => {
const hash = await bcrypt.hash('key-baru-kamu', 12);
console.log('INSERT INTO api_keys (key_hash, label) VALUES (\'' + hash + '\', \'nama-label\');');
});
"
# Salin output INSERT-nya, jalankan di psql atau DB clientCatatan keamanan
API key tidak pernah disimpan plaintext — hanya bcrypt hash di DB.
MCP_API_KEYdi.envhanya dipakai saatdb:seed(untuk generate hash pertama kali). Selebihnya tidak dipakai server.Untuk revoke key:
UPDATE api_keys SET is_active = false WHERE id = <id>;
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA minimal, containerized MCP server that exposes a Streamable HTTP transport with API key authentication, allowing secure access to MCP endpoints.-
- FlicenseNot gradedqualityDmaintenanceA minimal MCP server for homelab environments, providing demo tools like ping and echo over Streamable HTTP for testing client-server integration.-
- AlicenseNot gradedqualityDmaintenanceA simple MCP server providing weather lookup and number addition tools.ISC
- AlicenseNot gradedqualityBmaintenanceMCP server that provides tools to retrieve weather information from a weather API, supporting both local stdio and remote Streamable HTTP transports.547 npm1MIT