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 guideaistudio://docs/workflow-new-project- Complete new project lifecycleaistudio://docs/workflow-existing-project- Enhancement workflowaistudio://docs/ai-features-catalog- AI capabilities referenceaistudio://docs/browser-automation-reference- Playwright commandsaistudio://docs/llm-decision-guide- Decision-making frameworkaistudio://docs/best-practices-antipatterns- Troubleshooting guideaistudio://docs/mcp-server-setup- Server configurationaistudio://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
- Playwright: Install and setup browsers
playwright install chromium
-
Google Account: Access to Google AI Studio and Google Cloud Platform
-
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:
- Guide you through the complete workflow
- Create AI Studio project with Gemini implementation
- Set up GitHub repository
- Deploy to Google Cloud Run
- 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
-
Authentication (one-time)
- Tool:
aistudio_login
- Tool:
-
Project Creation
- Manually create project in AI Studio
- Send implementation prompt to Gemini
- Tool:
aistudio_wait_for_implementation(90+ seconds)
-
Repository Setup
- Edit project name with UUID prefix
- Tool:
aistudio_create_repo
-
Deployment
- Tool:
aistudio_commit_and_deploy - Wait ~60 seconds for deployment
- Tool:
-
Local Development
- Tool:
aistudio_clone_repository - Review and iterate
- Tool:
Reference: Read aistudio://docs/workflow-new-project
Enhancing Existing Project
Time: ~10-15 minutes per enhancement
- Navigate to existing project URL
- Describe enhancement to Gemini
- Tool:
aistudio_wait_for_implementation - Tool:
aistudio_commit_and_deploy - Verify deployed application
Reference: Read aistudio://docs/workflow-existing-project
Adding AI Features
Time: Varies (5-15 minutes)
-
Explore Features
- Read
aistudio://docs/ai-features-catalog - Available: voice, chatbots, TTS, images, video, maps, search
- Read
-
Plan Implementation
- Read
aistudio://docs/llm-decision-guide - Craft feature-specific prompt
- Read
-
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_loginagain - Ensure browser allows cookies
Implementation Times Out
- Increase
timeout_secondsparameter - 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-antipatternsaistudio://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:
- All documentation is updated
- New tools have corresponding documentation resources
- Timing patterns follow established guidelines
- 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-antipatternsfor troubleshooting - Use the
troubleshoot-workflowprompt for guided debugging
Version: 0.1.0 Status: Alpha MCP SDK: 1.0.0+ Python: 3.10+ Playwright: 1.40+
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09cd14763a2acdc7cbfa7296e2d0bb1f3936b8aa17909753e55a78f70ef12974
|
|
| MD5 |
79dc814de64c9ef0f3da1741c8adf52c
|
|
| BLAKE2b-256 |
01f26b8b3a3678c3f7863e7ffed8e36b9c03b695f5376fa3811659ee5c33be4e
|
File details
Details for the file mcp_server_aistudio-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_server_aistudio-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.1 cpython/3.10.19 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dc0425c4be209be95fd9d1aaf455a853e4b8dc313a1b8009b3b8f008cbf1a7d
|
|
| MD5 |
c0d973ccac67c465c26234a196e234fd
|
|
| BLAKE2b-256 |
08cdf1116e53937d44fd4a8bb29d5c7116ecb2aa594e5ccf1fdd26bf17631209
|