telegram-bot-framework-mcp
Indexes and provides access to the source code and documentation of the TelegramBotBase package, which is the underlying library for the TelegramBotFramework.
Provides comprehensive tools to read and understand the real source, documentation, and API changes of the TelegramBotFramework, enabling AI assistants to assist in developing Telegram bots.
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., "@telegram-bot-framework-mcpHow do I persist user sessions across restarts? Check the state machine classes."
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.
telegram-bot-framework-mcp
An MCP server that lets an AI assistant read the real source, docs and API changes of
MajMcCloud/TelegramBotFramework (NuGet: TelegramBotBase).
It ships as a Docker image with the framework source baked in, pinned to 8.0.0-preview.2 (development branch, commit 6780abf), together with a curated how-to guide.
Warning: 8.0.0-preview.2 is a preview; its API can still change before 8.0.0. The builder in this version has an extra request dispatcher stage that does not exist in 7.x, so code from the guide will not compile against 7.2.0. To serve 7.2.0 instead, build with
--build-arg TGBOTBASE_REF=13fff09c2736e4616f1d3c5dffe40401b92c81b0 --build-arg TGBOTBASE_NUGET_VERSION=7.2.0and expect the guide's dispatcher parts to be wrong.
Contents: Quick start · Tools · Example prompts · Hosting on a VPS · Upgrading the framework version · CI and publishing
Quick start
Pick one way to connect. Both give the assistant the same tools.
Local (stdio, no token)
claude mcp add tgbotbase -- docker run -i --rm severnbli/telegram-bot-framework-mcp:8.0.0-preview.2Warning: keep the
-iflag. Without it the container's stdin closes and the connection fails immediately.
Hosted (HTTP)
The public instance needs no token:
claude mcp add --transport http tgbotbase https://tbf-mcp.severnbli.dev/mcpIf the server owner enabled a token, add --header "Authorization: Bearer <token>".
Note: the public instance is a free, read-only, best-effort service: rate limited, no uptime guarantee. For reliability, run the local image or host your own.
See Hosting on a VPS to run your own copy.
Other MCP clients
Use the URL above (plus the Authorization header if a token is enabled), or this stdio config:
{ "mcpServers": { "tgbotbase": { "command": "docker",
"args": ["run", "-i", "--rm", "severnbli/telegram-bot-framework-mcp:8.0.0-preview.2"] } } }Check it works
Run /mcp in Claude Code, or ask: "What framework version does tgbotbase serve?"
The answer should mention 8.0.0-preview.2 and commit 6780abf.
Tip: pin the image tag (
:8.0.0-preview.2) in your client config. Prereleases never get thelatesttag.
Related MCP server: Simple Code Review Assistant
Tools
Tool | Use it to |
| See the TelegramBotBase version, commit and dependencies (e.g. |
| Browse and read README sections (Quick start, ButtonGrid, State Machines, ...) |
| Find C# types by name; see doc comment, base types and public members |
| Find everything deriving from or implementing a type ( |
| Case-insensitive substring search of the source ( |
| Read any file (optionally a line range) or list files under a path |
| List example and test-bot source files |
| Read the curated guide: decision tables (which message loop / dispatcher / serializer), patterns, ship checklist |
| Describe a problem ("button spins forever") and get the known cause and fix |
| Public API diff between two tags/commits, for example before an upgrade |
Resources: tgbotbase://readme (the framework README) and tgbotbase://guide (the full guide).
Note: the symbol index is built with regular expressions, not a C# compiler. It is good for finding types and comparing public APIs, but can miss unusual declarations, and
get_changesmay list a few false positives (for example a word inside a comment reported as a type). For exact behavior, read the file withget_file.
Example prompts
"Using tgbotbase, write a form with a paged
ButtonGrid. Check the realButtonGridsource for the API.""Which controls exist and how do they differ? Use
find_subclassesonControlBase.""How do I persist user sessions across restarts? Look at the state machine classes."
"My button spins forever. Why?" (uses
get_gotchas)"Which message loop and request dispatcher should I use for a bot with broadcasts?" (uses the guide's decision tables)
"What changed in the public API between v7.1.0 and the current version?"
Tip: tell the assistant to verify against the source (
get_symbol,get_file) instead of answering from memory, and give it your bot's framework version so it can compare withframework_version.
Hosting on a VPS
Runs the container on 127.0.0.1:8000 and puts host nginx in front of it with TLS and per-IP rate limiting.
The server is public by default; a bearer token is optional (see below).
Requirements: Docker, nginx and certbot on the VPS; a DNS A record for tbf-mcp.severnbli.dev pointing at it; ports 80 and 443 open.
1. Start the container
cd deploy && cp .env.example .env
docker compose up -dThe compose file runs the container read-only with a 512 MB memory and 1 CPU limit.
Note: the image tag
8.0.0-preview.2exists on Docker Hub only after the first publish frommain(see CI and publishing). Before that,docker compose upfails with "not found".
2. Configure nginx
sudo cp nginx.conf /etc/nginx/sites-available/tgbotbase-mcp
sudo ln -s /etc/nginx/sites-available/tgbotbase-mcp /etc/nginx/sites-enabled/
sudo certbot certonly --nginx -d tbf-mcp.severnbli.dev
sudo nginx -t && sudo systemctl reload nginxWarning: on a fresh VPS the certificate does not exist yet, so
nginx -tfails on the 443 block. Comment that block out, run certbot, then restore it.http2 on;needs nginx 1.25.1 or newer; on older versions remove it and writelisten 443 ssl http2;.
Note: the config assumes the domain is proxied through Cloudflare (orange cloud). It trusts
CF-Connecting-IPonly from Cloudflare's published ranges, so rate limits apply per real visitor. If you are not behind Cloudflare, delete theset_real_ip_from/real_ip_headerlines. Set Cloudflare SSL/TLS mode to Full (strict).
3. Verify
curl -i https://tbf-mcp.severnbli.dev/mcp # public mode: any response from the MCP server except 401/404/502Optional: require a bearer token
A bearer token is a secret string the client sends as Authorization: Bearer <token>. To enable it, edit the copy in
/etc/nginx/sites-available/tgbotbase-mcp:
Generate a token:
openssl rand -hex 32.In the
mapblock changedefault 1;todefault 0;and uncomment the"Bearer ..."line with your token.sudo nginx -t && sudo systemctl reload nginx, then connect clients with--header "Authorization: Bearer <token>". Requests without it get 401.
Warning: put the token only in the copy under
/etc/nginx, never in the repo file. Do not commit a real token. Anyone who has it can use the server. Use HTTPS only, since the token travels in a header.
Updating
cd deploy && docker compose pull && docker compose up -dTip: the port is bound to
127.0.0.1on purpose. Do not change it to0.0.0.0: that would bypass nginx's rate limits (and the token, if enabled).
Upgrading the framework version
Build with the new ref (a tag or commit SHA) and version:
docker build \ --build-arg TGBOTBASE_REF=<tag|sha> \ --build-arg TGBOTBASE_NUGET_VERSION=<x.y.z> \ -t tgbotbase-mcp:<x.y.z> .Update the defaults in the
Dockerfileand the pinned version in this README, then merge tomainto publish.Before changing your bot, ask the assistant for
get_changesbetween the old and new ref to see what to adapt.
Tip: the repo does not tag NuGet releases (there is no
v7.2.0orv8.0.0-preview.2). Match the NuGet publish date to a commit onmasterand pin that commit SHA.
CI and publishing
ci.ymlruns on every pull request: builds the image, runstests/smoke.pyinside it, and runstests/check_guide.py, which fails if the guide mentions a source file that no longer exists in the pinned source (so a version bump can't silently leave the guide stale).publish.ymlruns only on a push tomainor a manual dispatch onmain. It re-runs CI, then pushessevernbli/telegram-bot-framework-mcp:<framework version>(read from theDockerfile; plus:latestfor stable, non-prerelease versions) to Docker Hub forlinux/amd64andlinux/arm64.
Warning: publishing needs the repository secrets
DOCKERHUB_USERNAMEandDOCKERHUB_TOKEN. Without them the publish job fails at login.
This server cannot be deployed
Maintenance
Related MCP Connectors
Search, inspect and inject full source modules (code + AI rules + MCP) pinned to a Git commit.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
A cited wiki of your GitHub repo: search, read pages, find symbols and ask, with line citations.
Search and inspect source-pinned agent skills, plugins and tools through a free public MCP.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to inspect local Git repositories and interact with the GitHub API for reading commits, diffs, files, issues, comments, pull requests, and project boards.10202 npmISC
- FlicenseNot gradedqualityDmaintenanceEnables AI models to fetch GitHub repository information, read file contents, and search local documentation.-
- AlicenseAqualityDmaintenanceProvides AI assistants with up-to-date documentation for popular libraries and frameworks, enabling them to generate more accurate code using less common or newly released libraries.514 npm36MIT
- FlicenseNot gradedqualityAmaintenanceEnables clients to retrieve real-time framework documentation for any npm package, returning TypeScript types, prose, and code examples with intent-aware formatting, plus version migration guidance, error diagnosis, package comparison, and dependency scanning.-