[null,null,["最后更新时间 (UTC):2025-08-21。"],[],[],null,["# Add an MCP server\n\nGemini in Android Studio's agent can interact with external tools using the\n[Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction).\nThis feature provides a standardized way for Agent mode to use tools and extend\nknowledge and capabilities with the external environment.\n\nThere are many tools you can connect to the MCP Host in Android Studio. For\nexample, you can integrate with the\n[GitHub MCP Server](https://github.com/github/github-mcp-server) to\ncreate pull requests directly from Android Studio. For more ideas, see the\n[MCP example servers](https://modelcontextprotocol.io/examples).\n\nTo add an MCP server, create a `mcp.json` file and place it in the\n[configuration directory](/studio/troubleshoot#directories) of Studio. The\n`mcp.json` file should follow this format: \n\n {\n \"mcpServers\": {\n \"memory\": {\n \"command\": \"npx\",\n \"args\": [\n \"-y\",\n \"@modelcontextprotocol/server-memory\"\n ]\n },\n \"sequential-thinking\": {\n \"command\": \"npx\",\n \"args\": [\n \"-y\",\n \"@modelcontextprotocol/server-sequential-thinking\"\n ]\n },\n \"github\": {\n \"command\": \"docker\",\n \"args\": [\n \"run\",\n \"-i\",\n \"--rm\",\n \"-e\",\n \"GITHUB_PERSONAL_ACCESS_TOKEN\",\n \"ghcr.io/github/github-mcp-server\"\n ],\n \"env\": {\n \"GITHUB_PERSONAL_ACCESS_TOKEN\": \"\u003cYOUR_TOKEN\u003e\"\n }\n }\n }\n }\n\n| **Note:** Make sure that MCP servers are enabled in settings: **Tools \\\u003e Gemini \\\u003e MCP Servers**\n\nRefer to the documentation for the MCP server you're integrating with for the\nprecise `command` and `args` that you should list in this file. You might also\nneed to install tools such as Node.js or Docker, depending on the MCP server's\nsoftware requirements.\n\nLimitations\n-----------\n\nThere are a few important limitations to Android Studio's MCP integration:\n\n- MCP servers must implement the *stdio* transport.\n- The following functionalities aren't yet supported:\n - Streaming HTTP transport\n - MCP resources\n - Prompt templates"]]