Stdio MCP 서버를 통한 MCP 접근
Teleport v18.9Teleport는 stdio 전송 방식의 MCP 서버에 대한 보안 접근을 제공할 수 있습니다. 이 가이드에서 다음 방법을 보여드립니다: 사용자는 Claude Desktop과 같은 MCP 클라이언트를 tsh를 사용하여 MCP 서버를 시작하도록 구성할 수 있습니다.
Teleport는 stdio 전송 방식의 MCP 서버에 대한 보안 접근을 제공할 수 있습니다.
이 가이드에서 다음 방법을 보여드립니다:
- Teleport 클러스터에 stdio 전송 방식의 MCP 서버 등록.
- Teleport를 통한 stdio MCP 서버 연결.
작동 방식#
사용자는 Claude Desktop과 같은 MCP 클라이언트를 tsh를 사용하여 MCP 서버를 시작하도록 구성할 수 있습니다. 성공적으로 인가되면 tsh는 애플리케이션 서비스와 세션을 설정합니다.
Teleport 애플리케이션 서비스는 Teleport 관리자가 앱 정의에서 정의한 명령어와 인수를 사용하여 MCP 서버를 시작합니다. 그런 다음 Teleport는 클라이언트와 원격 MCP 서버 사이의 연결을 프록시하여 사용자에게 사용 가능한 도구를 필터링하는 등 추가적인 역할 기반 접근 제어를 적용합니다. 프록시 중에 Teleport는 MCP 프로토콜 요청을 감사 이벤트로 기록하여 사용자 활동에 대한 가시성을 제공합니다.
사전 요구사항#
-
실행 중인 Teleport (v18.1.0 or higher) 클러스터. Teleport를 시작하려면 무료 체험판에 가입하거나 데모 환경을 구성하세요.
-
tctlandtshclients.Installing `tctl` and `tsh` clients
-
Teleport 클러스터의 버전을 확인합니다.
tctlandtshclients는 Teleport 클러스터 버전보다 최대 한 개의 메이저 버전까지만 뒤처질 수 있습니다. Proxy Service의/v1/webapi/find로 GET 요청을 보내고 JSON 쿼리 도구를 사용하여 클러스터 버전을 확인합니다.teleport.example.com:443를 Teleport Proxy Service의 웹 주소로 바꿉니다:$ TELEPORT_DOMAIN=teleport.example.com:443 $ TELEPORT_VERSION="$(curl -s https://$TELEPORT_DOMAIN/v1/webapi/find | jq -r '.server_version')" -
사용 중인 플랫폼에 대한 지침에 따라
tctlandtshclients를 설치합니다:
-
Mac
`tctl` and `tsh` clients가 포함된, 서명된 Teleport macOS .pkg 설치 프로그램을 다운로드합니다:
```code
$ curl -O https://cdn.teleport.dev/teleport-${TELEPORT_VERSION?}.pkg
```
Finder에서 `pkg` 파일을 더블 클릭하여 설치를 시작합니다.
Homebrew를 사용하여 Teleport를 설치하는 것은 지원되지 않습니다. Homebrew의
Teleport 패키지는 Teleport에서 유지 관리하지 않으므로 신뢰성이나 보안을
보장할 수 없습니다.
Windows - Powershell
```code
$ curl.exe -O https://cdn.teleport.dev/teleport-v${TELEPORT_VERSION?}-windows-amd64-bin.zip
# Unzip the archive and move the `tctl` and `tsh` clients to your %PATH%
# NOTE: Do not place the `tctl` and `tsh` clients in the System32 directory, as this can cause issues when using WinSCP.
# Use %SystemRoot% (C:\Windows) or %USERPROFILE% (C:\Users\<username>) instead.
```
Linux
Linux 설치판의 모든 Teleport 바이너리에는 `tctl` and `tsh` clients가 포함되어 있습니다. RPM/DEB
패키지 및 i386/ARM/ARM64용 다운로드를 포함한 더 많은 옵션은
[설치 페이지](../installation/installation.mdx)를 참조하세요.
```code
$ curl -O https://cdn.teleport.dev/teleport-v${TELEPORT_VERSION?}-linux-amd64-bin.tar.gz
$ tar -xzf teleport-v${TELEPORT_VERSION?}-linux-amd64-bin.tar.gz
$ cd teleport
$ sudo ./install
# Teleport binaries have been copied to /usr/local/bin
```
- Teleport 애플리케이션 서비스를 실행할 호스트(예: EC2 인스턴스).
npx또는docker와 같이 stdio 기반 MCP 서버를 시작할 수 있는 같은 호스트의 도구.
1/3단계. Teleport 애플리케이션 서비스 구성#
MCP 서버를 활성화하기 위해 기존 애플리케이션 서비스를 업데이트하거나 새로 생성할 수 있습니다.
이미 실행 중인 애플리케이션 서비스가 있다면 YAML 구성에 MCP 서버를 추가할 수 있습니다:
app_service:
enabled: true
apps:
- name: "everything"
labels:
env: dev
description:
mcp:
# stdio 기반 MCP 서버를 실행하는 명령어.
command: "docker"
# 명령어와 함께 실행할 인수.
args: ["run", "-i", "--rm", "mcp/everything"]
# 명령어가 실행될 호스트 사용자 계정 이름.
# stdio 기반 MCP 서버에는 필수입니다.
run_as_host_user: "docker"
원하는 MCP 서버로 MCP 세부사항을 교체한 다음 애플리케이션 서비스를 재시작합니다.
조인 토큰 얻기#
Application Service가 Teleport 클러스터에 조인하려면 유효한 조인 토큰이 필요합니다.
다음 tctl 명령을 실행하고 Application Service를 실행할 서버에서
토큰 출력을 /tmp/token에 저장합니다:
$ tctl tokens add --type=app --format=text
(=presets.tokens.first=)
대체 방법
AWS에 많은 인프라를 보유하고 있거나 많은 인스턴스를 생성 또는 재생성할 수 있는 사용자의 경우, Teleport를 실행하는 새 EC2 인스턴스를 조인하는 대체 방법을 고려하십시오:
Teleport 애플리케이션 서비스 설치#
Teleport 애플리케이션 서비스를 실행할 호스트에 Teleport를 설치합니다:
Linux 서버에 Teleport Agent를 설치하려면:
권장 설치 방법은 클러스터 설치 스크립트입니다. 이 스크립트는 클러스터에 맞는 올바른 버전, 에디션, 설치 모드를 선택합니다.
-
teleport.example.com:443에 Teleport 클러스터의 호스트명과 포트를 할당하되, 스킴(https://)은 포함하지 마십시오. -
클러스터의 설치 스크립트를 실행하십시오:
$ curl "https://teleport.example.com:443/scripts/install.sh" | sudo bash
Teleport 애플리케이션 서비스 구성#
Teleport 애플리케이션 서비스를 실행할 호스트에서 /etc/teleport.yaml에 다음 내용으로 파일을 생성합니다:
version: v3
teleport:
join_params:
token_name: "/tmp/token"
method: token
proxy_server: "teleport.example.com:443"
auth_service:
enabled: false
proxy_service:
enabled: false
ssh_service:
enabled: false
app_service:
enabled: true
apps:
- name: "everything"
labels:
env: dev
description:
mcp:
# stdio 기반 MCP 서버를 실행하는 명령어.
command: "docker"
# 명령어와 함께 실행할 인수.
args: ["run", "-i", "--rm", "mcp/everything"]
# 명령어가 실행될 호스트 사용자 계정 이름.
# stdio 기반 MCP 서버에는 필수입니다.
run_as_host_user: "docker"
teleport.example.com:443을 Teleport Proxy 서비스 또는 Teleport Cloud 테넌트의 호스트와 포트로 바꾸고, MCP 세부사항을 실행하려는 MCP 서버로 교체합니다.
Teleport 애플리케이션 서비스 시작#
systemd 서비스를 생성하여 호스트가 부팅될 때 the Application Service이 자동으로 시작되도록 구성합니다. 지침은 the Application Service을 어떻게 설치했는지에 따라 다릅니다.
Package Manager
the Application Service을 실행할 호스트에서 Teleport를 활성화하고 시작합니다:
$ sudo systemctl enable teleport
$ sudo systemctl start teleport
TAR Archive
the Application Service을 실행할 호스트에서 Teleport용 systemd 서비스 구성을 생성하고, Teleport 서비스를 활성화한 후 Teleport를 시작합니다:
$ sudo teleport install systemd -o /etc/systemd/system/teleport.service
$ sudo systemctl enable teleport
$ sudo systemctl start teleport
systemctl status teleport로 the Application Service의 상태를 확인하고 journalctl -fu teleport로
로그를 볼 수 있습니다.
2/3단계. Teleport 사용자 구성#
이 단계에서는 Teleport 사용자에게 모든 MCP 서버와 그 MCP 도구에 대한 액세스 권한을 부여합니다.
Configure an existing user
기존 Teleport 사용자가 있다면 해당 사용자에게 사전 설정 role인 mcp-user를
할당합니다. mcp-user role은 모든 MCP 서버와 그 도구에 대한 액세스를 허용합니다:
kind: role
version: v8
metadata:
description: Access to MCP servers
labels:
teleport.internal/resource-type: preset
name: mcp-user
spec:
allow:
app_labels:
'teleport.internal/app-sub-kind': 'mcp'
mcp:
tools:
- '*'
또는 위의 allow 권한을 기존 Teleport role에 추가할 수도 있습니다.
Create a new user
MCP 액세스 권한을 가진 my_user라는 새 로컬 사용자를 생성합니다:
$ tctl users add my_user --roles=mcp-user
Web UI를 사용하여 역할을 생성하고 편집할 수도 있습니다. Access -> Roles로 이동하여 Create New Role을 클릭하거나 편집할 기존 역할을 선택하십시오.
3/3단계. 연결#
방금 생성한 사용자 my_user로 Teleport에 로그인합니다:
$ tsh login --proxy=teleport.example.com:443 --user=my_user
이제 사용 가능한 MCP 서버를 확인할 수 있습니다:
$ tsh mcp ls
Name Description Type Labels
---------- --------------------- ----- ----------
everything everything MCP server stdio env=dev
MCP 클라이언트가 연결할 수 있도록 구성을 표시하려면 다음을 실행합니다.
$ tsh mcp config everything
Found MCP servers:
everything
Here is a sample JSON configuration for launching Teleport MCP servers:
{
"mcpServers": {
"teleport-mcp-everything": {
"command": "/path/to/tsh",
"args": ["mcp", "connect", "everything"]
}
}
}
Tip: You can use this command to update your MCP servers configuration file automatically.
- For Claude Desktop, use --client-config=claude to update the default configuration.
- For Cursor, use --client-config=cursor to update the global MCP servers configuration.
In addition, you can use --client-config=<path> to specify a config file location that is compatible with the "mcpServers" mapping.
For example, you can update a Cursor project using --client-config=<path-to-project>/.cursor/mcp.json
MCP 클라이언트 구성이 업데이트되면, MCP 클라이언트에 허용된 도구와 함께
teleport-mcp-everything MCP 서버가 나타나는 것을 확인할 수 있습니다.
다음 단계#
다음 주제에서 Teleport로 MCP 서버를 보호하는 방법에 대해 자세히 알아보세요:
- MCP 접근 제어.
- MCP 서버 동적 등록
- 구성 및 CLI 참조.