Skip to main content
Glama
intern-analytics

Brand MCP Server

GBL용 MCP

브랜드별 Postgres 데이터베이스에 액세스하기 위한 안전한 멀티 테넌트 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 서버는 로컬 실행과 HTTP/SSE를 통한 인증된 원격 액세스를 모두 지원합니다.

🔐 인증 및 보안

이 서버는 Bearer 토큰 인증을 사용합니다. /sse/messages 엔드포인트에 액세스하려면 gbl- 접두사가 붙은 유효한 API 키가 필요합니다.

키 관리 CLI

내장된 인증 모듈을 사용하여 로컬 또는 EC2에서 키를 관리하세요:

# Activate your environment first
source .venv/bin/activate  # Linux/EC2
.\.venv\Scripts\activate   # Windows

### 6. Manage Multi-Tenant API Keys (Admin API)
To provision unique database tenants to separate keys, we host an internal Admin REST API.
This API handles secrets, so it should **only** be accessed from localhost on your EC2 instance (binds to `:8001`).

### Option A: Use it securely locally via SSH Tunneling (Recommended)
You can build a secure tunnel from your Windows PC directly to your EC2 instance so you can interact with the Admin API from your own local browser (like Swagger UI) or local terminal smoothly:
```powershell
# Run this on your local Windows PC
ssh -i "path/to/your/key.pem" -L 8001:127.0.0.1:8001 ubuntu@YOUR_EC2_IP

이제 로컬 머신에서 바로 API와 상호 작용하거나 Swagger UI를 확인할 수 있습니다: http://127.0.0.1:8001/docs

옵션 B: EC2에서 직접 사용

EC2에서 관리자 API를 시작하려면:

python3 -m src.admin_api

관리자 API가 실행 중이면 다른 EC2 터미널 창에서 새 브랜드 테넌트 키를 생성할 수 있습니다:

curl -X POST http://127.0.0.1:8001/keys/generate \
     -H "Content-Type: application/json" \
     -d '{"db_user": "brand_a_user", "db_pass": "supersecret"}'

(응답에는 brand_a_user에 할당된 api_key가 포함됩니다.)

기타 유틸리티 엔드포인트:

  • 테넌트 목록: curl http://127.0.0.1:8001/keys

  • 테넌트 취소: curl -X DELETE http://127.0.0.1:8001/keys/brand_a_user


Related MCP server: PostgreSQL MCP Server for Claude Desktop

🖥️ EC2 배포 (systemd를 통한 지속성)

프로덕션 환경에서는 systemd를 사용하여 서버가 재부팅 시 자동으로 시작되고 충돌 시 다시 시작되도록 합니다.

1. 프로젝트 설정

git clone https://github.com/intern-analytics/MCPforGBL.git
cd MCPforGBL
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

2. 구성

데이터베이스 자격 증명을 위한 .env 파일을 생성합니다(gitignored):

nano .env
# Add DB_USER, DB_PASS, DB_HOST, etc.

3. 시스템 서비스 생성

서비스 파일을 생성합니다:

sudo nano /etc/systemd/system/mcp-server.service

다음 내용을 붙여넣습니다(필요한 경우 경로 조정):

[Unit]
Description=Brand MCP FastAPI Server
After=network.target

[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu/projects/MCPforGBL
ExecStart=/home/ubuntu/projects/MCPforGBL/.venv/bin/python -m src.server2
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

4. 활성화 및 시작

sudo systemctl daemon-reload
sudo systemctl enable mcp-server
sudo systemctl start mcp-server
sudo systemctl status mcp-server

🤖 Claude에 연결

옵션 A: Claude.ai (웹 앱) 사용

이 서버는 Nginx를 통해 공개적으로 노출되고 Let's Encrypt HTTPS 인증서로 보호되므로 브라우저에서 직접 연결할 수 있습니다.

  1. Claude.ai 설정 -> 개발자(Developer) / **커넥터(Connectors)**로 이동합니다.

  2. **사용자 지정 커넥터 추가(Add custom connector)**를 클릭합니다.

  3. 보안 URL을 붙여넣습니다: https://mcpforgbl.duckdns.org/sse?token=gbl-YOUR_KEY_HERE

  4. 연결하고 쿼리하세요!

옵션 B: Claude 데스크톱 앱 (HTTPS) 사용

Windows의 %APPDATA%\Claude\claude_desktop_config.json을 업데이트하세요.

[!IMPORTANT] Windows 파일 경로의 공백 문제를 방지하려면 C:\\PROGRA~1\\nodejs\\npx.cmd를 사용하세요.

{
  "mcpServers": {
    "gbl-data-lake": {
      "command": "C:\\PROGRA~1\\nodejs\\npx.cmd",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcpforgbl.duckdns.org/sse?token=gbl-YOUR_KEY_HERE"
      ]
    }
  }
}

옵션 C: Claude 데스크톱 앱 (HTTP IP 주소 및 Bearer 헤더) 사용

DuckDNS URL을 사용하지 않고 EC2 인스턴스의 IP에 직접 연결하거나 URL 매개변수 대신 헤더로 토큰을 전달하려면 이 구성을 사용하세요:

{
  "mcpServers": {
    "gbl-data-lake": {
      "command": "C:\\PROGRA~1\\nodejs\\npx.cmd",
      "args": [
        "-y",
        "mcp-remote",
        "http://YOUR-EC2-PUBLIC-IP:8000/sse",
        "--allow-http",
        "--header",
        "Authorization: Bearer gbl-YOUR_KEY_HERE"
      ]
    }
  }
}

📈 확장성 로드맵

당사의 플랫폼은 강력한 역할 기반 액세스 제어 시스템을 통해 안전하고 효율적으로 확장되도록 설계되었습니다.

우리는 각 사용자/테넌트별로 별도의 전용 API 키를 생성하여 사용자 관리를 확장할 계획입니다. 우리의 아키텍처에서 API 키는 단순한 인증 토큰 이상의 역할을 합니다. 즉, 사용자의 전체 권한 프로필을 본질적으로 정의합니다. 키 자체는 서버에 사용자가 얼마나 많은 액세스 권한을 가지고 있는지 정확히 알려줍니다.

이 접근 방식을 통해 제한된 액세스 계정과 사용자 지정 **기술 파일(skill files)**을 기반으로 데이터베이스 상호 작용 및 도구 가용성을 엄격하게 적용하여, 각 사용자가 명시적으로 승인된 데이터 및 기능과만 상호 작용하도록 보장합니다.


🛠️ 개발

  • 로컬 서버: python -m src.server (표준 stdio)

  • SSE 서버: python -m src.server2 (FastAPI를 통한 HTTP/SSE)

  • 인증 유틸리티: src/auth.py

  • 데이터베이스 로직: src/db.py

F
license - not found
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables interaction with PostgreSQL databases through a production-ready MCP server with global connection pooling, automatic AWS password rotation, and comprehensive SQL operations. Supports multiple concurrent Claude sessions while maintaining efficient connection limits to the database.
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables Claude Desktop to interact with PostgreSQL databases through natural language for schema exploration, data analysis, and query execution. Users can search schemas, describe tables, and perform read or write operations without needing to write manual SQL.
  • A
    license
    Not graded
    quality
    C
    maintenance
    A production-ready MCP server for PostgreSQL — built for Claude Desktop, Claude Code, and any MCP-compatible AI agent.
    Apache 2.0
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables Claude Desktop to connect to PostgreSQL databases, allowing users to query, explore schemas, and analyze data using plain English without writing SQL.

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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/intern-analytics/MCPforGBL'

If you have feedback or need assistance with the MCP directory API, please join our Discord server