agentleFS
thenavidmthenavidm/telegram-mcp-cli/AGENTS.md

telegram-mcp-cli

AGENTS.md1 starsChanged 2 months agoMITView on GitHub

MCP server and CLI for a real Telegram account over MTProto. One of a family of *-mcp-cli repos that are deliberately identical in structure. Match the family before matching your own instincts. src/tools/index.ts exports TOOLS, built on Slipway from the specs each module describes once, in one defineTool call, and src/app.ts serves them as the MCP server and the CLI. Each module is a toolset, and the daily tools are also in core. The channel is its own small Slipway…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 31,843 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Never add a tool to one surface only.

    line 14
  2. Distinctive:

    Every tool definition is sent to the model on every turn.

    line 19
  3. Very specific:

    Never return a raw MTProto entity.

    line 23
  4. Distinctive:

    Default limits stay low. 20, not 100, and clamp rather than trust.

    line 24
  5. Distinctive:

    every count in the README read off the running binary, not typed

    line 55
  6. Very specific:

    Never hand-edit generated output.

    line 61

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

telegram-mcp-cli

MCP server and CLI for a real Telegram account over MTProto. One of a family of *-mcp-cli repos that are deliberately identical in structure. Match the family before matching your own instincts.

The seam

src/tools/index.ts exports TOOLS, built on Slipway from the specs each module describes once, in one defineTool call, and src/app.ts serves them as the MCP server and the CLI. Each module is a toolset, and the daily tools are also in core. The channel is its own small Slipway app in channel.ts.

Never add a tool to one surface only. If it needs describing twice, the change is in the wrong place.

Token cost is a design constraint, not an afterthought

Every tool definition is sent to the model on every turn. Measured on this build: 13 tools is 2,218 tokens, 7 is 1,241, counted with a tokeniser.

  • New tools default to profile: "full", not "core". core has to be earned.
  • Never return a raw MTProto entity. Project in format/render.ts.
  • Default limits stay low. 20, not 100, and clamp rather than trust.
  • Re-measure and update the README after adding tools. The numbers in the README are load-bearing and must come from a real handshake.

Safety

Slipway's guard, from each tool's risk. read passes through, write is recorded, destructive needs confirming and is off entirely unless TELEGRAM_ALLOW_DESTRUCTIVE=1, through defaults.allowDestructive.

Risk levels are read | write | destructive. Not "irreversible", even though that is the word the docs use, because Slipway reads destructive.

stdout belongs to the protocol

The MCP transport is JSON-RPC on stdout. Anything else written there corrupts the stream. GramJS logs to stdout by default, which is why client.setLogLevel is called before connecting. Human-facing output goes to stderr, and login prints only the session string on stdout so it can be redirected to a file.

The session string

Full account access, non-expiring. Never write it to disk, never log it, never put it in an error message. It is read from the environment and nowhere else.

Before saying a change is done

  • npm run typecheck && npm run build && npm test
  • a real tools/list handshake, not just unit tests
  • the binary run bare, one --help, one real read
  • unconfigured exits 10, a missing required argument exits 2
  • every count in the README read off the running binary, not typed
  • desktop-extension/manifest.json version matches package.json
  • open the rendered README and read the first screenful

Never

Never hand-edit generated output. Never commit a credential. Never run git checkout, reset or restore. Delete means move to _archive/, and only "permanently delete" removes anything.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.