mcp-telegram
v0.0.1
Published
MCP server to work with Telegram through MTProto
Maintainers
Readme
MCP Telegram (TypeScript)
A TypeScript version of MCP server to work with Telegram through MTProto.
Overview
This project provides a set of tools to interact with Telegram using the MTProto protocol, exposing functionality through a command-line interface and as a library.
Installation
# Install dependencies
npm install
# Build the project
npm run buildUsage
Command Line Interface
List available tools:
npm run start -- list-toolsCall a specific tool:
npm run start -- call-tool --name ListDialogs --arguments '{"unread": true}'Environment Variables
The application requires the following environment variables:
TELEGRAM_API_ID: Your Telegram API IDTELEGRAM_API_HASH: Your Telegram API Hash
These can be set in a .env file in the project root.
Development
Development requires Node.js version 18 or higher.
# Run in development mode
npm run dev
# Lint the code
npm run lint
# Run tests
npm run testAvailable Tools
ListDialogs
List available dialogs, chats and channels.
Parameters:
unread: Boolean, show only unread dialogs (default: false)archived: Boolean, include archived dialogs (default: false)ignorePinned: Boolean, ignore pinned dialogs (default: false)
ListMessages
List messages in a given dialog, chat or channel.
Parameters:
dialogId: Number, ID of the dialog to list messages fromunread: Boolean, show only unread messages (default: false)limit: Number, maximum number of messages to retrieve (default: 100)
License
[License information]
