go-mcp-postgres
go-mcp-postgres
개요
https://github.com/Zhwt/go-mcp-mysql/ 에서 코드를 복사하고 AI의 도움을 받아 MySQL에서 Postgres로 DB를 변경했습니다. Postgres와의 상호 작용 및 자동화를 위한 부담 없는 즉시 사용 가능한 모델 컨텍스트 프로토콜(MCP) 서버입니다. Node.js나 Python 환경이 필요하지 않습니다. 이 서버는 MySQL 데이터베이스 및 테이블에 대한 CRUD 작업을 수행하는 도구와 예기치 않은 쓰기 작업을 방지하기 위한 읽기 전용 모드를 제공합니다. --with-explain-check 플래그를 추가하여 쿼리 실행 전에 EXPLAIN 문을 사용하여 MCP 서버가 쿼리 계획을 확인하도록 할 수도 있습니다.
이 기능은 현재 진행 중이므로 아직 생산에 사용할 준비가 되지 않았을 수 있습니다.
Related MCP server: MCP Server for PostgreSQL
설치
최신 릴리스를 받아서
$PATH나 쉽게 접근할 수 있는 곳에 넣어두세요.Go가 설치되어 있다면 소스에서 빌드할 수 있습니다.
지엑스피1
용법
방법 A: stdio 모드에 명령줄 인수 사용
{
"mcpServers": {
"postgres": {
"command": "go-mcp-postgres",
"args": [
"--dsn",
"postgresql://user:pass@host:port/db"
]
}
}
}참고: $PATH 외부에 바이너리를 넣은 경우 go-mcp-postgres 바이너리의 전체 경로로 바꿔야 합니다. 예를 들어, 바이너리를 다운로드 폴더에 넣은 경우 다음 경로를 사용할 수 있습니다.
{
"mcpServers": {
"postgres": {
"command": "C:\\Users\\<username>\\Downloads\\go-mcp-postgres.exe",
"args": [
...
]
}
}
}방법 B: sse 모드에 명령줄 인수 사용
./go-mcp-postgres --t sse --ip xxxx --port nnnn --dsn postgresql://user:pass@host:port/db --lang en
선택적 플래그
--lang: 언어 옵션(en/zh-CN)을 설정하고, 기본값은 시스템 언어입니다.--read-only플래그를 추가하여 읽기 전용 모드를 활성화하세요. 이 모드에서는list,read_,desc_로 시작하는 도구만 사용할 수 있습니다. 이 플래그를 추가한 후에는 MCP 서버를 새로 고치거나 다시 시작하세요.기본적으로 CRUD 쿼리는 먼저
EXPLAIN ?문을 사용하여 생성된 쿼리 계획이 예상 패턴과 일치하는지 확인합니다. 이 동작을 비활성화하려면--with-explain-check플래그를 추가하세요.
도구
다국어 지원: 모든 도구 설명은 언어 매개변수를 기반으로 자동으로 현지화됩니다.
자체 언어 지원을 추가하려면 [locales](i18n용) 폴더를 참조하세요. 명령줄에서 사용하려면 새 locales/xxx/active-xx.toml 파일을 생성해야 합니다.
스키마 도구
list_database${mcp.tool.list_database.desc}
매개변수: 없음
반환값: 일치하는 데이터베이스 이름 목록입니다.
list_table${mcp.tool.list_table.desc}
매개변수:
name: 제공된 경우 지정된 이름을 가진 테이블을 나열하고, 그렇지 않은 경우 모든 테이블을 나열합니다.
반환값: 일치하는 테이블 이름 목록입니다.
create_table${mcp.tool.create_table.desc}
매개변수:
query: 테이블을 생성하기 위한 SQL 쿼리입니다.
반환: 영향을 받은 행 x개.
alter_tablePostgres 서버의 기존 테이블을 변경합니다. LLM은 기존 테이블이나 열을 삭제하지 않도록 설정됩니다.
매개변수:
query: 테이블을 변경하는 SQL 쿼리입니다.
반환: 영향을 받은 행 x개.
desc_table표의 구조를 설명하세요.
매개변수:
name: 설명하려는 테이블의 이름입니다.
반환값: 테이블의 구조.
데이터 도구
read_query읽기 전용 SQL 쿼리를 실행합니다.
매개변수:
query: 실행할 SQL 쿼리입니다.
반환값: 쿼리 결과.
write_querySQL 쿼리를 실행합니다.
매개변수:
query: 실행할 SQL 쿼리입니다.
반환값: 영향을 받은 행 x개, 마지막 삽입 ID: <last_insert_id>.
update_query업데이트 SQL 쿼리를 실행합니다.
매개변수:
query: 실행할 SQL 쿼리입니다.
반환: 영향을 받은 행 x개.
delete_query삭제 SQL 쿼리를 실행합니다.
매개변수:
query: 실행할 SQL 쿼리입니다.
반환: 영향을 받은 행 x개.
count_query특정 테이블의 행 수를 쿼리합니다.
매개변수:
name: 계산할 테이블의 이름입니다.
반환값: 테이블의 행 번호.
https://github.com/Zhwt/go-mcp-mysql/ 에 다시 한번 큰 감사를 드립니다.
특허
MIT
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
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables performing PostgreSQL database operations (create, read, update, delete) on User and Post entities through MCP tools.539MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server implementation that provides a simple interface to interact with PostgreSQL databases, enabling SQL queries, database operations, and schema management through MCP.
- AlicenseNot gradedqualityDmaintenanceAn open-source MCP server for PostgreSQL schema introspection and guarded read-only queries. It enables MCP clients to discover schemas, tables, columns, indexes, relationships, and safe queryable data from a configured PostgreSQL database.13MIT
- FlicenseNot gradedqualityDmaintenanceA standardized Model Context Protocol server for interacting with PostgreSQL databases, enabling full CRUD operations, schema management, and database introspection.1
Related MCP Connectors
MCP server for managing Prisma Postgres.
MCP server for interacting with the Supabase platform
Butterbase MCP server — manage your backend: schemas, auth, functions, storage, RAG, deploys.
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/guoling2008/go-mcp-postgres'
If you have feedback or need assistance with the MCP directory API, please join our Discord server