> Discover all available pages from the documentation index: https://mastra.zisheng.pro/llms.txt # Mastra.getServer() `.getServer()` 方法用于获取 Mastra 实例中已配置的 server 配置。 ## 使用示例 ```typescript mastra.getServer() ``` ## 参数 此方法不接受任何参数。 ## 返回值 **server** (`ServerConfig | undefined`): 已配置的 server 配置,包括 port、host、studioBase、timeout、API route、middleware、CORS 设置和构建选项;如果未配置 server,则为 undefined。 ## 相关内容 - [Server 部署](https://mastra.zisheng.pro/docs/deployment/mastra-server) - [Server 配置](https://mastra.zisheng.pro/docs/server/custom-api-routes)