
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
postgres-mcp는 쿼리를 생성하고 분석, 설계 데이터베이스 스키마를 실행하고 서버와 쿼리의 성능을 진단하고 연결을 안전하게 관리하고 데이터를 가져옵니다.
개요
postgres-mcp는 쿼리를 생성하고 분석, 설계 데이터베이스 스키마를 실행하고 서버와 쿼리의 성능을 진단하고 연결을 안전하게 관리하고 데이터를 가져옵니다. 모든 MCP 클라이언트와 호환됩니다 — GitHub Copilot, Claude Code, Codex, Open Code, Cursor, VS Code 등. - https://www.npmjs.com/package/@microsoft/postgres-mcp - - npx에서 실행합니다. 한 번 이름 프로필 만들기 — 암호는 OS 키링에 저장되며 구성 파일에 결코 없습니다. 연결에 의해 생성 된 프로필은 access mode : ro가 설정되지 않는 허용 쓰기 도구를 추가합니다. 쓰기가 필요없는 자율 에이전트를 위해, 명시된 읽기 전용 프로파일을 사용하여 읽기 전용 데이터베이스 역할 - 읽기 전용 프로파일을 참조하십시오. 서버는 stdio에 MCP를 말합니다. npx @microsoft/postgres-mcp run에서 클라이언트를 점하십시오 — credentials는 클라이언트 구성에서 갑니다; 기호화 대리인 발견은 런타임에 당신의 저장된 단면도에 연결합니다. — mcpServers 형식을 사용하는 클라이언트 (~/.copilot/mcp-config.json, mcp.json, .cursor/mcp.
개요(AI 번역)
** PostgreSQL에 코딩 에이전트를 연결하십시오. ** postgres-mcp] 생성 할 수 있습니다.
쿼리 및 실행 분석, 설계 데이터베이스 스키마, 진단 성능의
서버 및 쿼리, 안전하게 연결 관리, 및 가져오기 데이터. 그것은
모든 MCP 클라이언트와 호환 — GitHub Copilot, Claude Code, Codex, Open Code,
Cursor, VS 코드 및 더 많은.
-npm: https://www.npmjs.com/package/@microsoft/postgres-mcp
- 필요한 설치 없음 —
npx에서 바로 실행합니다.
빠른 시작
##1. 연결 프로필 저장
한 번 이름의 프로필 만들기 — 암호는 OS 키링에 저장됩니다, 절대로 config 파일:
connection add]에 의해 생성된 프로필은 없는 도구를 쓸 수 있습니다.access_mode: ro설정입니다. 작성하지 않은 자율주행에 대한, 사용 명시된 읽기 전용 프로파일 ** and** a read-only database role — see 읽기 전용 프로파일.
2. 당신의 기호화 대리인에 postgres-mcp를 추가하십시오
서버는 stdio에 MCP를 말합니다. 고객만족
npx @microsoft/postgres-mcp run - 클라이언트 설정에서 credentials 이동;
코딩 에이전트 발견 및 runtime에 저장된 프로필에 연결.
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
Postgres MCP Server
Connect your coding agent to PostgreSQL. postgres-mcp lets you generate
queries and run analytics, design database schemas, diagnose performance of the
server and queries, securely manage connections, and import data. It is
compatible with any MCP client — GitHub Copilot, Claude Code, Codex, Open Code,
Cursor, VS Code, and more.
- npm: https://www.npmjs.com/package/@microsoft/postgres-mcp
- No install required — run it straight from
npx.
Quick start
1. Save a connection profile
Create a named profile once — the password is stored in your OS keyring, never in a config file:
# add a profile from a libpq URI or key=value string
npx -y @microsoft/postgres-mcp connection add local \
"postgresql://postgres@localhost:5432/postgres"
# store its password securely (hidden prompt)
npx -y @microsoft/postgres-mcp connection set-password local
# check it
npx -y @microsoft/postgres-mcp connection list
Profiles created by
connection addpermit write tools unlessaccess_mode: rois set. For autonomous agents that should not write, use an explicit read-only profile and a read-only database role — see Read-only profiles.
2. Add postgres-mcp to your coding agent
The server speaks MCP over stdio. Point your client at
npx @microsoft/postgres-mcp run — no credentials go in the client config; the
coding agent discovers and connects to your saved profile at runtime.
GitHub Copilot CLI, Claude Code, Cursor & Claude Desktop — clients that use the mcpServers format (~/.copilot/mcp-config.json, mcp.json, .cursor/mcp.json, claude_desktop_config.json, …):
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@microsoft/postgres-mcp", "run"]
}
}
}
Running headless or in CI, without a keyring? The server can also take a database connection string from the environment — see Connecting without a profile in the guide.
3. Ask your coding agent
“List the tables in my PostgreSQL database.” “Show me the 10 most recent orders from my PostgreSQL database.” “What’s slowing down my PostgreSQL server right now?”
The agent calls the server’s tools (postgres_mcp_connect,
postgres_mcp_query, postgres_mcp_db_context, …) for you.
What it can do
| Area | Tools |
|---|---|
| Connections | list / add / remove profiles, connect, disconnect, list databases |
설치
npx -y @microsoft/postgres-mcp run설정
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@microsoft/postgres-mcp", "run"]
}
}
}