Skip to content

Commit c092488

Browse files
authored
feat: google calendar mcp server (#699)
* chore: init google calendar mcp server * enhance: improve details, add readme, add example client * feat: unit-test cases with pytest * readme update * remove legacy tool * remove from index.yaml * fix typo * fix default MCP server path value * fix: add support to uvx * fix: support stdio * fix: update project url * adapt to latest changes, add dockerfile * fix: pytest * fix: mask error details * fix: remove unnecessary reading from os.getnev * add github action to build
1 parent f5d2fa9 commit c092488

19 files changed

+2956
-1235
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build release google-calendar
2+
3+
permissions:
4+
id-token: write
5+
contents: read
6+
packages: write
7+
8+
on:
9+
workflow_dispatch:
10+
push:
11+
paths:
12+
- 'google/calendar/**'
13+
branches:
14+
- main
15+
16+
jobs:
17+
oss-tools-build:
18+
runs-on: depot-ubuntu-22.04
19+
concurrency:
20+
group: google-calendar-build
21+
cancel-in-progress: true
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Log in to GitHub Container Registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ghcr.io
29+
username: ${{ secrets.GHCR_USERNAME }}
30+
password: ${{ secrets.GHCR_TOKEN }}
31+
32+
- name: Build and Push Docker image
33+
uses: depot/build-push-action@v1
34+
id: build-and-push
35+
with:
36+
project: bbqjs4tj1g
37+
context: ./google/calendar
38+
push: true
39+
pull: true
40+
platforms: linux/amd64,linux/arm64
41+
tags: |
42+
ghcr.io/${{ github.repository }}/google-calendar:latest
43+
44+
- name: Install Cosign
45+
uses: sigstore/[email protected]
46+
with:
47+
cosign-release: 'v2.4.3'
48+
49+
- name: Sign Images
50+
env:
51+
DIGEST: ${{ steps.build-and-push.outputs.digest }}
52+
TAGS: ghcr.io/${{ github.repository }}/google-calendar:latest
53+
run: |
54+
images=""
55+
for tag in ${TAGS}; do
56+
images+="${tag}@${DIGEST} "
57+
done
58+
cosign sign --yes ${images}

google/calendar/.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

google/calendar/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
2+
3+
# Prevents Python from writing .pyc files and buffers stdout/stderr
4+
ENV PYTHONDONTWRITEBYTECODE=1 \
5+
PYTHONUNBUFFERED=1
6+
7+
WORKDIR /app
8+
9+
# Install system deps (if any needed) - using apt for Debian
10+
RUN apt-get update && apt-get install -y --no-install-recommends \
11+
build-essential \
12+
git \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
# Copy uv project files first for better Docker layer caching
16+
COPY pyproject.toml uv.lock ./
17+
18+
# Copy your application code (needed for local package build)
19+
COPY . .
20+
21+
# Install dependencies using uv sync (faster and more reliable)
22+
RUN uv sync --frozen --no-dev --no-editable
23+
24+
EXPOSE 9000
25+
26+
# Start the server using uv run (ensures proper virtual environment)
27+
CMD ["uv", "run", "python", "-m", "app.server"]

google/calendar/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Obot Google Calendar MCP Server
2+
3+
- supports streamable HTTP and stdio
4+
5+
## Installation & Running
6+
7+
### Docker-compose (Recommended)
8+
Export (Google's) Oauth CLient ID and Secret for Oauth Proxy
9+
```bash
10+
export OAUTH_CLIENT_ID=xxx
11+
export OAUTH_CLIENT_SECRET=xxx
12+
```
13+
14+
then:
15+
```bash
16+
docker-compose up
17+
```
18+
19+
### Using uvx
20+
install from local directory:
21+
```bash
22+
uvx --from . google-calendar-mcp
23+
```
24+
25+
### Using uv (Development)
26+
Install dependencies:
27+
```bash
28+
uv pip install
29+
```
30+
31+
Run the server:
32+
```bash
33+
uv run server.py
34+
```
35+
36+
## Testing
37+
38+
### Unit-test with pytest
39+
```bash
40+
uv run python -m pytest
41+
```
42+
43+
### Integration Testing
44+
45+
#### Get Your Access Token
46+
This MCP server assumes Obot will take care of the Oauth2.0 flow and supply an access token. To test locally or without Obot, you need to get an access token by yourself. I use [postman workspace](https://blog.postman.com/how-to-access-google-apis-using-oauth-in-postman/) to create and manage my tokens.
47+
48+
#### Local Example Client
49+
```
50+
export GOOGLE_OAUTH_TOKEN=xxx
51+
```
52+
and then
53+
```
54+
uv run example_client.py
55+
```

google/calendar/app/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)