Borrowing it
Nothing to install: this file belongs to tolmachov/mcp-telegram. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/tolmachov/mcp-telegram/main/AGENTS.mdgit clone --depth 1 https://github.com/tolmachov/mcp-telegramWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/tolmachov/mcp-telegram/agents-md)<a href="https://agentmods.dev/instructions/tolmachov/mcp-telegram/agents-md"><img src="https://agentmods.dev/badge/instructions/tolmachov/mcp-telegram/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/tolmachov/mcp-telegram/agents-md"><img src="https://agentmods.dev/badge/instructions/tolmachov/mcp-telegram/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01359 | $0.01359 |
| Opus 5.5 | $0.00544 | $0.00544 |
| Sonnet 5.5 | $0.00272 | $0.00272 |
| Haiku 4.5 | $0.00136 | $0.00136 |
Grade A, and why
mcp-telegram AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Guidance for coding agents working in this repository. User-facing docs live in README.md; this file only covers what isn't obvious from the code.
What this is
A Go MCP server for Telegram, built on gotd/td. It is primarily a read-heavy research/summarisation assistant (search, extraction, context loading); admin and posting features are secondary. Two transports:
- stdio — single local account;
- streamable HTTP — embedded OAuth 2.1 server, per-user QR login, multi-user,
deployable to Cloud Run (
deploy/).
Layout
main.go→internal/app.go— CLI entry (run,login,logout,config).internal/tools— MCP tools, one file per tool (HandlerwithRegister).internal/tgdata,internal/messages— Telegram data access and message formatting shared by tools.internal/server,internal/authsrv— HTTP transport and OAuth.internal/tgclient,internal/sessionstore,internal/secret,internal/config— Telegram client and credential/session storage: macOS Keychain on darwin, file store in*_other.go(//go:build !darwin).internal/keyring— theMCP_AUTH_TOKEN_KEYSmaster keys shared by the token sealer and the session cipher;internal/keyedlimit— per-key token-bucket limiter (auth endpoints, user pool);internal/xdg— state directory, atomic file writes and the file-backed gotd session.internal/tgid,internal/presentation,internal/logging,internal/flags— shared id type, MCP-facing formats, the slog handler, CLI flags.internal/summarize,internal/prompts,internal/resources,internal/completion.internal/testutil/telegram— the scripted Telegram RPC fake for tests.test/— integration tests (build tagintegration).
Adding a tool
- New file in
internal/tools: an input struct (descriptions go injsonschematags; closed value sets viainputSchemaWithEnums) and aRegistermethod. - Register with
tools.AddTool— never plainmcp.AddTool: it keeps error results from reaching the client as an empty structured output. Usetools.AddContentToolonly for tools with no typed output (e.g.GetMedia). - A tool that takes a chat ID takes the assembly's
*tgclient.Resolverand wraps the RPC that uses the peer intgclient.WithPeer(WithPeers,WithPeersFromfor several or for @usernames mixed with IDs): that is where a stale access hash is dropped from the cache and the call retried. - Return
ErrResultonly for input validation. Return every other failure as the handler's Go error viafailed(op, err)/failedHint: the registration helpers classify it (dead session, a stopped client, flood wait, a problem with the chat named —tgclient.IsPeerSpecific), render the text the model sees, which the request log records under the tool's name. Anything else worth an operator's attention goes toslog(MCP client logging is deprecated and not used). They also give the call its flood-wait budget (tgclient.WithWaitBudget). A call that got part of its work done is no failure: its output embedspartialOutcomeand says what it lacks withwarn/warnCause, whichAddToolflags for the request log. - Add the handler to
buildHandlersininternal/server/server.go:researchfor read-only tools,mutatingfor anything that changes state. The split drives the server variants (see README "Server Variants"). - Make the first sentence of
Descriptionself-contained: thecompactandresearchvariants keep only that sentence. - Update the tool list and tool counts in README.md.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago Changed · +1 lines · +20 tokens per session 922e44cbfad9
- 8d ago Changed · +6 tokens per session 52bd4fa1a950
- 1mo ago Changed · +2 lines · +31 tokens per session e1aaa6ab62d1
- 1mo ago Changed · +24 lines · +455 tokens per session d2134035de57
- 1mo ago First seen · 73 lines · 847 tokens per session scan A d4aca3efaa8a
mcp-telegram AGENTS.md is an instructions file published in the GitHub repository tolmachov/mcp-telegram (3 stars, last pushed today), licensed MIT. It adds 1,359 tokens to every session, about $0.0054 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-20.
mcp-telegram AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| mcp-telegram AGENTS.mdtolmachov/mcp-telegram | Instructions file | 3 | today | MIT | A | 1,359 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,685 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| vscode model-prompts.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 2,022 | GitHub Copilot |