> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ja/llms.txt # Mastra.listMCPServers() `.listMCPServers()` メソッドは、Mastra インスタンスに登録されているすべての MCP Server インスタンスを取得します。返されるレコードでは、レジストリキー(`mcpServers` 設定のキー)がキーとして使用されます。 ## 使用例 ```typescript // Register MCP servers const server1 = new MCPServer({ id: 'server-one', name: 'Server One', version: '1.0.0', tools: {/* ... */}, }) const server2 = new MCPServer({ id: 'server-two', name: 'Server Two', version: '1.0.0', tools: {/* ... */}, }) export const mastra = new Mastra({ mcpServers: { firstServer: server1, // Registry key: 'firstServer' secondServer: server2, // Registry key: 'secondServer' }, }) // List all registered servers const servers = mastra.listMCPServers() // Returns: { firstServer: MCPServerBase, secondServer: MCPServerBase } ``` ## パラメーター このメソッドはパラメーターを受け取りません。 ## 戻り値 **servers** (`Record | undefined`): 登録済みのすべての MCP Server インスタンスのレコード。キーはレジストリキー(mcpServers 設定のキー)、値は MCPServerBase インスタンスです。Server が登録されていない場合は undefined。 ## 関連メソッド - [Mastra.getMCPServer()](https://mastra.zisheng.pro/ja/reference/core/getMCPServer): レジストリキーで MCP Server を取得 - [Mastra.getMCPServerById()](https://mastra.zisheng.pro/ja/reference/core/getMCPServerById): 固有の `id` プロパティで MCP Server を取得 ## 関連情報 - [MCP の概要](https://mastra.zisheng.pro/ja/docs/mcp/overview) - [MCP Server リファレンス](https://mastra.zisheng.pro/ja/reference/tools/mcp-server)