Skip to main content

A Model Context Protocol server for Google AI Studio automation with Playwright, providing tools, resources, and prompts for end-to-end development workflows

Project description

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

Recommended: Standalone Script (No Installation Required)

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

Recommended: Standalone Script

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

Related Documentation

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+

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_aistudio-0.1.0.tar.gz (77.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_aistudio-0.1.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_aistudio-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_server_aistudio-0.1.0.tar.gz
  • Upload date:
  • Size: 77.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.1 cpython/3.10.19 HTTPX/0.28.1

File hashes

Hashes for mcp_server_aistudio-0.1.0.tar.gz
Algorithm Hash digest
SHA256 09cd14763a2acdc7cbfa7296e2d0bb1f3936b8aa17909753e55a78f70ef12974
MD5 79dc814de64c9ef0f3da1741c8adf52c
BLAKE2b-256 01f26b8b3a3678c3f7863e7ffed8e36b9c03b695f5376fa3811659ee5c33be4e

See more details on using hashes here.

File details

Details for the file mcp_server_aistudio-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_aistudio-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6dc0425c4be209be95fd9d1aaf455a853e4b8dc313a1b8009b3b8f008cbf1a7d
MD5 c0d973ccac67c465c26234a196e234fd
BLAKE2b-256 08cdf1116e53937d44fd4a8bb29d5c7116ecb2aa594e5ccf1fdd26bf17631209

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page