add stdio support and startup flag

This commit is contained in:
Taylor Wilsdon
2025-06-07 14:04:04 -04:00
parent 5a95e52426
commit 07dace0dea
2 changed files with 38 additions and 8 deletions

View File

@@ -77,9 +77,12 @@ uv run main.py
### Start the Server
```bash
# HTTP mode (recommended)
# Default (stdio mode for MCP clients)
uv run main.py
# HTTP mode (for web interfaces and debugging)
uv run main.py --transport streamable-http
# Single-user mode (simplified authentication)
uv run main.py --single-user
@@ -90,13 +93,16 @@ uv run main.py --single-user --tools gmail # Can combine with other flags
# Docker
docker build -t google-workspace-mcp .
docker run -p 8000:8000 -v $(pwd):/app google-workspace-mcp
docker run -p 8000:8000 -v $(pwd):/app google-workspace-mcp --transport streamable-http
```
**Available Tools for `--tools` flag**: `gmail`, `drive`, `calendar`, `docs`, `sheets`, `chat`
### Connect to Claude Desktop
The server supports two transport modes:
#### Stdio Mode (Default - Recommended for Claude Desktop)
**Option 1: Auto-install (Recommended)**
```bash
python install_claude.py
@@ -109,6 +115,21 @@ python install_claude.py
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
3. Add the server configuration:
```json
{
"mcpServers": {
"google_workspace": {
"command": "uv",
"args": ["run", "main.py"],
"cwd": "/path/to/google_workspace_mcp"
}
}
}
```
#### HTTP Mode (For debugging or web interfaces)
If you need to use HTTP mode with Claude Desktop:
```json
{
"mcpServers": {
@@ -120,6 +141,8 @@ python install_claude.py
}
```
*Note: Make sure to start the server with `--transport streamable-http` when using HTTP mode.*
### First-Time Authentication
When calling a tool: