Stay organized with collections
Save and categorize content based on your preferences.
Gemini in Android Studio's agent can interact with external tools using the
Model Context Protocol (MCP).
This feature provides a standardized way for Agent mode to use tools and extend
knowledge and capabilities with the external environment.
There are many tools you can connect to the MCP Host in Android Studio. For
example, you can integrate with the
GitHub MCP Server to
create pull requests directly from Android Studio. For more ideas, see the
MCP example servers.
To add an MCP server, create a mcp.json file and place it in the
configuration directory of Studio. The
mcp.json file should follow this format:
Refer to the documentation for the MCP server you're integrating with for the
precise command and args that you should list in this file. You might also
need to install tools such as Node.js or Docker, depending on the MCP server's
software requirements.
Limitations
There are a few important limitations to Android Studio's MCP integration:
MCP servers must implement the stdio transport.
The following functionalities aren't yet supported:
Streaming HTTP transport
MCP resources
Prompt templates
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-09-08 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-08 UTC."],[],[],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"]]