Sense Family MCP
Authenticates ChatGPT users through Amazon Cognito using OAuth with PKCE, validating access tokens and binding each OAuth client to a Cognito identity to secure access to the gateway.
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., "@Sense Family MCPwhat's on our family calendar this weekend?"
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.
Sense Family MCP for ChatGPT
An OAuth-protected AWS gateway that lets a small, explicitly invited group use the Sense family calendar MCP server from ChatGPT without giving ChatGPT the underlying Sense API key.
Sense authenticates its MCP endpoint with a bearer API key. ChatGPT custom apps expect a remote MCP server with OAuth. This project bridges those two models: ChatGPT authenticates each adult through Amazon Cognito, the gateway validates the resulting access token, and only then does it substitute the encrypted Sense key for the upstream request.
The reference deployment has been tested end to end with ChatGPT Pro. OAuth
code exchange and the upstream tools/list call succeeded, and ChatGPT
discovered all twelve allowed actions. No calendar or reminder record was read
or changed during that verification.
This is a private family-data gateway, not a public proxy. Deploy your own
stack, invite only the intended users, and never commit a Sense key or.env
file. This project is not affiliated with Sense or OpenAI.
Architecture
ChatGPT account A ── OAuth + PKCE ──┐
├── Amazon Cognito
ChatGPT account B ── OAuth + PKCE ──┘ │
│ short-lived JWT
▼
CloudFront distribution
- disables caching
- restores OAuth challenge headers
│
▼
Lambda Function URL
- validates JWT claims
- binds client to user
- enforces scopes
- filters MCP tools
- selects encrypted key
│
│ Sense bearer key
▼
https://api.getsense.ai/mcp/CloudFront is used because Lambda Function URLs do not preserve the
standards-required WWW-Authenticate response header in the form ChatGPT needs
for OAuth discovery. A small CloudFront response function restores the header;
the Lambda remains the authentication and authorization boundary.
Related MCP server: Google Calendar MCP Server
Security model
Cognito public clients use authorization code flow with PKCE
S256.Self-registration is disabled; the deployment creates only invited users.
Cognito managed login v2 binds the canonical MCP resource URL into the access token audience.
The gateway verifies signature, issuer, audience, expiry, token type, OAuth client, Cognito username, and required scope.
Each OAuth client is bound to one Cognito identity and one explicitly selected SSM parameter path.
Sense keys are encrypted
SecureStringparameters and never enter the CloudFormation template, Git history, Lambda environment, or application logs.The inbound ChatGPT access token is never forwarded to Sense.
Both advertised tools and guessed
tools/callrequests are allowlisted.Request bodies, response bodies, calendar content, names, OAuth codes, and credentials are excluded from logs. Logs expire after seven days.
Lambda reserved concurrency is capped at five.
An optional AWS Budget sends alerts around a USD 1 monthly threshold.
The OAuth implementation follows the official OpenAI authentication guidance: protected-resource metadata, authorization-server metadata, resource indicators, PKCE, exact redirect URIs, audience validation, and per-request token verification.
Allowed actions
Read actions:
get_family_membersget_eventssearch_eventsget_reminderssearch_remindersget_reminder_by_id
Optional write actions:
create_eventupdate_eventcreate_remindercreate_remindersupdate_remindercomplete_reminder
Delete, account, billing, family-management, import, bulk-mutation, and other
Sense tools remain blocked. Write actions are enabled only when the stack is
deployed with -EnableWrites true.
Prerequisites
An AWS account
AWS CLI v2 authenticated with a named profile
Node.js 22 or newer
PowerShell 7 or Windows PowerShell
One Sense API key for a shared family identity, or one key per adult
ChatGPT accounts that can create custom MCP apps
The included deployment scripts currently pin AWS resources to us-east-2.
Local verification
npm ci
npm run checknpm run check runs the Node test suite and builds the Lambda bundle in
dist/index.cjs.
The tests cover OAuth discovery, token-proxy redaction, JWT audience checks, client/user binding, origin restrictions, read/write scopes, tool filtering, blocked guessed tools, and replacement of the inbound token with the selected Sense key.
Deploy to AWS
1. Authenticate the AWS CLI
The scripts default to the profile sense-mcp:
aws configure sso --profile sense-mcp
aws sso login --profile sense-mcpAny AWS authentication method that makes the profile usable is fine. Confirm it before deploying:
aws sts get-caller-identity --profile sense-mcp --region us-east-22. Bootstrap the stack
The first deployment uses harmless placeholder values for the public MCP resource and ChatGPT callback URLs:
.\scripts\deploy.ps1 -BudgetEmail 'your-alert-address@example.com'Copy the McpUrl output, then redeploy once so Cognito scopes and token
audiences use that exact CloudFront URL:
.\scripts\deploy.ps1 -McpResourceUrl '<McpUrl output>'On an existing stack, omitted resource URL, callback URL, key-path, budget, and write-mode arguments are read from CloudFormation and preserved. An ordinary redeploy therefore cannot silently reset working OAuth settings.
3. Invite the two Cognito users
.\scripts\create-users.ps1 `
-PrimaryEmail 'adult-a@example.com' `
-PartnerEmail 'adult-b@example.com'The intended user must complete the temporary-password change and MFA setup interactively. Do not automate or share those credentials.
4. Store the Sense key
Create a local file outside Git containing either a raw key or:
SENSE_API_KEY=sense_replace_with_a_real_keyUpload it directly to encrypted SSM Parameter Store:
node .\scripts\upload-sense-key.mjs `
--person primary `
--file C:\secure\path\sense.envFor separate adult Sense identities, upload a second key with
--person partner. To use one shared family key, map both OAuth clients to the
same encrypted parameter:
.\scripts\deploy.ps1 `
-PartnerKeyParameter '/sense-mcp/primary/key'The source key file should remain outside the repository and be deleted or secured after upload.
5. Enable the desired action set
Read-only is the deployment default. To expose the six reviewed write actions:
.\scripts\deploy.ps1 -EnableWrites trueThis does not expose Sense deletion or administrative actions.
Connect ChatGPT
Repeat this process separately in each ChatGPT account:
Enable developer mode in ChatGPT.
Open Plugins and choose Create app.
Select Server URL and enter the stack's
McpUrloutput.Select OAuth.
Open Advanced OAuth settings and confirm that the discovered scopes end with
/mcp/readand, when enabled,/mcp/write.Choose User-Defined OAuth Client and enter the matching
PrimaryClientIdorPartnerClientIdCloudFormation output.Keep the token endpoint authentication method set to
none.Copy the exact callback URL displayed by ChatGPT.
Before completing the connection, deploy that callback into Cognito:
.\scripts\deploy.ps1 -PrimaryCallbackUrl '<exact ChatGPT callback URL>'Use
-PartnerCallbackUrlfor the second account.Finish creating the app and sign in as the Cognito user bound to that client.
ChatGPT uses a callback-ID-specific redirect when the authorization server does not advertise RFC 9207 issuer identification. The callback must therefore be copied exactly from ChatGPT rather than guessed or shortened. See the OpenAI OAuth redirect guidance.
If OAuth scopes change after a ChatGPT app has already been created, create a
fresh app definition. ChatGPT can cache the old scope list, and repeatedly
reconnecting that old definition may continue to return invalid_scope.
Smoke tests and operations
Test the upstream Sense key without reading calendar content:
node .\scripts\smoke-upstream.mjsThat script calls only MCP initialize and tools/list and prints server
metadata plus the tool count.
Tail safe gateway logs:
aws logs tail /aws/lambda/sense-mcp-gateway `
--since 10m `
--profile sense-mcp `
--region us-east-2 `
--format shortRotate a Sense key by uploading the replacement to the same SSM parameter. New Lambda execution environments will use the new value. Revoke the old key in Sense after confirming the replacement works.
Cost
The design avoids a VPC, NAT gateway, API Gateway, load balancer, custom domain, and provisioned concurrency. At family-scale traffic it is intended to stay within or close to the free allowances for Cognito, Lambda, CloudFront, SSM standard parameters, and CloudWatch. AWS pricing changes, so verify current Cognito, Lambda, Systems Manager, CloudFront, and CloudWatch pricing for your account and region.
Repository layout
src/ Lambda gateway, JWT validation, and SSM access
test/ Node test suite
scripts/deploy.ps1 Build, package, and deploy the CloudFormation stack
scripts/create-users.ps1
scripts/upload-sense-key.mjs
scripts/smoke-upstream.mjs
template.yaml AWS SAM / CloudFormation infrastructure
PROPOSAL.md Architecture, threat model, costs, and rollout notesFor the detailed design rationale and acceptance criteria, see PROPOSAL.md.
License and support
No license is currently granted beyond the rights provided by GitHub's terms of service. This is a small personal project and comes without warranty or vendor support.
This server cannot be deployed
Maintenance
Related MCP Connectors
GDPR-compliant calendar access for AI assistants: read, create, edit, RSVP. Google, MS 365, Apple.
Connects ChatGPT to your Apple Calendar via a local Mac agent + Vercel relay
Calendar API for AI agents: events, availability, Google/Microsoft setup, scheduling, and iCal.
Family schedules and household tools with OAuth. External calendars remain read-only.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceEnables ChatGPT to interact with Google Calendar through a remote MCP server. Provides tools to list, create, update, and delete calendar events with OAuth authentication.-
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Google Calendar through the Google Calendar API. Supports listing calendars, creating/deleting events, and retrieving calendar events with OAuth2 authentication.-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Google Calendar by listing, creating, updating, and deleting events. It also includes functionality to find available time slots for scheduling.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Google Calendar events, including reading, searching, creating, updating, and deleting events, as well as checking availability and listing calendars.31MIT