The MCP Google Contacts Server enables AI assistants to manage Google Contacts and interact with Google Workspace by providing tools for creating, listing, updating, and searching contacts in your Google account or organization directory.
Install uv if you don't have it already:
pip install uv
Clone the repository:
git clone https://github.com/rayanzaki/mcp-google-contacts-server.git
cd mcp-google-contacts-server
Create a virtual environment and install dependencies:
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
Clone the repository:
git clone https://github.com/rayanzaki/mcp-google-contacts-server.git
cd mcp-google-contacts-server
Install dependencies:
pip install -r requirements.txt
The server requires Google API credentials to access your contacts. You have several options:
--credentials-file
argumentSet the following environment variables:
GOOGLE_CLIENT_ID
: Your Google OAuth client IDGOOGLE_CLIENT_SECRET
: Your Google OAuth client secretGOOGLE_REFRESH_TOKEN
: A valid refresh token for your accountpython src/main.py
# or
uv run src/main.py
This starts the server with the default stdio transport.
Argument | Description | Default Value |
---|---|---|
--transport |
Transport protocol to use (stdio or http) | stdio |
--host |
Host for HTTP transport | localhost |
--port |
Port for HTTP transport | 8000 |
--client-id |
Google OAuth client ID (overrides environment variable) | - |
--client-secret |
Google OAuth client secret (overrides environment variable) | - |
--refresh-token |
Google OAuth refresh token (overrides environment variable) | - |
--credentials-file |
Path to Google OAuth credentials.json file | - |
Start with HTTP transport:
python src/main.py --transport http --port 8080
Use specific credentials file:
python src/main.py --credentials-file /path/to/your/credentials.json
Provide credentials directly:
python src/main.py --client-id YOUR_CLIENT_ID --client-secret YOUR CLIENT_SECRET --refresh-token YOUR_REFRESH_TOKEN
To use this server with MCP clients (like Anthropic's Claude with Cline), add it to your MCP configuration:
{
"mcpServers": {
"google-contacts-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-google-contacts-server",
"run",
"main.py"
],
"disabled": false,
"autoApprove": []
}
}
}
This MCP server provides the following tools:
Tool | Description |
---|---|
list_contacts | List all contacts or filter by name |
get_contact | Get a contact by resource name or email |
create_contact | Create a new contact |
update_contact | Update an existing contact |
delete_contact | Delete a contact by resource name |
search_contacts | Search contacts by name, email, or phone number |
list_workspace_users | List Google Workspace users in your organization's directory |
search_directory | Search for people in the Google Workspace directory |
get_other_contacts | Retrieve contacts from the 'Other contacts' section |
Lists all your Google contacts or filters them by name.
Parameters:
Retrieves detailed information about a specific contact.
Parameters:
Creates a new contact in your Google Contacts.
Parameters:
Updates an existing contact with new information.
Parameters:
Deletes a contact from your Google Contacts.
Parameters:
Searches your contacts by name, email, or phone number.
Parameters:
Lists Google Workspace users in your organization's directory.
Parameters:
Performs a targeted search of your organization's Google Workspace directory.
Parameters:
Retrieves contacts from the 'Other contacts' section - people you've interacted with but haven't added to your contacts.
Parameters:
When first running the server, you'll need to authenticate with Google and grant the necessary permissions to access your contacts. The authentication flow will guide you through this process.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "google-contacts-server" '{"command":"uv","args":["--directory","/path/to/mcp-google-contacts-server","run","main.py"],"disabled":false,"autoApprove":[]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"google-contacts-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-google-contacts-server",
"run",
"main.py"
],
"disabled": false,
"autoApprove": []
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"google-contacts-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-google-contacts-server",
"run",
"main.py"
],
"disabled": false,
"autoApprove": []
}
}
}
3. Restart Claude Desktop for the changes to take effect