Skip to main content
Glama
prashil1996

bank-postgres-mcp

by prashil1996

bank-postgres-mcp

HTTP MCP 服务器,用于读写 PostgreSQL 数据库(bankdb)。 已部署并可访问:https://armored-backspace-angles.ngrok-free.dev/mcp

端点

路径

方法

用途

/mcp

POST

MCP 可流式 HTTP 端点

/health

GET

存活检查

Related MCP server: db-mcp

工具

读取工具(直接查询 bankdb)

工具

描述

list_customers

列出数据库中的所有客户

get_customer_by_id

根据 customer_id 获取客户资料 + 所有账户

get_customer_by_account

根据账号(例如 DB5194542004)查找客户及账户

get_transactions

根据 account_id 或 account_number 获取近期交易记录

写入工具(更新插入到 MCP 转储表)

工具

操作

dump_customer_data

将获取的客户记录更新插入到 customers 表

dump_created_customer

将新创建的客户插入到 customers 表

dump_bank_branch

将银行分行记录更新插入到 bank_branches 表

表在首次使用时自动创建。


设置

1. 前提条件

  • Node.js ≥ 18

  • 本地运行 PostgreSQL

2. 安装与构建

cd bank-postgres-mcp
npm install
npm run build

3. 配置环境

cp env.example .env
# .env is gitignored — edit credentials there

提供的凭据:

DATABASE_URL=postgresql://bankuser:bankpassword@localhost:5432/bankdb
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=bankdb
POSTGRES_USER=bankuser
POSTGRES_PASSWORD=bankpassword

4. 启动服务器

# Export env vars, then start
export DATABASE_URL=postgresql://bankuser:bankpassword@localhost:5432/bankdb
node build/index.js

# Or with all vars:
export POSTGRES_HOST=localhost POSTGRES_PORT=5432 POSTGRES_DB=bankdb \
       POSTGRES_USER=bankuser POSTGRES_PASSWORD=bankpassword
node build/index.js

服务器默认在 http://localhost:3100 上启动。可通过 PORT=XXXX 覆盖。

5. 验证

curl http://localhost:3100/health
# → {"status":"ok","server":"bank-postgres-mcp","version":"1.0.0"}

在 watsonx Orchestrate 中注册

在 Orchestrate 中,添加一个新的 MCP 服务器 工具集成:

字段

值

传输方式

可流式 HTTP

URL

http://localhost:3100/mcp

如果 Orchestrate 运行在远程(非你的笔记本电脑),请使用隧道暴露服务器:

npx localtunnel --port 3100
# Use the returned https URL instead of localhost

在 Bob 中注册(.bob/mcp.json)

{
  "mcpServers": {
    "bank-postgres-mcp": {
      "url": "http://localhost:3100/mcp"
    }
  }
}

数据库模式

customers

列名

类型

说明

customer_id

TEXT PK

full_name

TEXT

date_of_birth

TEXT

phone

TEXT

email

TEXT

pan

TEXT

个人身份信息

aadhaar

TEXT

个人身份信息

account_number

TEXT

个人身份信息

ifsc

TEXT

address_*

TEXT

line1, line2, city, state, postal_code, country

account_type

TEXT

kyc_status

TEXT

available_balance

NUMERIC

credit_score

INT

nominee

TEXT

source

TEXT

fetch 或 create

inserted_at

TIMESTAMPTZ

自动

updated_at

TIMESTAMPTZ

自动

bank_branches

列名

类型

说明

ifsc

TEXT PK

branch_name

TEXT

bank_name

TEXT

city

TEXT

state

TEXT

services

TEXT[]

inserted_at

TIMESTAMPTZ

自动

updated_at

TIMESTAMPTZ

自动

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A minimal banking system MCP server that allows account management, deposits, withdrawals, balance inquiries, and transaction history via REST endpoints.
    -
  • A
    license
    A
    quality
    D
    maintenance
    A lightweight MCP server for relational databases, enabling dynamic connections to PostgreSQL and MySQL, SQL execution, and transaction control.
    7
    52 npm
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Full-featured MCP server that exposes 36 tools for interacting with PostgreSQL databases, covering schema introspection, query execution, data exploration, performance monitoring, security auditing, and maintenance.
    36
    8 npm
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server for PostgreSQL that enables Cursor and other MCP clients to execute SQL queries, list tables, and explore database schemas via HTTP.
    1,293 npm
    MIT