プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。レビューとアカウント機能は今後のステップで始まります。
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説

MCP Database Server

作者:Souhar-dyaバージョン 1.3.1i★ –iパソコンで動く
レジストリ名io.github.Souhar-dya/mcp-db-server

インストール

概要

作者による説明(英語の原文)

MCP server for SQLite, PostgreSQL, and MySQL with natural language to SQL and direct SQL tooling.

PopNx MCPの3つの柱

この3つを1つのスコアにまとめることはしません。意見、測定、人気はそれぞれ別のものだからです。

できること

このサーバーのやさしい解説はまだ書いていません。以下はレジストリから読み取った事実です。

  • 接続方法: パソコンで動く
  • トランスポート: stdio
  • カテゴリ: データベース・データセット

インストール

使っているAIアプリを選んで、設定をコピーしてください。

インストールの前に

必要なもの

  • DockerDockerのインストール

どのアプリを使っていますか?

上でアプリを選んでください。選んだアプリを覚えておくので、次からはボタンに「…にインストール」と表示されます。

Claude Desktop → Settings → Developer → Edit Config を開き、claude_desktop_config.json にこれを貼り付けます

{
  "mcpServers": {
    "db": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URL",
        "docker.io/souhardyak/mcp-db-server:1.3.1"
      ],
      "env": {
        "DATABASE_URL": "your-value"
      }
    }
  }
}

ターミナルでこれを実行します

claude mcp add db --env DATABASE_URL=your-value -- docker run -i --rm -e DATABASE_URL docker.io/souhardyak/mcp-db-server:1.3.1

動かす前に、空欄の値を入力してください。

Cursorで開く

または、設定を自分でコピーする

プロジェクトの .cursor/mcp.json、または ~/.cursor/mcp.json に貼り付けます

{
  "mcpServers": {
    "db": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URL",
        "docker.io/souhardyak/mcp-db-server:1.3.1"
      ],
      "env": {
        "DATABASE_URL": "your-value"
      }
    }
  }
}

ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。

VS Codeで開く

または、設定を自分でコピーする

プロジェクトの .vscode/mcp.json に貼り付けます

{
  "servers": {
    "db": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URL",
        "docker.io/souhardyak/mcp-db-server:1.3.1"
      ],
      "env": {
        "DATABASE_URL": "your-value"
      }
    }
  }
}

ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。

これはパソコンで動くサーバーですが、ChatGPTがつなげるのはインターネット上のサーバーだけです。ほかのアプリを選んでください。

選んだアプリは、この端末のCookieに保存されます。アカウントは不要です。

自分で入力する値

  • DATABASE_URL env
    Database connection URL. Defaults to local SQLite in /data/default.db.

この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。

できること

パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。

基本チェックi

誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月7日にチェック

  • ✓ 合格

    作者とリポジトリが一致

    レジストリ名は、リポジトリを所有するGitHubアカウント Souhar-dya で確認済みです

  • … 未チェック

    今もメンテナンスされている

    このリポジトリはまだGitHubから読み取っていません

  • … 未チェック

    ライセンスがある

    このリポジトリはまだGitHubから読み取っていません

  • – 対象外

    エンドポイントが応答する

    これはパソコンで動くため、インターネット上のエンドポイントはありません

  • – 対象外

    OAuthでサインイン

    パソコンで動き、代わりにローカルの設定を使います

  • … 未チェック

    ツールの説明に隠れた指示がない

    パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです

データベース・データセットのほかのサーバーとの比較i

  • このカテゴリのほかの957件のうち0%よりスターが多い
  • このカテゴリのほかの957件のうち9%より最近レジストリに公開
  • 基本チェックの結果が、このカテゴリのほかの957件のうち100%と同じかそれ以上

レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。

よくある質問

MCP Database Serverは安全ですか?

当てはまる基本チェック1項目のうち1項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。

どんなキーやコードが必要ですか?

レジストリには必須のキーは載っていません。ただし、最初に使うときにサインインを求めるサーバーもあります。

パソコンで動きますか、それともクラウドですか?

あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。

今もメンテナンスされていますか?

GitHubリポジトリの最終更新は–、最新バージョン(1.3.1)がレジストリに届いたのは7 か月前です。

どのアプリで使えますか?

Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにDockerも必要です。

代わりに使えるものは?

同じカテゴリには:Supabase, MongoDB MCP Server, Elasticsearch MCP Server

代わりの候補

同じカテゴリで、ほかの作者が作ったサーバー。スターの多い順。

カードの見方:★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i

Supabase

作者:supabase

MCP server for interacting with the Supabase platform

パソコンでもクラウドでも★ 2,993Apache-2.0昨日更新
インストール

作者のREADME

READMEを開く

作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。

mcp-db-server

An MCP (Model Context Protocol) server that exposes relational databases (PostgreSQL/MySQL) to AI agents with natural language query support. Transform natural language questions into SQL queries and get structured results.

Features

  • Multi-Database Support: Works with PostgreSQL and MySQL
  • Natural Language to SQL: Convert plain English queries to SQL using HuggingFace transformers
  • RESTful API: Clean FastAPI-based endpoints for database operations
  • Safety First: Read-only operations with query validation and result limits
  • Docker Ready: Complete containerization with Docker Compose
  • Production Ready: Health checks, logging, and error handling
  • AI Agent Friendly: Designed specifically for AI agent integration

Version 1.4.0 Changes

  • Added mandatory X-API-Key authentication for all database HTTP endpoints; /health remains public for health checks.
  • Removed unrestricted credentialed CORS and made allowed origins explicitly configurable.
  • Changed the default HTTP bind address to 127.0.0.1.
  • Added table-name validation against existing database tables to block SQL injection through table routes.
  • Added PostgreSQL sslmode=require compatibility for asyncpg connections.
  • Updated Docker Compose, environment examples, and documentation for secure API-key configuration.
  • Published Docker images:
  • souhardyak/mcp-db-server:1.4.0
  • souhardyak/mcp-db-server:latest
  • Added GitHub Container Registry publishing for:
  • ghcr.io/souhar-dya/mcp-db-server:1.4.0
  • ghcr.io/souhar-dya/mcp-db-server:latest

API Endpoints

EndpointMethodDescription
/healthGETHealth check and service status
/mcp/list_tablesGETList all available tables with column counts
/mcp/describe/{table_name}GETGet detailed schema for a specific table
/mcp/queryPOSTExecute natural language queries
/mcp/tables/{table_name}/sampleGETGet sample data from a table

Quick Start

Option 1: Docker Compose (Recommended)
  1. Clone and start the services:
   git clone https://github.com/Souhar-dya/mcp-db-server.git

cd mcp-db-server export MCP_API_KEY="$(openssl rand -hex 32)" docker-compose up --build

  1. Test the endpoints:
   # Health check

curl http://localhost:8000/health

List tables (requires the configured API key)

curl -H "X-API-Key: $MCP_API_KEY" http://localhost:8000/mcp/list_tables

Describe a table

curl -H "X-API-Key: $MCP_API_KEY" http://localhost:8000/mcp/describe/customers

Natural language query

curl -X POST "http://localhost:8000/mcp/query" \ -H "X-API-Key: $MCP_API_KEY" \ -H "Content-Type: application/json" \ -d '{"nl_query": "show top 5 customers by total orders"}'

Option 2: Local Development
  1. Prerequisites:
  • Python 3.11+
  • PostgreSQL or MySQL database
  1. Install dependencies:
   pip install -r requirements.txt
  1. Set environment variables:
   export DATABASE_URL="postgresql+asyncpg://user:password@localhost:5432/dbname"

export MCP_API_KEY="$(openssl rand -hex 32)"

or for MySQL:

export DATABASE_URL="mysql+pymysql://user:password@localhost:3306/dbname"

  1. Run the server:
   python -m app.server

Sample Database

The project includes a sample database with realistic e-commerce data:

  • customers: Customer information (10 sample customers)
  • orders: Order records (17 sample orders)
  • order_items: Individual items within orders
  • order_summary: View combining order and customer data

Natural Language Query Examples

The server can understand various types of natural language queries:

# Get all customers

curl -X POST "http://localhost:8000/mcp/query" \ -H "Content-Type: application/json" \ -d '{"nl_query": "show all customers"}'

Count orders by status

curl -X POST "http://localhost:8000/mcp/query" \ -H "Content-Type: application/json" \ -d '{"nl_query": "count orders by status"}'

Top customers by order value

curl -X POST "http://localhost:8000/mcp/query" \ -H "Content-Type: application/json" \ -d '{"nl_query": "top 5 customers by total order amount"}'

Recent orders

curl -X POST "http://localhost:8000/mcp/query" \ -H "Content-Type: application/json" \ -d '{"nl_query": "show recent orders from last week"}'

Configuration

Environment Variables
VariableDescriptionDefault
DATABASE_URLFull database connection URLpostgresql+asyncpg://postgres:postgres@localhost:5432/postgres
DB_HOSTDatabase hostlocalhost
DB_PORTDatabase port5432
DB_USERDatabase usernamepostgres
DB_PASSWORDDatabase passwordpostgres
DB_NAMEDatabase namepostgres
HOSTServer host127.0.0.1
PORTServer port8000
MCP_API_KEYRequired API key for database HTTP routesNot set (API disabled)
CORS_ALLOW_ORIGINSComma-separated allowed browser originsEmpty (disabled)
Database Connection Examples
# PostgreSQL

DATABASE_URL=postgresql+asyncpg://user:pass@localhost:5432/mydb

MySQL

DATABASE_URL=mysql+pymysql://user:pass@localhost:3306/mydb

PostgreSQL with SSL

DATABASE_URL=postgresql+asyncpg://user:pass@localhost:5432/mydb?sslmode=require

Database Connection Examples
# PostgreSQL (local or cloud)

DATABASE_URL=postgresql+asyncpg://user:password@host:5432/dbname

MySQL (local or cloud)

DATABASE_URL=mysql+aiomysql://user:password@host:3306/dbname

PostgreSQL with SSL (cloud, e.g. Neon, Supabase, Aiven)

DATABASE_URL=postgresql+asyncpg://user:password@host:5432/dbname?sslmode=require

MySQL with SSL (cloud, e.g. Aiven, PlanetScale)

DATABASE_URL=mysql+aiomysql://user:password@host:3306/dbname?ssl-mode=REQUIRED

Note:

- For MySQL cloud providers, the ssl-mode parameter in the URL is ignored by the driver, but SSL is always enabled in the MCP server for cloud connections.

- For PostgreSQL, use sslmode=require for cloud DBs. For MySQL, just use the standard URL; SSL is handled automatically.

- If you see errors about ssl-mode or sslmode, check your URL and ensure you are using the correct driver prefix (mysql+aiomysql or postgresql+asyncpg).

Cloud Database Examples
# Neon (PostgreSQL)

DATABASE_URL=postgresql+asyncpg://username:password@ep-xxxxxx-pooler.us-east-2.aws.neon.tech/dbname

Aiven (MySQL)

DATABASE_URL=mysql+aiomysql://avnadmin:yourpassword@mysql-xxxxxx-username-xxxx.aivencloud.com:11079/defaultdb?ssl-mode=REQUIRED

Docker Usage with Cloud DB
docker run -d \

-p 8000:8000 \ -e DATABASE_URL=" " \ -e MCP_API_KEY=" " \ souhardyak/mcp-db-server:latest

GitHub Container Registry is also available:

docker login ghcr.io

docker pull ghcr.io/souhar-dya/mcp-db-server:latest docker run -d \ -p 8000:8000 \ -e DATABASE_URL=" " \ -e MCP_API_KEY="$MCP_API_KEY" \ ghcr.io/souhar-dya/mcp-db-server:latest

Images are published automatically when a v*.*.* tag is pushed. The workflow also creates the matching GitHub Release. To publish an existing tag such as v1.4.0, open the workflow's Run workflow action and enter 1.4.0. Set the GHCR package visibility to Public in the repository's Packages settings if unauthenticated pulls should be allowed.

Troubleshooting
  • If you get connect() got an unexpected keyword argument 'ssl-mode', ignore it: SSL is still enabled.
  • For network errors, check firewall and DB credentials.
  • For MySQL, always use mysql+aiomysql in the URL for async support.
PostgreSQL SSL connection note

For PostgreSQL cloud providers, use an asyncpg URL and sslmode=require:

DATABASE_URL=postgresql+asyncpg://user:password@host:5432/dbname?sslmode=require

The server normalizes sslmode=require to the ssl option expected by asyncpg. A temporary PostgreSQL verification was completed successfully against a compatible cloud database using CREATE, INSERT, SELECT, UPDATE, DELETE, and DROP; no test data was retained. Never commit or share a connection URL containing a real password.

API key authentication

MCP_API_KEY is a secret that you generate and provide to the server. It protects all database HTTP endpoints through the X-API-Key request header. The /health endpoint remains public for container health checks.

Generate a strong key on Linux or macOS:

export MCP_API_KEY="$(openssl rand -hex 32)"

Generate one in Windows PowerShell:

$bytes = New-Object byte[] 32

$env:MCP_API_KEY = ([BitConverter]::ToString($bytes) -replace "-", "").ToLower()

Start the Docker image with the key:

docker run -d \

-p 8000:8000 \ -e DATABASE_URL=" " \ -e MCP_API_KEY="$MCP_API_KEY" \ souhardyak/mcp-db-server:latest

Call a protected endpoint with the same key:

curl -H "X-API-Key: $MCP_API_KEY" http://localhost:8000/mcp/list_tables

Keep the key in a password manager or deployment secret store. Do not commit it to Git, put it in a public image, or include it in logs.

Security Features

  • Mandatory HTTP Authentication: Database API routes require X-API-Key; /health remains public for health checks
  • Secure Network Default: HTTP mode binds to 127.0.0.1 unless explicitly configured otherwise
  • Restricted CORS: Cross-origin access is disabled unless origins are explicitly configured
  • Read-Only Operations: Only SELECT queries are allowed
  • Query Validation: Automatic detection and blocking of dangerous SQL operations
  • Result Limiting: Maximum 50 rows per query (configurable)
  • Input Sanitization: Protection against SQL injection
  • Safe Defaults: Secure configuration out of the box

Architecture

mcp-db-server/

├── app/ │ ├── init.py # Package initialization │ ├── server.py # FastAPI application and endpoints │ ├── db.py # Database connection and operations │ └── nl_to_sql.py # Natural language to SQL conversion ├── .github/workflows/ │ └── docker-publish.yml # CI/CD pipeline ├── docker-compose.yml # Docker Compose configuration ├── Dockerfile # Container definition

冒頭だけを表示しています。続きはリポジトリで読めます

PopNxに聞く