MCPcopy Index your code
hub / github.com/NapGram/NapGram

github.com/NapGram/NapGram @v0.1.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.5 ↗ · + Follow
139 symbols 319 edges 95 files 11 documented · 8% updated 8d agov0.1.5 · 2026-01-08★ 44
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

简体中文 | English

NapGram

A modern QQ-Telegram message bridge powered by NapCat and mtcute

License: MIT Node.js TypeScript Release Build Codecov Release Downloads GHCR Image Last Commit Commit Activity Issues PRs Stars Forks

✨ Features

  • 🚀 Modern architecture: NapCat (QQ) + mtcute (Telegram), Fastify-based backend
  • 💬 Full message support: text, images, videos, audio, files, stickers, replies/forwards
  • 🛡️ Stability & monitoring: reconnect, recall sync, stats & latency metrics
  • 🐳 Docker ready: built-in Web Dashboard served from the container
  • Web Dashboard:
  • ✅ Built-in in the Docker image (default 8080, visit http://<host>:8080/)
  • 📊 Monitoring & statistics (overview, trends, latency)
  • ⚙️ Admin operations (instances/pairs/settings, logs & message queries)

🏗️ Tech Stack

Component Technology Notes
QQ adapter NapCat WebSocket-based protocol adapter
TG adapter mtcute Native MTProto (no Bot API proxy)
Language TypeScript 5.0+ Strict mode, end-to-end type safety
Frontend React 19 + Vite Tailwind CSS 4, Shadcn UI, Recharts
Runtime Node.js 25 (ESM) Modern module system
Persistence PostgreSQL + Prisma 7 Typed ORM, schema & migrations
Testing Vitest Unit tests

🚀 Quick Start

Prerequisites

  • Node.js 25+
  • PostgreSQL 14+
  • NapCat (required): deploy NapCatQQ and enable WebSocket
  • Network access from NapGram to NapCat

Docker (Recommended)

Note: NapGram requires connection to a deployed NapCat instance. Please ensure NapCat is running first.

# Clone the repository
git clone https://github.com/NapLink/NapGram.git
cd NapGram

# Copy and edit Docker Compose
cp compose.example.yaml docker-compose.yml
## Edit docker-compose.yml -> services.napgram.environment (required: TG_API_ID / TG_API_HASH / TG_BOT_TOKEN)

docker-compose pull
docker-compose up -d

NapCat Configuration: - Ensure NapCat has WebSocket or HTTP interface enabled - Configure NAPCAT_WS_URL in docker-compose.yml - NapCat and NapGram must be in the same network or accessible to each other

Manual Installation

# Install dependencies
pnpm install

# Build
pnpm --filter=@napgram/app run build

# Start
pnpm --filter=@napgram/app start

📖 Documentation

  • GitHub Wiki: https://github.com/NapLink/NapGram/wiki
  • Changelog: https://github.com/NapLink/NapGram/wiki/Changelog
  • Plugins: https://github.com/NapLink/NapGram/wiki/Operations-Plugins
  • Upgrade & Migration (FAQ): https://github.com/NapLink/NapGram/wiki/Operations-Upgrade
  • Commands: https://github.com/NapLink/NapGram/wiki/Guide-Commands

📅 Changelog

📝 View Changelog

🎯 Enabled Features

Enabled plugins

  • ForwardFeature: forwarding core with dedup & advanced strategies
  • RecallFeature: bidirectional recall sync
  • MediaFeature: unified media download/transcoding
  • CommandsFeature: admin & management commands (send /help for full list)

Commands

See Wiki: https://github.com/NapLink/NapGram/wiki/Guide-Commands

🛠️ Development

# Install dependencies
pnpm install

# Development mode
pnpm --filter=@napgram/app run dev

# Type checking
pnpm --filter=@napgram/app run type-check

# Build
pnpm --filter=@napgram/app run build

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Credits

⚠️ Disclaimer

This project is for educational and personal use only. Please comply with the Terms of Service of QQ and Telegram.

⭐ Star History

Star History Chart


📧 Contact


Made with ❤️ by magisk317

Extension points exported contracts — how you extend this code

ReconnectOptions (Interface)
(no doc)
main/src/shared/services/ReconnectingWebSocket.ts

Core symbols most depended-on inside this repo

get
called by 67
main/src/shared/utils/cache.ts
set
called by 56
main/src/shared/utils/cache.ts
start
called by 23
main/src/domain/models/Instance.ts
connect
called by 21
main/src/shared/services/ReconnectingWebSocket.ts
has
called by 18
main/src/shared/utils/cache.ts
size
called by 16
main/src/shared/utils/cache.ts
load
called by 11
main/src/domain/models/Instance.ts
initialize
called by 10
main/src/features/FeatureManager.ts

Shape

Method 56
Function 55
Class 26
Enum 1
Interface 1

Languages

TypeScript100%

Modules by API surface

main/src/builtins.ts28 symbols
main/src/domain/models/Instance.ts18 symbols
main/src/infrastructure/clients/telegram/__tests__/client.test.ts14 symbols
main/src/shared/utils/cache.ts10 symbols
main/src/shared/services/ReconnectingWebSocket.ts10 symbols
main/src/features/FeatureManager.ts9 symbols
main/src/domain/models/TelegramSession.ts7 symbols
main/src/shared/utils/fastify.ts6 symbols
main/src/shared/utils/permission-checker.ts5 symbols
main/src/shared/services/WaitForMessageHelper.ts5 symbols
main/src/infrastructure/clients/qq/__tests__/NapCatAdapter.test.ts5 symbols
main/src/shared/utils/highLevelFunces.ts4 symbols

Datastores touched

napgramDatabase · 1 repos

For agents

$ claude mcp add NapGram \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact