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.01302 | $0.01302 |
| Opus 5.5 | $0.00521 | $0.00521 |
| Sonnet 5 | $0.00260 | $0.00260 |
| Haiku 4.5 | $0.00130 | $0.00130 |
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 yesterday.
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 — 97 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 and log it under the tool's name. 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.
- yesterday Changed · +24 lines · +455 tokens per session d2134035de57
- 6d 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 (0 stars, last pushed yesterday), licensed MIT. It adds 1,302 tokens to every session, about $0.0052 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.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.