Skip to main content

AI Studio MCP Server

A comprehensive Model Context Protocol server for Google AI Studio automation using Playwright. This server provides tools, resources, and prompts for end-to-end development workflows - from project creation through deployment.

Features

🛠️ Tools (5 automation functions)

  • aistudio_login - Authenticate to Google AI Studio
  • aistudio_create_repo - Create GitHub repository for project
  • aistudio_commit_and_deploy - Commit to GitHub and deploy to Cloud Run
  • aistudio_clone_repository - Clone repository locally
  • aistudio_wait_for_implementation - Wait for Gemini to complete implementation

📚 Resources (12 documentation files)

All documentation accessible via MCP resources protocol:

  • aistudio://docs/start-here - Quick start and navigation guide
  • aistudio://docs/workflow-new-project - Complete new project lifecycle
  • aistudio://docs/workflow-existing-project - Enhancement workflow
  • aistudio://docs/ai-features-catalog - AI capabilities reference
  • aistudio://docs/browser-automation-reference - Playwright commands
  • aistudio://docs/llm-decision-guide - Decision-making framework
  • aistudio://docs/best-practices-antipatterns - Troubleshooting guide
  • aistudio://docs/mcp-server-setup - Server configuration
  • aistudio://docs/mcp-quick-reference - Quick lookup reference
  • Plus 3 legacy documentation files

💬 Prompts (4 workflow templates)

  • create-new-project - Full workflow for new projects
  • enhance-existing-project - Add features/fix bugs
  • add-ai-features - Integrate AI capabilities
  • troubleshoot-workflow - Debug issues

Installation

The easiest way to use this server is with the standalone script:

python /path/to/src/aistudio/aistudio_mcp_server.py

No dependencies or installation needed - just point to the file!

Alternative: Using uv (for package installation)

# No installation needed - use uvx directly
uvx mcp-server-aistudio

Alternative: Using pip

pip install mcp-server-aistudio

Prerequisites

  1. Playwright: Install and setup browsers
playwright install chromium
  1. Google Account: Access to Google AI Studio and Google Cloud Platform

  2. GitHub Account: For repository creation (automated via AI Studio)

Configuration

Add to claude_desktop_config.json or .mcp.json:

{
  "mcpServers": {
    "aistudio": {
      "command": "python",
      "args": ["/absolute/path/to/src/aistudio/aistudio_mcp_server.py"]
    }
  }
}

Example (absolute path):

{
  "mcpServers": {
    "aistudio": {
      "command": "python",
      "args": ["/home/user/mcpservers/src/aistudio/aistudio_mcp_server.py"]
    }
  }
}

Alternative: Using uvx

{
  "mcpServers": {
    "aistudio": {
      "command": "uvx",
      "args": ["mcp-server-aistudio"]
    }
  }
}

Alternative: Using pip installation

{
  "mcpServers": {
    "aistudio": {
      "command": "python",
      "args": ["-m", "mcp_server_aistudio"]
    }
  }
}

Quick Start

1. First Time: Authenticate

Use the aistudio_login tool to authenticate and save session

This opens a browser where you manually log in to Google AI Studio. Your session is saved to ~/.playwright/aistudio_auth_state.json.

2. Create a New Project

Use the create-new-project prompt:

Prompt: create-new-project
Arguments:
  - project_name: "my-ai-app"
  - project_description: "A chatbot for customer support"
  - google_cloud_project: "my-gcp-project-id"

This will:

  1. Guide you through the complete workflow
  2. Create AI Studio project with Gemini implementation
  3. Set up GitHub repository
  4. Deploy to Google Cloud Run
  5. Clone locally for development

3. Enhance Existing Project

Use the enhance-existing-project prompt:

Prompt: enhance-existing-project
Arguments:
  - app_url: "https://aistudio.google.com/apps/drive/abc123"
  - enhancement_description: "Add voice input support"
  - google_cloud_project: "my-gcp-project-id"

4. Access Documentation

All documentation is available as MCP resources. LLM agents can read them directly:

Read resource: aistudio://docs/workflow-new-project

No need to look at external files - everything is accessible through the MCP!

Workflows

Creating a Brand New Project

Time: ~2-3 minutes for full workflow

  1. Authentication (one-time)

    • Tool: aistudio_login
  2. Project Creation

    • Manually create project in AI Studio
    • Send implementation prompt to Gemini
    • Tool: aistudio_wait_for_implementation (90+ seconds)
  3. Repository Setup

    • Edit project name with UUID prefix
    • Tool: aistudio_create_repo
  4. Deployment

    • Tool: aistudio_commit_and_deploy
    • Wait ~60 seconds for deployment
  5. Local Development

    • Tool: aistudio_clone_repository
    • Review and iterate

Reference: Read aistudio://docs/workflow-new-project

Enhancing Existing Project

Time: ~10-15 minutes per enhancement

  1. Navigate to existing project URL
  2. Describe enhancement to Gemini
  3. Tool: aistudio_wait_for_implementation
  4. Tool: aistudio_commit_and_deploy
  5. Verify deployed application

Reference: Read aistudio://docs/workflow-existing-project

Adding AI Features

Time: Varies (5-15 minutes)

  1. Explore Features

    • Read aistudio://docs/ai-features-catalog
    • Available: voice, chatbots, TTS, images, video, maps, search
  2. Plan Implementation

    • Read aistudio://docs/llm-decision-guide
    • Craft feature-specific prompt
  3. Implement & Deploy

    • Send prompt to Gemini
    • Wait for implementation
    • Deploy and verify

Reference: Use add-ai-features prompt

Critical Timing Patterns

⏱️ Gemini Implementation: Minimum 90 seconds, typical 2-5 minutes ⏱️ Dialog Loading: 8-10 seconds for GitHub/Deploy dialogs ⏱️ Deployment: ~60 seconds for Cloud Run deployment ⏱️ Verification: 3 seconds between retry checks

Source: All timing patterns documented in aistudio://docs/browser-automation-reference

Troubleshooting

Common Issues

Authentication Fails

  • Delete ~/.playwright/aistudio_auth_state.json
  • Run aistudio_login again
  • Ensure browser allows cookies

Implementation Times Out

  • Increase timeout_seconds parameter
  • Verify Gemini prompt is clear
  • Check browser is still open

Repository Creation Fails

  • Verify GitHub integration in AI Studio
  • Check repository name uniqueness
  • Ensure you have GitHub permissions

Deployment Fails

  • Verify Google Cloud project ID
  • Check Cloud Run permissions
  • Review project quotas

Use Troubleshooting Prompt

Prompt: troubleshoot-workflow
Arguments:
  - issue_description: "Describe your issue here"

This will guide you through debugging with references to:

  • aistudio://docs/best-practices-antipatterns
  • aistudio://docs/browser-automation-reference

Development

Project Structure

src/aistudio/
├── src/mcp_server_aistudio/
│   ├── __init__.py          # Package exports
│   ├── __main__.py          # Entry point
│   ├── server.py            # MCP server (tools, resources, prompts)
│   ├── automation.py        # Playwright automation (AIStudioAutomation class)
│   └── config.py            # Configuration constants
├── docs/                    # Documentation (exposed as MCP resources)
│   ├── 00-start-here.md
│   ├── 01-workflow-new-project.md
│   ├── 02-workflow-existing-project.md
│   ├── 03-ai-features-catalog.md
│   ├── 04-browser-automation-reference.md
│   ├── 05-llm-decision-guide.md
│   ├── 06-best-practices-antipatterns.md
│   ├── 07-mcp-server-setup.md
│   └── 08-mcp-quick-reference.md
├── pyproject.toml
├── README.md
└── LICENSE

Running Tests

cd src/aistudio
uv run pytest

Running Locally

cd src/aistudio
uv run mcp-server-aistudio

License

MIT License - see LICENSE file for details

Contributing

Contributions welcome! Please ensure:

  1. All documentation is updated
  2. New tools have corresponding documentation resources
  3. Timing patterns follow established guidelines
  4. Tests pass

The MCP server exposes these as resources, but they're also available in docs/:

  • Start Here: Complete navigation guide
  • Workflows: New project and enhancement workflows
  • AI Features: Catalog of AI capabilities
  • Browser Automation: Playwright command reference
  • Best Practices: Anti-patterns and solutions
  • MCP Setup: Server configuration guide

Support

For issues, questions, or contributions:

  • Create an issue in the repository
  • Read aistudio://docs/best-practices-antipatterns for troubleshooting
  • Use the troubleshoot-workflow prompt for guided debugging

Version: 0.1.0 Status: Alpha MCP SDK: 1.0.0+ Python: 3.10+ Playwright: 1.40+

Release files for mcp-server-aistudio 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-server-aistudio 0.1.0
File Size Uploaded
mcp_server_aistudio-0.1.0.tar.gz 77.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-server-aistudio 0.1.0
File Interpreter ABI Platform
mcp_server_aistudio-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 92.3 kB

Release files / mcp_server_aistudio-0.1.0.tar.gz

Download URL mcp_server_aistudio-0.1.0.tar.gz
Size 77.4 kB
Tags Source
SHA-256 checksum
How to use checksums
09cd14763a2acdc7cbfa7296e2d0bb1f3936b8aa17909753e55a78f70ef12974
BLAKE2b-256 checksum
How to use checksums
01f26b8b3a3678c3f7863e7ffed8e36b9c03b695f5376fa3811659ee5c33be4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.1 cpython/3.10.19 HTTPX/0.28.1

Release files / mcp_server_aistudio-0.1.0-py3-none-any.whl

Download URL mcp_server_aistudio-0.1.0-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6dc0425c4be209be95fd9d1aaf455a853e4b8dc313a1b8009b3b8f008cbf1a7d
BLAKE2b-256 checksum
How to use checksums
08cdf1116e53937d44fd4a8bb29d5c7116ecb2aa594e5ccf1fdd26bf17631209
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.1 cpython/3.10.19 HTTPX/0.28.1

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page