mcp_gmail_calender
This project demonstrates how to integrate a Langchain agent with multiple MCP servers, including Gmail and Google Calendar. It provides detailed setup instructions for running locally, including installing dependencies and configuring environment variables.
GitHub Stars
1
User Rating
Not Rated
Favorites
0
Views
40
Forks
0
Issues
0
Langchain MCP Agent
This project demonstrates a Langchain agent integrated with multiple MCP (Multi-tool Coordination Protocol) servers, including a custom Gmail MCP server, a Google Calendar MCP server, and other utility tools like math and search.
Setup and Running Locally
To run this project on your local system using uv, follow these steps:
Clone the repository:
git clone https://github.com/harshdabhi/mcp_gmail_calender.git cd mcp_gmail_calenderInstall
uv:If you don't have
uvinstalled, you can install it using pip:pip install uvOr, if you prefer a standalone executable, follow the instructions on the official
uvdocumentation.Install Python Dependencies:
Ensure you have all the necessary Python packages installed. From the project root, run:
uv pip install -r requirements.txtSet up Environment Variables (.env file):
Create a
.envfile in the root of your project and add yourGROQ_API_KEY:GROQ_API_KEY=your_groq_api_keyReplace
your_groq_api_keywith your actual Groq API key.Configure MCP Servers:
The project uses a
mcp_config/mcp_servers_file.jsonto configure the MCP servers. Ensure this file is correctly set up with the paths to your local MCP server implementations.Gmail MCP Server Setup:
For detailed instructions on how to enable and authenticate the Gmail MCP server, refer to its documentation:
https://glama.ai/mcp/servers/@GongRzhe/Gmail-MCP-ServerA common step involves moving your
gcp-oauth.keys.jsonto~/.gmail-mcp/and running annpxcommand for authentication:mkdir -p ~/.gmail-mcp/ mv <path_to_your_gcp-oauth.keys.json> ~/.gmail-mcp/ npx @gongrzhe/server-gmail-autoauth-mcp authNote: You need Node.js and npm installed for
npxto work. If you encounternpx: command not found, please install Node.js and npm (e.g., usingbrew install nodeon macOS).Google Calendar MCP Server Setup:
For detailed instructions on how to enable and use the Google Calendar MCP server, refer to its documentation:
https://glama.ai/mcp/servers/@cablate/mcp-google-calendarSimilar to Gmail, you might need to set up authentication and ensure
GOOGLE_CALENDAR_ID,GOOGLE_TIME_ZONE, andGOOGLE_CREDENTIALS_PATHare correctly configured, preferably via environment variables in your.envfile.Run the Langchain Agent:
Once all dependencies are installed and configurations are in place, you can run the Langchain agent:
python server/langchain_serverThis will start an interactive chat in your terminal. Type your queries, and the agent will respond using the configured MCP tools. Type
exitorquitto end the session.
LangSmith Tracing
This project is configured to use LangSmith for tracing agent interactions. To enable tracing, ensure you have the following environment variables set in your .env file:
LANGCHAIN_TRACING_V2=true
LANGCHAIN_API_KEY=your_langsmith_api_key
LANGCHAIN_PROJECT=your_project_name # Optional: Replace with your desired project name
Replace your_langsmith_api_key with your actual LangSmith API key.
After setting these variables, run the agent as described in step 8 of the "Setup and Running Locally" section. Your traces will automatically appear in your LangSmith account.
