This repository contains a full-stack integration of the Model Context Protocol (MCP) with three major tools:
- π Google Drive (read-only access)
- π Google Calendar (read/write access)
- ποΈ PostgreSQL (query and schema inspection)
- Node.js installed (version 14 or higher recommended)
- A Google account to access Google Cloud Console
- Go to the Google Cloud Console
- Click New Project, provide a name, and create it
- Select your project from the top dropdown
- Go to APIs & Services > Library
- Enable Google Drive API and Google Calendar API
- Go to APIs & Services > OAuth consent screen
- Choose Internal (Google Workspace) or External (personal Gmail)
- Fill out required fields
- Add scopes:
- Drive:
https://www.googleapis.com/auth/drive.readonly - Calendar:
https://www.googleapis.com/auth/calendar
- Drive:
- For External Testing mode, add your email under test users
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth Client ID
- Select Desktop App and create
- Download the JSON
- Rename it to
credentials.json - Place it in the
/backenddirectory
cd backend
npm install- Node.js (v14+)
- PostgreSQL (v12+)
- npm
PGHOST=localhost
PGPORT=5432
PGUSER=mcp_user
PGPASSWORD=mcp_password
PGDATABASE=mcp_demo
npm run setupThis script creates tables (users, products) and inserts test data.
psql -U postgres
CREATE USER mcp_user WITH PASSWORD 'mcp_password';
ALTER USER mcp_user WITH SUPERUSER;cd backend
npm startUse npx @modelcontextprotocol/inspector node server.js to inspect tools.
sqlQuery: Run SQL SELECT queries with optional paramslistTables: Show all accessible tablestableSchema: Return schema for selected table
list: List files/folders in a given Drive foldersearch: Search files in Driveread: Read content from supported file types
listCalendars: List all user calendarslistEvents: List events from calendargetEvent: Show detailed info about one event
- Dropdown to filter: files, folders, or all
- Integrated search bar to find Drive items
- File preview via MCP read tool
- External link opens files/folders in Google Drive
- Button to list all calendars
- Dropdown to select a calendar
- Button to list events from selected calendar
- Toggle to show detailed event metadata
- Dropdown to select table
- View schema for selected table
- SQL input to run queries
- Live preview of query results
- Only allows
SELECTqueries on SQL tool - All SQL queries are parameterized
- OAuth flow is scoped to read/write only what's necessary
token.jsonstores sensitive tokens and is gitignored
- Check
.envconfig and credentials.json placement - Ensure correct scopes in consent screen
- Delete
token.jsonand reauthenticate if refresh tokens fail - Use
console.logand backend logs to debug request flow
- Open a terminal and navigate to the
backenddirectory:
cd backend- Start the MCP server directly:
node server.jsThis step is required the first time to trigger the Google OAuth flow for authentication.
- After authentication completes and a
token.jsonfile is generated:
cd backend
npm install
node client.jscd frontend
npm install
npm startVisit: http://localhost:3000
- Python 3.9+
- PostgreSQL database
- Google Cloud Platform account (for OAuth)
cd backend/mcp-python-agent
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt- Enable Google Calendar and Drive APIs
- Create OAuth credentials
- Save the credentials as
token.jsonin project root
psql postgres -c "CREATE DATABASE medical_db;"
psql postgres -c "CREATE USER medical_user WITH PASSWORD 'medical_password';"
psql postgres -c "GRANT ALL PRIVILEGES ON DATABASE medical_db TO medical_user;"
psql -d medical_db -f medical_setup.sqlGOOGLE_API_KEY=your_api_key
DB_HOST=localhost
DB_PORT=5432
DB_NAME=medical_db
DB_USER=medical_user
DB_PASSWORD=medical_password
cd backend/mcp-python-agent
source .venv/bin/activate
python3 main.pymedical_querymedical_insertmedical_update
calendar_checkcalendar_createcalendar_update
drive_searchdrive_uploaddrive_share
> I need to see a cardiologist
> Schedule appointment with Dr. Smith
> Register as a new patient
- Check
.envconfiguration and DB connectivity - Ensure
token.jsonis valid - Verify dependencies are installed