SimpleTgChatMcp: Instructions file for Claude Code

CLAUDE.md

SimpleTgChatMcp CLAUDE.md is an instructions file for Claude Code 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 for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is dotneteeer/SimpleTgChatMcp's own configuration. It tells Claude Code how to work on SimpleTgChatMcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything SimpleTgChatMcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to dotneteeer/SimpleTgChatMcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/dotneteeer/SimpleTgChatMcp/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/dotneteeer/SimpleTgChatMcp

Made for: Claude Code.

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/github.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/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.

agentmods 80×15 button for SimpleTgChatMcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/dotneteeer/simpletgchatmcp/claude-md"><img src="https://agentmods.dev/badge/instructions/dotneteeer/simpletgchatmcp/claude-md.svg" alt="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.01969 $0.01969
Opus 5.5 $0.00788 $0.00788
Sonnet 5.5 $0.00394 $0.00394
Haiku 4.5 $0.00197 $0.00197

Measured 2mo ago against content hash a434c56cc6b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 2mo ago), licensed MIT. It adds 1,969 tokens to every session, about $0.0079 per session on Opus 5.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

SimpleTgChatMcp CLAUDE.md compared with instructions from other repositories

SimpleTgChatMcp CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
SimpleTgChatMcp CLAUDE.mddotneteeer/SimpleTgChatMcpInstructions file02mo agoMITA1,969Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode