> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # Mastra.getMCPServerById() 그만큼`.getMCPServerById()`메소드는 고유한 방식으로 MCP 서버 인스턴스를 검색합니다.`id`재산. 레지스트리 키(구성에 사용된 키)로 검색하려면 다음을 사용하세요.`.getMCPServer()`대신에. ## 사용예 ```typescript // Register an MCP server with a registry key const myServer = new MCPServer({ id: 'my-mcp-server', name: 'My Server', version: '1.0.0', tools: {/* ... */}, }) export const mastra = new Mastra({ mcpServers: { customKey: myServer, // 'customKey' is the registry key }, }) // Retrieve by intrinsic ID const server = mastra.getMCPServerById('my-mcp-server') // Alternatively, retrieve by registry key const serverByKey = mastra.getMCPServer('customKey') ``` ## 매개변수 **serverId** (`string`): MCP 서버 자체의 id 속성입니다(서버를 인스턴스화할 때 설정됨). **version** (`string`): 선택 사항입니다. 제공하면 버전이 일치할 때만 서버를 반환합니다. ## 보고 **server** (`MCPServerBase | undefined`): 지정된 id와 버전(제공된 경우)에 해당하는 MCP 서버 인스턴스입니다. 찾지 못하면 undefined입니다. ## 메모 - 서버의 `id`는 생성 중에 슬러그 형식으로 변환되므로 `'myMcpServer'`는 `'my-mcp-server'`가 됩니다. - 여러 서버의 `id`가 같지만 버전이 서로 다르면 구분을 위해 `version` 매개변수를 제공해야 합니다. - `version`을 제공하지 않았고 여러 버전이 존재하면 메서드는 첫 번째 일치 항목을 반환합니다. ## 관련 방법 - [마스트라.getMCPServer()](https://mastra.zisheng.pro/ko/reference/core/getMCPServer): 레지스트리 키로 MCP 서버를 검색합니다. - [Mastra.listMCPServers()](https://mastra.zisheng.pro/ko/reference/core/listMCPServers): 등록된 모든 MCP 서버 나열 ## 또한보십시오 - [MCP 개요](https://mastra.zisheng.pro/ko/docs/mcp/overview) - [MCP 서버 참조](https://mastra.zisheng.pro/ko/reference/tools/mcp-server)