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

이 가이드에서는 Claude Desktop을 사용하여 PostgreSQL 데이터베이스와 연동하도록 MCP 서버를 설정하고 실행하는 방법을 설명합니다. SQLAlchemy를 기반으로 하므로 MySQL, MariaDB, SQLite에서도 작동합니다. 이 프로젝트는 https://github.com/runekaagaard/mcp-alchemy를 기반으로 구축되었습니다.
참고: 이 가이드에서는 Docker, 환경 변수, CLI 사용법에 대한 기본적인 이해가 있다고 가정합니다.
필수 조건
Docker Compose : 설치 지침
Claude Desktop : 여기에서 다운로드하세요
uv : 최신 고성능 Python 패키지 관리자입니다. 설치되어 있지 않은 경우 아래 지침을 따르세요.
Related MCP server: MCP Database Server
1. 환경 변수 설정
환경 파일 복사 및 이름 바꾸기
제공된.env.example파일을 복제하고 이름을.env로 바꿉니다.지엑스피1
2. Claude Desktop 설정
Claude Desktop 다운로드 및 설치
Claude Desktop 다운로드 페이지를 방문하여 애플리케이션을 설치하세요.
3. 더미 데이터로 PostgreSQL 데이터베이스 시작
Docker Compose 실행
Docker Compose가 설치되어 실행되었는지 확인하세요.docker-compose up -d이 명령은
localhost:5432에서 PostgreSQL 데이터베이스를 시작하고 더미 데이터로 채웁니다.
4. uv 설치합니다(아직 설치되지 않은 경우)
uv설치
다음 명령을 실행하여uv설치하세요.curl -LsSf https://astral.sh/uv/install.sh | sh
5. MCP 서버 구성 및 시작
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"값을 업데이트하세요.
MCP 서버 실행
구성이 완료되면 Claude Desktop을 실행할 때마다 MCP 서버가 자동으로 시작됩니다.
6. 설정을 즐기세요
클로드 데스크톱을 엽니다.
이 도구는 자동으로 MCP 서버를 호출하여 데이터베이스와 원활하게 상호 작용할 수 있도록 해줍니다.
요약
환경 변수 설정 :
.env.example``.env로 복사합니다.Claude Desktop 설치 및 실행 : Claude Desktop 에서 다운로드하세요.
Docker Compose로 PostgreSQL 시작 :
docker-compose up실행하여 더미 데이터로 데이터베이스를 시작합니다.uv설치 : 필요한 경우 제공된 설치 명령을 실행합니다.MCP 서버 구성 : 구성 파일을 업데이트하고 경로와 환경 변수가 올바른지 확인하세요.
실행 및 즐기기 : Claude Desktop을 시작하여 MCP를 통해 데이터베이스와 상호 작용을 시작하세요.
문제가 발생하거나 추가 지원이 필요한 경우 관련 문서를 참조하거나 지원팀에 문의하세요.
즐거운 코딩 되세요!
This server cannot be installed
Maintenance
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
- Alicense-qualityDmaintenanceThis 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
- Alicense-qualityDmaintenanceThis server provides database access capabilities to Claude, supporting SQLite, SQL Server, PostgreSQL, and MySQL databases.853MIT
- Alicense-qualityDmaintenanceThis server provides database access capabilities to Claude, supporting SQLite, SQL Server, PostgreSQL, and MySQL databases.853MIT
- AlicenseAqualityBmaintenanceMCP server for Claude that connects to MySQL, MariaDB, and SQLite databases. Query your databases using natural language.3MIT
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.
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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