{"id":48917872,"url":"https://github.com/stytchauth/chatagotchi","last_synced_at":"2026-04-17T03:35:29.340Z","repository":{"id":338627182,"uuid":"1071127196","full_name":"stytchauth/chatagotchi","owner":"stytchauth","description":"An interactive pet in ChatGPT using Apps SDK","archived":false,"fork":false,"pushed_at":"2026-03-13T17:24:45.000Z","size":3160,"stargazers_count":11,"open_issues_count":5,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-14T05:34:10.805Z","etag":null,"topics":["alpic","chatgpt","openai","stytch-auth","vercel"],"latest_commit_sha":null,"homepage":"https://chatagotchi.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stytchauth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-06T22:45:30.000Z","updated_at":"2025-12-30T00:22:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stytchauth/chatagotchi","commit_stats":null,"previous_names":["stytchauth/chatagotchi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stytchauth/chatagotchi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stytchauth%2Fchatagotchi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stytchauth%2Fchatagotchi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stytchauth%2Fchatagotchi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stytchauth%2Fchatagotchi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stytchauth","download_url":"https://codeload.github.com/stytchauth/chatagotchi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stytchauth%2Fchatagotchi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31913794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpic","chatgpt","openai","stytch-auth","vercel"],"created_at":"2026-04-17T03:35:26.262Z","updated_at":"2026-04-17T03:35:29.329Z","avatar_url":"https://github.com/stytchauth.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chatagotchi - OpenAI ChatGPT Apps SDK Demo\n\n[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cimg src=\"chatagotchi.png\" alt=\"Chatagotchi\" width=\"300\"\u003e\u003c/td\u003e\n\u003ctd\u003e\n\nA virtual pet game built with the Model Context Protocol (MCP) and OpenAI [Apps SDK](https://developers.openai.com/apps-sdk/). Raise pets, unlock achievements, and experience the nostalgia of digital companions—all inside ChatGPT.\nBuilt with [Stytch](https://stytch.com), [Alpic](https://alpic.ai), and [Vercel](https://vercel/com). \n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cdiv\u003e\n    \u003ca href=\"https://www.loom.com/share/eef58ead11f644c5a6a3ad30cb7279fc\"\u003e\n      \u003cp\u003eBuilding an Interactive ChatGPT Game with Stytch and Alpic - Watch Video\u003c/p\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.loom.com/share/eef58ead11f644c5a6a3ad30cb7279fc\"\u003e\n      \u003cimg style=\"max-width:300px;\" src=\"https://cdn.loom.com/sessions/thumbnails/eef58ead11f644c5a6a3ad30cb7279fc-39ee3aec7635a91d-full-play.gif\"\u003e\n    \u003c/a\u003e\n  \u003c/div\u003e\n\n## What is Chatagotchi?\n\nChatagotchi is an MCP server that brings interactive pet care to ChatGPT using the Apps SDK. Users can:\n\n- 🐣 Start a new game and raise different kinds of pets (bird, cat, dog, lizard, or fish)\n- 🍎 Feed their pet with different foods (apples, cookies, salad, pizza)\n- 🎮 Play activities (video games, running, skiing)\n- 🏆 Unlock 11 discovery achievements\n\n## Architecture\n\nChatagotchi uses a three-layer architecture:\n\n### MCP Server (`mcp_server_node/`)\nNode.js/TypeScript server that exposes game tools via the Model Context Protocol. Built with:\n- **Controllers** (`server.ts`) - MCP tool definitions for ChatGPT integration\n- **Business Logic** (`game-service.ts`) - Game state management and message generation\n- **Game Mechanics** (`game-logic.ts`) - Pure functions for pet actions, lifecycle, and achievements\n- **Authentication** - Stytch Connected Apps for MCP authentication\n\n### Website (`app/`)\nA traditional React SPA responsible for marketing, user signup, and OAuth authorization.\n- Hosted as standalone website on Vercel\n- Functions as an OAuth Authorization Server\n\n### Frontend Widgets (`widgets/`)\nReact components rendered inside ChatGPT via the Apps SDK:\n- **Pet Widget** - Displays pet emoji, name, stats, lifecycle stage, and action buttons\n- **Achievements Widget** - Gallery of locked/unlocked achievements with progress tracking\n- **Utilities** - Shared hooks for accessing OpenAI global context and widget state\n\n## Prerequisites\n\n- Node.js 18+\n- pnpm (recommended) or npm/yarn\n- Stytch, Alpic, and Vercel accounts\n\n## Deployment\n\nFork the repository in Github so you can connect your personal repository to Vercel and Alpic.\n\n### Vercel Setup\n1. Create a Vercel account at https://vercel.com/\n2. Grant Vercel access to your forked repository, and deploy it\n3. Remember your Vercel domain, which will look like `https://chatagotchi-$adjective.vercel.app`\n\n### Stytch Setup\n\n1. Create a Stytch account at https://stytch.com\n2. Create a \"Consumer\" project and get your credentials from the Project Overview page\n   - You'll need the `STYTCH_PROJECT_ID`, `STYTCH_SECRET`, `STYTCH_DOMAIN`, and `STYTCH_PUBLIC_TOKEN` for later\n3. Navigate to Frontend SDK\n   - Enable the Javascript SDK, and add your Vercel domain as an approved domain\n4. Navigate to Connected Apps \u003e Settings\n   - Enable Dynamic Client Registration\n   - Set `${VERCEL_DOMAIN}/oauth/authorize` as your project Authorization URL\n5. Return to Vercel. Set your `STYTCH_PUBLIC_TOKEN` as a `VITE_STYTCH_PUBLIC_TOKEN` environment variable\n\n### Alpic Setup\n\n1. Create an Alpic account at https://alpic.ai\n2. Grant Alpic access to your forked repository\n3. Configure the following build settings:\n   - Build Command: `pnpm run build:mcp` \n   - Output Directory: `./`\n   - Start Command: `pnpm run --silent start:mcp`\n4. Configure the following environment variables:\n   - `STYTCH_PROJECT_ID` - your project ID from Stytch\n   - `STYTCH_PROJECT_SECRET` - your project secret from Stytch\n   - `STYTCH_DOMAIN` - your project domain from Stytch\n   - `FRONTEND_DOMAIN` - your Vercel Domain\n5. Redeploy the MCP server to ensure all settings have been applied\n\n## Testing in ChatGPT\n\nTo add Chatagotchi to ChatGPT:\n\n1. Enable [developer mode](https://platform.openai.com/docs/guides/developer-mode)\n2. Add the ngrok URL to ChatGPT: **Settings \u003e Connectors**\n   - Use the MCP endpoint: `https://chatagotchi-xxxxx.alpic.live`\n\nOnce connected, try saying \"Let's start a brand new chatagotchi game\" to get started.\n\n## Local Development\n\n### Build the Frontend Widgets\n\nBuild widgets into static assets for deployment:\n\n```bash\npnpm run build\n```\n\nThis produces versioned `.html`, `.js`, and `.css` files in `assets/`. Each widget is self-contained with its own styles.\n\nFor local development with hot reload:\n\n```bash\npnpm run dev\n```\n\nThe dev server runs on `http://localhost:4444`\n\n### Run the MCP Server\n\nStart the MCP server:\n\n```bash\npnpm start:mcp\n```\n\n## Contributing\n\nContributions are welcome! Open an issue or submit a PR to improve the game.\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstytchauth%2Fchatagotchi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstytchauth%2Fchatagotchi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstytchauth%2Fchatagotchi/lists"}