{"id":39130106,"url":"https://github.com/mona-chen/jean","last_synced_at":"2026-01-17T21:16:05.216Z","repository":{"id":331225427,"uuid":"1119852762","full_name":"mona-chen/jean","owner":"mona-chen","description":"Official TMCP Server","archived":false,"fork":false,"pushed_at":"2026-01-15T16:45:56.000Z","size":475,"stargazers_count":0,"open_issues_count":15,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-15T16:51:24.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mona-chen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/Security_and_Rate_Limiting_Design.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-20T01:08:15.000Z","updated_at":"2026-01-15T16:46:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mona-chen/jean","commit_stats":null,"previous_names":["mona-chen/jean"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mona-chen/jean","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mona-chen%2Fjean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mona-chen%2Fjean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mona-chen%2Fjean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mona-chen%2Fjean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mona-chen","download_url":"https://codeload.github.com/mona-chen/jean/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mona-chen%2Fjean/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28518617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T18:55:29.170Z","status":"ssl_error","status_checked_at":"2026-01-17T18:55:03.375Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-17T21:16:04.493Z","updated_at":"2026-01-17T21:16:05.211Z","avatar_url":"https://github.com/mona-chen.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TMCP Server - Tween Mini-App Communication Protocol\n\nThe TMCP Server is a Rails-based Application Service that implements the Tween Mini-App Communication Protocol for secure communication between instant messaging applications and third-party mini-applications.\n\n## Architecture\n\nThis server implements the TMCP protocol as defined in [PROTO.md](docs/PROTO.md), providing:\n\n- **OAuth 2.0 + PKCE Authentication** with Matrix Authentication Service (MAS) integration\n- **Matrix Session Delegation** for authenticated users (RFC 8693)\n- **Device Authorization Grant** (RFC 8628) for new users\n- **Authorization Code Flow with PKCE** (RFC 7636) for web mini-apps\n- **TEP Token Management** for mini-app sessions\n- **Wallet Integration** with P2P transfers and payments\n- **Mini-App Storage** with quotas and TTL\n- **Matrix Application Service** for event routing\n- **Group Gift Distribution** and payment processing\n\n## Key Components\n\n- **Matrix Synapse**: `core.tween.im` (Homeserver)\n- **Matrix Authentication Service (MAS)**: `mas.tween.example` (OAuth Identity Provider)\n- **TMCP Server**: Current repository (Application Service)\n\n## Quick Start\n\n### Prerequisites\n\n- Ruby 3.4.4\n- PostgreSQL (production) or SQLite (development)\n- Matrix Synapse homeserver\n- Matrix Authentication Service (MAS) for OAuth 2.0\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone \u003crepository-url\u003e\ncd tmcp-server\n\n# Install dependencies\nbundle install\n\n# Set up environment variables\ncp .env.example .env\n# Edit .env with your MAS and Matrix configurations\n\n# Set up database\nrails db:setup\n\n# Run tests\nrails test\n\n# Start the server\nrails server\n```\n\n### Configuration\n\nKey environment variables:\n\n```bash\n# Matrix Authentication Service (MAS)\nMAS_URL=https://mas.tween.example\nMAS_CLIENT_ID=tmcp-server\nMAS_CLIENT_SECRET=your-client-secret\nMAS_TOKEN_URL=https://mas.tween.example/oauth2/token\nMAS_INTROSPECTION_URL=https://mas.tween.example/oauth2/introspect\nMAS_REVOCATION_URL=https://mas.tween.example/oauth2/revoke\n\n# Matrix Integration\nMATRIX_API_URL=https://core.tween.im\nMATRIX_HS_TOKEN=your-homeserver-token\n\n# Database\nDATABASE_URL=postgresql://user:pass@localhost/tmcp_production\n```\n\n## API Endpoints\n\n### OAuth 2.0 + PKCE\n- `GET /api/v1/oauth/authorize` - Authorization request (web mini-apps)\n- `POST /api/v1/oauth/token` - Token exchange (Matrix Session Delegation)\n- `POST /api/v1/oauth2/device/authorization` - Device authorization (RFC 8628)\n- `POST /api/v1/oauth2/device/token` - Device token polling\n- `POST /api/v1/oauth/consent` - Scope consent approval\n\n### Wallet Operations\n- `GET /api/v1/wallet/balance` - Get wallet balance\n- `GET /api/v1/wallet/transactions` - Transaction history\n- `POST /api/v1/wallet/p2p/initiate` - P2P transfer\n- `GET /api/v1/wallet/resolve/:user_id` - User resolution\n\n### Payment Processing\n- `POST /api/v1/payments/request` - Payment request\n- `POST /api/v1/payments/:id/authorize` - Payment authorization\n- `POST /api/v1/payments/:id/mfa/verify` - MFA verification\n\n### Mini-App Storage\n- `GET /api/v1/storage` - List storage entries\n- `POST /api/v1/storage` - Create storage entry\n- `GET /api/v1/storage/:key` - Get storage value\n- `PUT /api/v1/storage/:key` - Update storage value\n- `DELETE /api/v1/storage/:key` - Delete storage entry\n\n### Matrix AS Endpoints\n- `POST /_matrix/app/v1/transactions/:txn_id` - Event processing\n- `GET /_matrix/app/v1/users/:user_id` - User queries\n- `GET /_matrix/app/v1/rooms/:room_alias` - Room queries\n- `GET /_matrix/app/v1/ping` - Health check\n\n## Testing\n\n```bash\n# Run all tests\nrails test\n\n# Run specific test file\nrails test test/models/user_test.rb\n\n# Run with coverage\nrails test --verbose\n```\n\n## Documentation\n\nAll architectural documentation is available in the `docs/` directory:\n\n- [PROTO.md](docs/PROTO.md) - Complete protocol specification\n- [TMCP_Architecture_Plan.md](docs/TMCP_Architecture_Plan.md) - System architecture\n- [Deployment_Architecture_Design.md](docs/Deployment_Architecture_Design.md) - Deployment guide\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Add tests for new functionality\n4. Ensure all tests pass\n5. Submit a pull request\n\n## License\n\nCopyright (c) 2025 Tween IM. All rights reserved.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmona-chen%2Fjean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmona-chen%2Fjean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmona-chen%2Fjean/lists"}