SimpleTgChatMcp CLAUDE.md

SimpleTgChatMcp CLAUDE.md is an instructions file for coding agents from dotneteeer/SimpleTgChatMcp. It costs 1,969 tokens per session, scanned A, original, MIT.

Project instructions for SimpleTgChatMcp, a remote service that exposes Telegram Bot API methods for one chat through MCP.

In plain words
What is it for?
Use them when adding Telegram bot methods, changing request handling, or working on the Next.js and Render deployment setup.
Why use it?
They explain the service's architecture, setup assumptions, hosting requirements, and coding conventions so changes fit the existing project.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/dotneteeer/simpletgchatmcp/claude-md
Clone the repo
git clone --depth 1 https://github.com/dotneteeer/SimpleTgChatMcp

Wrote 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.

agentmods badge for SimpleTgChatMcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/dotneteeer/simpletgchatmcp/claude-md.svg)](https://agentmods.dev/instructions/dotneteeer/simpletgchatmcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/dotneteeer/simpletgchatmcp/claude-md"><img src="https://agentmods.dev/badge/instructions/dotneteeer/simpletgchatmcp/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,969 This file is loaded in full into every session.
When invoked 1,969 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.01969 $0.01969
Opus 5 $0.00984 $0.00984
Sonnet 5 $0.00394 $0.00394
Haiku 4.5 $0.00197 $0.00197

Measured 3d ago against content hash a434c56cc6b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

SimpleTgChatMcp CLAUDE.md scanned grade A with 1 finding 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 3d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

`curl -F file=@<path> .../api/upload` to move bytes straight from disk,
CLAUDE.md · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

What this is

Remote MCP server (Next.js App Router, mcp-handler) exposing Telegram Bot API methods for a single chat. Stateless multi-tenant: bot token and chat ID come from the connector's URL query params (token, chat), not from env vars or storage. See README.md for user-facing setup.

Hosted on Render as a persistent Node server (next start), not serverless - deliberately, since serverless hosts like Vercel cap request bodies at ~4.5 MB, which truncates (corrupts) large file uploads to /api/upload above that size. Render's free tier has no such cap and auto-deploys from GitHub on push (render.yaml). app/api/health/route.ts exists for Render's health check and for an external keep-alive cron (avoids the free tier's ~15-min idle spin-down). export const maxDuration = 60 in route.ts is a leftover Vercel-ism; Render ignores it, harmless to keep.

Architecture

  • app/api/[transport]/route.ts - the only route. Parses token/chat/key from the request URL, optionally gates on MCP_ACCESS_KEY (env), then builds a fresh createMcpHandler per request with token/chat captured in tool closures.
  • lib/telegram.ts - Bot API client. callApi for JSON calls, callApiWithMedia for methods that send a file by URL/file_id (thin wrapper around callApi), callApiWithMediaBytes for sending file bytes directly as multipart instead of a URL. All three auto-retry once as plain text if Telegram rejects the message due to bad parse_mode entities.
  • lib/mdv2.ts - escapeMarkdownV2() helper (not used by tools directly, but exported for callers who want to send literal text safely).
  • lib/upload.ts + app/api/upload/route.ts + app/api/file/[id]/route.ts + app/api/file/[id]/[filename]/route.ts - out-of-band file upload, deliberately plain HTTP, not an MCP tool, and the only way to send a local file - inline base64 was removed from the media schema entirely (it costs output tokens regardless of file size, since the model has to generate the whole file as text; a hypothetical "upload" MCP tool would have the same problem, since the bytes still have to enter the model's output). The upload URL includes the filename (/api/file/<id>/<name>; the bare /api/file/<id> route still works for back-compat) and the response carries a Content-Disposition header (lib/serveUpload.ts, shared by both routes) - both needed because Telegram's sendDocument/sendPhoto URL-fetch path rejects some Content-Types (application/octet-stream, application/x-msdownload, text/plain, and others) outright with "failed to get HTTP URL content", confirmed by testing arbitrary extension-less/generic-mime URLs, not just ours - fatal for arbitrary binaries like .bin/.exe/.dll. Because of that, route.ts's media tools (ownUploadId in lib/upload.ts) detect when media.url is one of our own upload URLs and, if the entry hasn't expired, send the bytes straight to Telegram via callApiWithMediaBytes instead of handing Telegram a URL to fetch - sidesteps the Content-Type gate entirely. Only our own uploads get this treatment; other public URLs still go through Telegram's URL fetch as before. A shell-capable client (Claude Code) runs curl -F file=@<path> .../api/upload to move bytes straight from disk, gets back a URL, and passes that to the existing media.url field. Storage is an in-memory Map (5-min TTL, 200 MB total cap) since files only need to survive until Telegram fetches them; not persisted, no external object store. Upload auth is an HMAC-SHA256(MCP_ACCESS_KEY, "upload-v1") token (?u=), not token/chat, because the model never sees those - they live in the connector URL, hidden from the model. The upload URL+token reaches the model via the MCP instructions field (set from uploadInstructions() in route.ts, serverOptions.instructions - mcp-handler passes it through to the SDK). Only works in shell-capable clients; shell-less ones (Claude.ai web/Desktop) can only send files via a public url or an existing file_id - a client-capability limit, not fixable server-side. Telegram's send cap (any method) is 50 MB. /api/file/[id] supports HTTP Range requests (206/Content-Range/416) - needed because Telegram's media fetcher (and others) can probe with a Range request before downloading in full.

Read the full file on GitHub · 129 lines

Changes

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.

  1. 3d ago First seen · 129 lines · 1,969 tokens per session scan A a434c56cc6b0

Subscribe to this mod's changes

SimpleTgChatMcp CLAUDE.md is an instructions file published in the GitHub repository dotneteeer/SimpleTgChatMcp (0 stars, last pushed 7d ago), licensed MIT. It adds 1,969 tokens to every session, about $0.0098 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

Alita_Robot AGENTS.md

AGENTS.md instructions for Divkix/Alita_Robot, covering repository guidelines, 0. maintaining this file, 1. mental model, 2. project structure and 3. build, test, lint.

Divkix/Alita_Robot · 7,802 tokens

telegram-search copilot-instructions.md

Copilot instructions for groupultra/telegram-search, covering copilot instructions for telegram-search, architecture essentials, dev workflows, conventions and patterns and where to look for examples.

groupultra/telegram-search · 1,185 tokens

telegram-search AGENTS.md

AGENTS.md instructions for groupultra/telegram-search, covering project coded agent guide, tech stack (by surface), structure & responsibilities, key path index (what lives where) and commands (pnpm with filters).

groupultra/telegram-search · 1,196 tokens

telegram-bot AGENTS.md

Instructions for vendelieu/telegram-bot, covering agents.md, dev environment, testing, project structure and key conventions.

vendelieu/telegram-bot · 381 tokens

telegram-search CLAUDE.md

Claude Code instructions for groupultra/telegram-search, a project described as: 🔍 导出并模糊搜索 Telegram 聊天记录 | Export and fuzzy search your Telegram chat history.

groupultra/telegram-search · 3 tokens

gsd-task-manager copilot-instructions.md

Copilot instructions for vscarpenter/gsd-task-manager, covering copilot instructions for gsd task manager, architecture overview, core stack, database schema (v13) and key architectural decisions.

vscarpenter/gsd-task-manager · 2,764 tokens