Implements comprehensive Docker support to eliminate Python version and dependency concerns. Users can now run the MCP server in a container with automatic path translation between host and container filesystems. Key features: - Dockerfile with multi-architecture support (amd64/arm64) - Automatic path translation using WORKSPACE_ROOT environment variable - Setup scripts for all platforms (Bash, CMD, PowerShell) - GitHub Actions workflow for automated Docker Hub publishing - Secure non-root container execution - Read-only volume mounts by default The setup process is now simplified to: 1. Run setup-docker-env script to generate .env and Claude config 2. Build the Docker image 3. Copy generated config to Claude Desktop No Python installation or virtual environment management required. Fixes #3 Co-Authored-By: Claude <noreply@anthropic.com>
64 lines
2.1 KiB
PowerShell
64 lines
2.1 KiB
PowerShell
# PowerShell script to set up .env file for Docker usage on Windows
|
|
|
|
Write-Host "Setting up .env file for Gemini MCP Server Docker..."
|
|
|
|
# Get the current working directory (absolute path)
|
|
$CurrentDir = Get-Location
|
|
|
|
# Check if .env already exists
|
|
if (Test-Path .env) {
|
|
Write-Host "Warning: .env file already exists! Skipping creation." -ForegroundColor Yellow
|
|
Write-Host ""
|
|
} else {
|
|
# Create the .env file
|
|
@"
|
|
# Gemini MCP Server Docker Environment Configuration
|
|
# Generated on $(Get-Date)
|
|
|
|
# The absolute path to your project root on the host machine
|
|
# This should be the directory containing your code that you want to analyze
|
|
WORKSPACE_ROOT=$CurrentDir
|
|
|
|
# Your Gemini API key (get one from https://makersuite.google.com/app/apikey)
|
|
# IMPORTANT: Replace this with your actual API key
|
|
GEMINI_API_KEY=your-gemini-api-key-here
|
|
|
|
# Optional: Set logging level (DEBUG, INFO, WARNING, ERROR)
|
|
# LOG_LEVEL=INFO
|
|
"@ | Out-File -FilePath .env -Encoding utf8
|
|
|
|
Write-Host "Created .env file" -ForegroundColor Green
|
|
Write-Host ""
|
|
}
|
|
|
|
Write-Host "Next steps:"
|
|
Write-Host "1. Edit .env and replace 'your-gemini-api-key-here' with your actual Gemini API key"
|
|
Write-Host "2. Run 'docker build -t gemini-mcp-server .' to build the Docker image"
|
|
Write-Host "3. Copy this configuration to your Claude Desktop config:"
|
|
Write-Host ""
|
|
Write-Host "===== COPY BELOW THIS LINE =====" -ForegroundColor Cyan
|
|
Write-Host @"
|
|
{
|
|
"mcpServers": {
|
|
"gemini": {
|
|
"command": "docker",
|
|
"args": [
|
|
"run",
|
|
"--rm",
|
|
"-i",
|
|
"--env-file", "$CurrentDir\.env",
|
|
"-v", "${CurrentDir}:/workspace:ro",
|
|
"gemini-mcp-server:latest"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
"@
|
|
Write-Host "===== COPY ABOVE THIS LINE =====" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
Write-Host "Config file location:"
|
|
Write-Host " Windows: %APPDATA%\Claude\claude_desktop_config.json"
|
|
Write-Host ""
|
|
Write-Host "Note: The configuration above mounts the current directory ($CurrentDir)"
|
|
Write-Host "as the workspace. You can change this path to any project directory you want to analyze."
|
|
Write-Host "Docker on Windows accepts both forward slashes and backslashes in paths." |