MCP를 통해 Teleport 데이터베이스에 접근하기
MCP 클라이언트가 Teleport 데이터베이스를 MCP 서버로 사용하도록 구성하는 방법.
이 가이드는 MCP 클라이언트로 PostgreSQL Teleport 데이터베이스에 연결하는 방법을 설명합니다. 사전 요구 사항 # A running Teleport cluster. If you want to get started with Teleport, sign up for a free trial or set up a demo environment . The `tsh` client. Installing \`tsh\` client Determine the version of your Teleport cluster. The `tsh` client must be at most one major version behind your Teleport cluster version. Send a GET request to the Proxy Service at /v1/webapi/find and use a JSON query tool to obtain your cluster version. Replace with the web address of your Teleport Proxy Service: $ TELEPORT_DOMAIN= $ TELEPORT_VERSION="$(curl -s https://$TELEPORT_DOMAIN/v1/webapi/find | jq -r '.server_version')" Follow the instructions for your platform to install `tsh` client: PostgreSQL 데이터베이스가 등록된 Teleport Database Service. Teleport에 PostgreSQL 데이터베이스를 등록하는 방법에 대한 옵션은 가이드 를 참조하세요. AWS RDS PostgreSQL 및 자체 호스팅 PostgreSQL 가이드가 포함됩니다. 보안 고려사항 언어 모델이 데이터베이스에서 모든 쿼리를 실행할 수 있으므로, 모델에 부여할 권한만 가진 데이터베이스 사용자를 생성하는 것을 권장합니다. 읽기 전용 권한을 가진 사용자를 설정하면 데이터베이스에 대한 실수로 인한 변경을 방지하는 데 도움이 됩니다. 데이터베이스에 읽기 전용 접근 권한을 가진 PostgreSQL 사용자를 생성하는 예시는 다음과 같습니다: CREATE ROLE mcp_read_only WITH LOGIN; GRANT CONNECT ON DATABASE my_database TO mcp_read_only; GRANT USAGE ON SCHEMA public TO mcp_read_only; GRANT SELECT ON my_table TO mcp_read_only; -- To grant read access to a single table. GRANT SELECT ON ALL TABLES IN SCHEMA public TO mcp_read_only; -- To grant read access to all tables in the "public" schema. GRANT rds_iam TO mcp_read_only; -- If conne
