Skip to main content
Glama
rhabraken
by rhabraken

MCP를 사용하여 데이터베이스와 대화

MCP를 사용하여 데이터베이스와 대화

이 가이드에서는 Claude Desktop을 사용하여 PostgreSQL 데이터베이스와 연동하도록 MCP 서버를 설정하고 실행하는 방법을 설명합니다. SQLAlchemy를 기반으로 하므로 MySQL, MariaDB, SQLite에서도 작동합니다. 이 프로젝트는 https://github.com/runekaagaard/mcp-alchemy를 기반으로 구축되었습니다.

참고: 이 가이드에서는 Docker, 환경 변수, CLI 사용법에 대한 기본적인 이해가 있다고 가정합니다.


필수 조건


Related MCP server: MCP Database Server

1. 환경 변수 설정

  1. 환경 파일 복사 및 이름 바꾸기
    제공된 .env.example 파일을 복제하고 이름을 .env 로 바꿉니다.

    지엑스피1


2. Claude Desktop 설정

  1. Claude Desktop 다운로드 및 설치
    Claude Desktop 다운로드 페이지를 방문하여 애플리케이션을 설치하세요.


3. 더미 데이터로 PostgreSQL 데이터베이스 시작

  1. Docker Compose 실행
    Docker Compose가 설치되어 실행되었는지 확인하세요.

    docker-compose up -d
    • 이 명령은 localhost:5432 에서 PostgreSQL 데이터베이스를 시작하고 더미 데이터로 채웁니다.


4. uv 설치합니다(아직 설치되지 않은 경우)

  1. uv 설치
    다음 명령을 실행하여 uv 설치하세요.

    curl -LsSf https://astral.sh/uv/install.sh | sh

5. MCP 서버 구성 및 시작

  1. MCP 서버 구성 생성/업데이트
    다음 JSON 구성을 MCP 서버 구성 파일에 저장합니다(필요한 경우 경로를 조정합니다).

    {
      "mcpServers": {
        "my_database": {
          "command": "uv",
          "args": [
            "--directory",
            "/directory/where/this/app/is/located/app/",
            "run",
            "server.py"
          ],
          "env": {
            "DB_URL": "postgresql://postgres:password@localhost:5432/mydatabase"
          }
        }
      }
    }
    • 팁: uv 비표준 위치에 설치된 경우 실행 파일의 전체 경로를 반영하도록 "command" 값을 업데이트하세요.

  2. MCP 서버 실행
    구성이 완료되면 Claude Desktop을 실행할 때마다 MCP 서버가 자동으로 시작됩니다.


6. 설정을 즐기세요

  • 클로드 데스크톱을 엽니다.

  • 이 도구는 자동으로 MCP 서버를 호출하여 데이터베이스와 원활하게 상호 작용할 수 있도록 해줍니다.


요약

  1. 환경 변수 설정 : .env.example``.env 로 복사합니다.

  2. Claude Desktop 설치 및 실행 : Claude Desktop 에서 다운로드하세요.

  3. Docker Compose로 PostgreSQL 시작 : docker-compose up 실행하여 더미 데이터로 데이터베이스를 시작합니다.

  4. uv 설치 : 필요한 경우 제공된 설치 명령을 실행합니다.

  5. MCP 서버 구성 : 구성 파일을 업데이트하고 경로와 환경 변수가 올바른지 확인하세요.

  6. 실행 및 즐기기 : Claude Desktop을 시작하여 MCP를 통해 데이터베이스와 상호 작용을 시작하세요.


문제가 발생하거나 추가 지원이 필요한 경우 관련 문서를 참조하거나 지원팀에 문의하세요.

즐거운 코딩 되세요!

F
license - not found
-
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
    -
    quality
    D
    maintenance
    This server enables Claude to directly interact with SQLite, SQL Server, PostgreSQL, and MySQL databases through the Model Context Protocol, allowing for query execution, table management, and data export capabilities.
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    This server provides database access capabilities to Claude, supporting SQLite, SQL Server, PostgreSQL, and MySQL databases.
    853
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    This server provides database access capabilities to Claude, supporting SQLite, SQL Server, PostgreSQL, and MySQL databases.
    853
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    MCP server for Claude that connects to MySQL, MariaDB, and SQLite databases. Query your databases using natural language.
    3
    MIT

View all related MCP servers

Related MCP Connectors

  • GibsonAI MCP server: manage your databases with natural language

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.

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/rhabraken/mcp-python'

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