MCP Google Contacts Server
This MCP server enables AI assistants to fully manage Google Contacts and search Google Workspace directories.
Contact Management (CRUD):
List contacts - View all contacts or filter by name (up to 100 results)
Get contact details - Retrieve full information using resource name or email address
Create contacts - Add new contacts with name, email, and phone (requires given name)
Update contacts - Modify existing contact information (requires resource name)
Delete contacts - Remove contacts using their resource name
Search contacts - Find contacts by name, email, or phone number
Google Workspace Directory:
List workspace users - Browse organization directory with optional search filtering (up to 50 results)
Search directory - Perform targeted searches to find specific members (up to 20 results)
Additional Features:
Other contacts - Access people you've interacted with but haven't formally added (up to 50 results)
Provides access to Google Contacts functionality, allowing users to list, search, create, update, and delete contacts, as well as search the Google Workspace directory and access 'Other Contacts'.
Requires a Google Cloud project with the People API enabled for authentication and access to Google's contact management capabilities.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Google Contacts Server find John Smith's contact details"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π MCP Google Contacts Server
A Machine Conversation Protocol (MCP) server that provides Google Contacts functionality, allowing AI assistants to manage contacts, search your organization's directory, and interact with Google Workspace. Much updated from its original by Gemini AI in Gemini CLI.
β¨ Features
List and search Google Contacts
Create, update, and delete contacts
Search Google Workspace directory
View "Other Contacts" (people you've interacted with but haven't added)
Access Google Workspace users in your organization
Related MCP server: MCP Google Contacts Server
π Installation
π Prerequisites
Python 3.12 or higher
Google account with contacts access
Google Cloud project with People API enabled
OAuth 2.0 credentials for Google API access
π¦ Installation from Source
To install the mcp-google-contacts-server as a Python package:
Clone the repository:
git clone https://github.com/rayanzaki/mcp-google-contacts-server.git cd mcp-google-contacts-serverRename the source directory: The package expects the source code to be in a directory named
mcp_google_contacts_server.mv src mcp_google_contacts_serverInstall the package: This will install the package and its dependencies, making the
mcp-google-contactscommand available in your PATH.pip install .Note: If you encounter import errors after installation, ensure that relative imports within the source files (
main.py,tools.py,google_contacts_service.py,formatters.py,config.py) are updated to use absolute imports (e.g.,from mcp_google_contacts_server.module_name import ...). This is typically handled automatically bypip install .but can sometimes require manual adjustment if the package structure is unusual.
π Authentication Setup
The server requires Google API credentials to access your contacts. You have several options:
π Option 1: Using a credentials.json file
Create a Google Cloud project and enable the People API
Create OAuth 2.0 credentials (Desktop application type)
Download the credentials.json file
Place it in one of these locations:
The root directory of this project
Your home directory (~/google-contacts-credentials.json)
Specify its location with the
--credentials-fileargument
π Option 2: Using environment variables
Set 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 account
Note: If your existing environment variables for Google OAuth client ID and client secret have different names (e.g., GOOGLE_OAUTH_CLIENT_ID), you can alias them in your .env file (e.g., GOOGLE_CLIENT_ID=$GOOGLE_OAUTH_CLIENT_ID) to ensure the server picks them up correctly.
Use e.g. export GOOGLE_CLIENT_ID=$GOOGLE_OAUTH_CLIENT_ID && export GOOGLE_CLIENT_SECRET=$GOOGLE_OAUTH_CLIENT_SECRET in command line before: mcp-google-contacts :
env | grep GOOGLE
export GOOGLE_CLIENT_ID=$GOOGLE_OAUTH_CLIENT_ID && export GOOGLE_CLIENT_SECRET=$GOOGLE_OAUTH_CLIENT_SECRET
env | grep GOOGLE
mcp-google-contacts{authentication evocation should happen here)
π Initial Authorization (Recommended)
For the initial authorization flow to obtain your GOOGLE_REFRESH_TOKEN, it is recommended to run the mcp-google-contacts command directly in your terminal (outside of any MCP client that might obscure the interactive browser prompts).
Example:
mcp-google-contactsFollow the instructions in your terminal and browser to complete the authentication. Once the GOOGLE_REFRESH_TOKEN is displayed, you can set it as an environment variable for non-interactive use.
π οΈ Usage
πββοΈ Basic Startup
python src/main.py
# or
uv run src/main.pyThis starts the server with the default stdio transport.
βοΈ Command Line Arguments
Argument | Description | Default Value |
| Transport protocol to use ( |
|
| Host for HTTP transport |
|
| Port for HTTP transport |
|
| Google OAuth client ID (overrides environment variable) | - |
| Google OAuth client secret (overrides environment variable) | - |
| Google OAuth refresh token (overrides environment variable) | - |
| Path to Google OAuth credentials.json file | - |
π Examples
Start with HTTP transport:
python src/main.py --transport http --port 8080Use specific credentials file:
python src/main.py --credentials-file /path/to/your/credentials.jsonProvide credentials directly:
python src/main.py --client-id YOUR_CLIENT_ID --client-secret YOUR CLIENT_SECRET --refresh-token YOUR_REFRESH_TOKENπ Integration with MCP Clients
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": []
}
}
}π§° Available Tools
This MCP server provides the following tools:
Tool | Description |
| List all contacts or filter by name |
| Get a contact by resource name or email |
| Create a new contact |
| Update an existing contact |
| Delete a contact by resource name |
| Search contacts by name, email, or phone number |
| List Google Workspace users in your organization's directory |
| Search for people in the Google Workspace directory |
| Retrieve contacts from the 'Other contacts' section |
π Detailed Tool Descriptions
π list_contacts
Lists all your Google contacts or filters them by name.
Parameters:
name_filter(optional): String to filter contacts by namemax_results(optional): Maximum number of contacts to return (default: 100)
Example:
list_contacts(name_filter="John", max_results=10)π€ get_contact
Retrieves detailed information about a specific contact.
Parameters:
identifier: Resource name (people/*) or email address of the contact
Example:
get_contact("john.doe@example.com")
# or
get_contact("people/c12345678901234567")β create_contact
Creates a new contact in your Google Contacts.
Parameters:
given_name: First name of the contactfamily_name(optional): Last name of the contactemail(optional): Email address of the contactphone(optional): Phone number of the contact
Example:
create_contact(given_name="Jane", family_name="Smith", email="jane.smith@example.com", phone="+1-555-123-4567")βοΈ update_contact
Updates an existing contact with new information.
Parameters:
resource_name: Contact resource name (people/*)given_name(optional): Updated first namefamily_name(optional): Updated last nameemail(optional): Updated email addressphone(optional): Updated phone number
Example:
update_contact(resource_name="people/c12345678901234567", email="new.email@example.com")ποΈ delete_contact
Deletes a contact from your Google Contacts.
Parameters:
resource_name: Contact resource name (people/*) to delete
Example:
delete_contact(resource_name="people/c12345678901234567")π search_contacts
Searches your contacts by name, email, or phone number.
Parameters:
query: Search term to find in contactsmax_results(optional): Maximum number of results to return (default: 10)
Example:
search_contacts(query="john", max_results=5)π’ list_workspace_users
Lists Google Workspace users in your organization's directory.
Parameters:
query(optional): Search term to find specific usersmax_results(optional): Maximum number of results to return (default: 50)
Example:
list_workspace_users(query="engineering", max_results=25)π search_directory
Performs a targeted search of your organization's Google Workspace directory.
Parameters:
query: Search term to find specific directory membersmax_results(optional): Maximum number of results to return (default: 20)
Example:
search_directory(query="product manager", max_results=10)π₯ get_other_contacts
Retrieves contacts from the 'Other contacts' section - people you've interacted with but haven't added to your contacts.
Parameters:
max_results(optional): Maximum number of results to return (default: 50)
Example:
get_other_contacts(max_results=30)π Permissions
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.
β Troubleshooting
π Authentication Issues: Ensure your credentials are valid and have the necessary scopes
β οΈ API Limits: Be aware of Google People API quota limits
π Logs: Check the console output for error messages and debugging information
π₯ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
π License
This project is licensed under the MIT License - see the LICENSE file for details.
Available Tools
9 toolscreate_contactB
Create a new contact.
Args:
given_name: First name of the contact
family_name: Last name of the contact
email: Email address of the contact
phone: Phone number of the contact
Inputs: given_name (required), family_name, email, phone. Returns: result
delete_contactC
Delete a contact by resource name.
Args:
resource_name: Contact resource name (people/*) to delete
Inputs: resource_name (required). Returns: result
get_contactB
Get a contact by resource name or email.
Args:
identifier: Resource name (people/*) or email address of the contact
Inputs: identifier (required). Returns: result
get_other_contactsB
Retrieve contacts from the 'Other contacts' section.
Other contacts are people you've interacted with but haven't added to your contacts list.
These often include email correspondents that aren't in your main contacts.
Args:
max_results: Maximum number of results to return (default: 50)
Inputs: max_results. Returns: result
list_contactsB
List all contacts or filter by name.
Args:
name_filter: Optional filter to find contacts by name
max_results: Maximum number of results to return (default: 100)
Inputs: name_filter, max_results. Returns: result
list_workspace_usersB
List Google Workspace users in your organization's directory.
This tool allows you to search and list users in your Google Workspace directory,
including their email addresses and other information.
Args:
query: Optional search term to find specific users (name, email, etc.)
max_results: Maximum number of results to return (default: 50)
Inputs: query, max_results. Returns: result
search_contactsB
Search contacts by name, email, or phone number.
Args:
query: Search term to find in contacts
max_results: Maximum number of results to return (default: 10)
Inputs: query (required), max_results. Returns: result
search_directoryB
Search for people specifically in the Google Workspace directory.
This performs a more targeted search of your organization's directory.
Args:
query: Search term to find specific directory members
max_results: Maximum number of results to return (default: 20)
Inputs: query (required), max_results. Returns: result
update_contactC
Update an existing contact.
Args:
resource_name: Contact resource name (people/*)
given_name: Updated first name
family_name: Updated last name
email: Updated email address
phone: Updated phone number
Inputs: resource_name (required), given_name, family_name, email, +1 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 9 tools
Most tools have distinct purposes, but there is some potential confusion between list_contacts, search_contacts, and search_directory. The descriptions clarify that search_directory targets Google Workspace directory specifically, while search_contacts is broader, but an agent might initially struggle to choose between them for certain queries. The other tools (create, delete, get, update, get_other_contacts, list_workspace_users) are clearly differentiated.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., create_contact, list_contacts, search_directory). The naming is predictable and readable throughout, with no deviations in style or convention.
With 9 tools, this server is well-scoped for managing Google Contacts. It covers core CRUD operations (create, get, update, delete), listing and searching contacts, and includes specialized tools for other contacts and workspace users, which is appropriate for the domain without being overwhelming.
The tool surface provides complete coverage for the Google Contacts domain. It includes all essential CRUD operations (create, get, update, delete), multiple ways to retrieve contacts (list, search, get_other_contacts), and extends to workspace directory functionality. There are no obvious gaps that would hinder agent workflows.
Maintenance
Related MCP Connectors
Hosted Google Calendar MCP server for AI agents. No self-hosting or Google Cloud setup.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
MCP server for OnceAsk, the AI-native current-address layer for people and agents.
ppl personal CRM: contacts, relationship notes, birthdays and follow-ups for AI agents. Hosted MCP.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA full-featured Model Context Protocol server that gives AI assistants real-time access to Google Workspace services including Drive, Gmail, Calendar, Sheets, Docs, and Apps Script.2,330 PyPI12MIT
- AlicenseNot gradedqualityDmaintenanceGives AI assistants access to Google Contacts, supporting listing, searching, creating, updating, and deleting contacts, as well as searching Google Workspace directories.MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that integrates Google Contacts with Claude, enabling contact management directly from your AI assistant.MIT
- AlicenseNot gradedqualityBmaintenanceA CardDAV MCP server that exposes contacts and address books as tools for AI assistants.160 npm2MIT