BUILD YOUR OWN CODEX-TO-TELEGRAM FILE CONNECTION
A step-by-step checklist for the blog reader — Windows, version 1.0.3 source
Clarity. Structure. Accountability.

RESULT
From a local Codex project, explicitly request one chosen file. Receive that actual
document attachment in your own private conversation with your existing Telegram
bot. Reuse the same user-level connection from another local project.
This checklist installs the supplied standard-library Python implementation. You
do not have to reconstruct the code from the blog or install third-party packages.
The implementation supports Windows with Python 3.11+; it uses Windows DPAPI and
does not provide a macOS/Linux credential-store implementation.

HOW TO FOLLOW THIS CHECKLIST
Every [ ] is an action or acceptance check. Complete the checks in order. Commands
below are PowerShell and each occupies ONE physical line. Run them in the same
PowerShell session so the named variables carry forward. Replace a quoted value
containing <...> with the corresponding path on YOUR computer before running it.
Never substitute a token into a command or put one in chat. Your bot's name need
not be Maverick; that is the name used in the historical development examples.

1. GET THE SOURCE AND START ON THE CORRECT COMPUTER
[ ] Download the accompanying codex-telegram-reader-kit-1.0.3.zip and extract it
    to a normal local folder. Do not run files from inside the ZIP viewer.
[ ] Open the extracted telegram-files folder. Open PowerShell in that folder.
[ ] Verify it contains Install.ps1, server.py, telegram_core.py, setup.py,
    register_user.py, test_telegram.py, sample-delivery.txt, this checklist and
    the included documentation. Retain the complete extracted folder.
    SOURCE-MANIFEST.json records reader-kit hashes and substitutions.
[ ] Confirm which computer/account this PowerShell and your Codex executor use:
[pscustomobject]@{Computer=[Environment]::MachineName;Identity=[System.Security.Principal.WindowsIdentity]::GetCurrent().Name;Profile=[Environment]::GetFolderPath('UserProfile');Documents=[Environment]::GetFolderPath('MyDocuments')} | Format-List
    PASS: this is the computer/account where you want local file access. STOP if
    Codex's executor is another computer. Merely viewing a remote/Office chat from
    this computer does not retarget its executor. Verify from Codex's own shell too.
[ ] Record the source directory for the commands below:
$sourceRoot = (Get-Location).Path
    PASS: Test-Path (Join-Path $sourceRoot 'Install.ps1') returns True.

2. CHECK PREREQUISITES WITHOUT INSTALLING ANYTHING
[ ] Use a supported local Codex client. In this terminal, run:
codex --version
    PASS: a real local Codex version prints. If unavailable, locate the Codex CLI
    supplied with your client or install/configure Codex using official guidance,
    then return here. A cloud-only chat cannot directly use this local stdio server.
[ ] Find available Python commands:
Get-Command python.exe,py.exe -All -ErrorAction SilentlyContinue | Select-Object Name,Source
[ ] If python.exe is a real working interpreter, select it:
$pythonPath = (Get-Command python.exe -ErrorAction Stop).Source
    If only the py launcher works, discover its actual default interpreter:
py -3 -I -B -c 'import sys; print(sys.executable); print(sys.version)'
    Then set $pythonPath to the ABSOLUTE executable path it printed:
$pythonPath = '<ABSOLUTE_PATH_TO_REAL_python.exe>'
    Do not copy the development computer's <OBSERVED_STUDIO_PYTHON_DIRECTORY> path. Do not use a
    Microsoft Store/app-execution alias or a launcher as the final MCP command.
[ ] Verify the selected executable and required modules:
& $pythonPath -I -B -c 'import sys,tomllib,tkinter,ctypes,pathlib; print(sys.executable); print(sys.version); assert sys.version_info >= (3,11); assert pathlib.Path(sys.executable).with_name("pythonw.exe").is_file(); assert ctypes.WinDLL("crypt32").CryptProtectData; assert ctypes.WinDLL("advapi32").GetNamedSecurityInfoW; print("Required Python modules, pythonw and Windows APIs present")'
    PASS: Python 3.11+ prints its real executable; imports and assertions succeed.
    Set $pythonPath to the printed sys.executable if a launcher/alias resolved it.
[ ] Check the actual Tk UI can open and show its version:
& $pythonPath -I -B -m tkinter
    PASS: the small Tk demonstration window opens. Close it.
    STOP if prerequisites fail. Install a complete Windows Python distribution
    manually from python.org if needed, including Tcl/Tk. Do not install Python
    packages, change global settings automatically or weaken execution policy.

3. IDENTIFY THE EXISTING BOT AND YOUR PERSONAL USER ID
[ ] In Telegram, open the existing bot you want to use. Open its profile and
    record its EXACT @username privately. A display name alone is not sufficient.
[ ] Have its existing token available privately. Do not create or replace a bot
    merely because another program already uses it. Keep that receiver running.
    If you have no bot, use the OPTIONAL BotFather addendum at the end, then return.
[ ] From the Telegram account that should RECEIVE the files, open the exact bot's
    private chat and tap Start. Starting another utility bot does not start this bot.
[ ] Find your PERSONAL numeric Telegram user ID:
    a. Open Get My ID: https://t.me/getmyid_bot or search @getmyid_bot.
       Alternative: Raw Data Bot, https://t.me/raw_data_bot (@raw_data_bot).
    b. Tap Start in the utility bot's own chat.
    c. Read the value labelled Your ID or your own sender/user ID.
    d. If you selected a bot and see Selected Bot ID AND Your ID, choose YOUR ID.
       Selected Bot ID identifies the bot; it is not your personal destination.
    Never give a utility bot your own bot's token. The setup needs:
      Existing bot token              -> masked local token field
      Your personal Telegram user ID  -> masked personal-user-ID field
      Exact existing bot @username    -> expected bot username field
    A phone number, public username, group ID or bot ID is not a substitute.
    For this ordinary private bot conversation, your personal user ID is the
    private destination used internally as Telegram's chat_id parameter.
    Alternative lookup routes remain available through the existing receiver's
    established workflow or Telegram Desktop's account-information JSON export.
    Never consume your existing bot's updates to discover the ID.

4. RUN ALL OFFLINE TESTS BEFORE ENTERING A TOKEN
[ ] From the extracted source folder, run:
& $pythonPath -I -B (Join-Path $sourceRoot 'test_telegram.py')
    PASS: 24 tests, OK. These use synthetic credentials, not your real token, and
    make no Telegram calls. They exercise actual Windows DPAPI/ACL/read locks,
    masked UI, exact attachment bytes, pinned identities, private-store denial,
    redaction, no retry, self-recipient refusal, direct config preservation and
    stdio discovery in two fixture contexts.
    STOP on failures. A restricted execution sandbox can deny a hardlink fixture;
    investigate that condition and rerun as your normal Windows user if appropriate.
    Do not skip a failed security check or declare it passed from another computer.

5. LOCATE AND PRESERVE YOUR USER CONFIGURATION
[ ] Derive paths from THIS account rather than copying another user's profile:
$documentsPath = [Environment]::GetFolderPath('MyDocuments'); $installRoot = Join-Path $documentsPath 'Codex\Integrations\telegram-files'; $configRoot = if ($env:CODEX_HOME) { $env:CODEX_HOME } else { Join-Path $env:USERPROFILE '.codex' }; $configPath = Join-Path $configRoot 'config.toml'; [pscustomobject]@{InstallRoot=$installRoot;UserConfig=$configPath} | Format-List
    Confirm this is the local client's actual CODEX_HOME/config location. A custom
    launcher or different account can use another home. STOP and resolve a mismatch.
[ ] Keep an encrypted local baseline of the existing config BEFORE installation:
New-Item -ItemType Directory -Path (Join-Path $sourceRoot 'work') -Force | Out-Null; $baselinePath = Join-Path $sourceRoot 'work\config-before.dpapi'; & $pythonPath -I -B -c 'import sys,pathlib; sys.path.insert(0,sys.argv[1]); import telegram_core; p=pathlib.Path(sys.argv[2]); b=pathlib.Path(sys.argv[3]); raw=p.read_bytes() if p.exists() else b""; b.open("xb").write(telegram_core.dpapi(raw)); print("Encrypted baseline saved locally")' $sourceRoot $configPath $baselinePath
    PASS: baseline saved. If it already exists, keep it; choose a new filename
    for a separate run rather than overwrite the original. Do not upload your
    live config or this baseline. Other integrations may have secrets in config.
[ ] Record the config ACL if the file exists, without printing its contents:
$configAclBefore = if (Test-Path -LiteralPath $configPath) { (Get-Acl -LiteralPath $configPath).Sddl } else { $null }
    If telegram_files already exists or installed files differ, review that
    existing connection/source before updating. The installer stops on conflicts.

6. INSTALL ONCE AT USER SCOPE
[ ] Run the supplied reviewed installer with your verified real interpreter:
& (Join-Path $sourceRoot 'Install.ps1') -PythonExecutable $pythonPath
    PASS: compatible Python; user-wide configuration verified; installed runtime
    and masked setup paths print. No token is requested or stored by the installer.
    Installation is <YOUR_DOCUMENTS>\Codex\Integrations\telegram-files, not a
    project-only .codex folder. Absolute executable/source paths are registered.
[ ] Verify original config bytes and unrelated parsed settings privately:
& $pythonPath -I -B -c 'import sys,pathlib,tomllib; sys.path.insert(0,sys.argv[1]); import telegram_core; old=telegram_core.dpapi(pathlib.Path(sys.argv[3]).read_bytes(),decrypt=True); new=pathlib.Path(sys.argv[2]).read_bytes(); a=tomllib.loads(old.decode()); b=tomllib.loads(new.decode()); a.get("mcp_servers",{}).pop("telegram_files",None); b.get("mcp_servers",{}).pop("telegram_files",None); a={k:v for k,v in a.items() if k!="mcp_servers" or v}; b={k:v for k,v in b.items() if k!="mcp_servers" or v}; assert a==b; assert new.startswith(old); print("Original bytes and unrelated parsed settings preserved")' $sourceRoot $configPath $baselinePath
    PASS for a fresh registration: preserved bytes and unrelated settings. An
    existing owned table needing an inserted option can require a more specific
    comparison; STOP and review rather than assume an unrelated change is harmless.
[ ] Verify the existing ACL is retained:
if ($null -ne $configAclBefore -and (Get-Acl -LiteralPath $configPath).Sddl -ne $configAclBefore) { throw 'Configuration ACL changed; review before proceeding.' }
    Registration uses the supported direct config.toml route. Do not substitute
    codex mcp add as an unreviewed repair: its broader rewrite behavior complicated
    the original Office config-preservation check. Keep comments/options intact.

7. OPEN THE LOCAL MASKED SETUP WINDOW
[ ] Launch the installed helper using the path derived above:
& (Join-Path $installRoot 'Setup Telegram.cmd')
[ ] Confirm the field says Your personal Telegram user ID.
[ ] Enter your existing token ONLY in the masked token field.
[ ] Enter YOUR ID in the personal-user-ID field, not Selected Bot ID.
[ ] Enter the exact @username of your existing bot.
[ ] Choose Verify identities and save. Check the LOCAL confirmation:
    - Bot @username/identity is the bot you intended.
    - Private recipient name/username is you.
    - Personal numeric user ID is yours.
    - Webhook information is only a read-only observation.
    STOP/cancel if any identity is wrong. Do not infer the person from numbers alone.
[ ] Click Yes only after those checks. Wait for encrypted-settings-saved success.
    PASS: settings saved securely. Close the setup window.
    The token and pinned identities are current-user DPAPI encrypted at
    %USERPROFILE%\.codex\telegram-files-private\credentials.dpapi; the directory
    allows only your Windows user and SYSTEM. Same-user programs can decrypt it.
    Setup sends no file. Never screenshot real token entry or paste it into chat,
    command arguments, environment variables, source, logs, tutorials or history.
    The helper reads getMe/getChat/getWebhookInfo only. It never calls getUpdates,
    consumes offsets, removes/replaces a webhook, or changes bot settings. An empty
    webhook does not rule out an existing polling receiver.

8. VERIFY LOCAL CODEX TOOL DISCOVERY
[ ] Refresh/reopen your supported local Codex client if necessary. Do not keep
    reinstalling the connection to force an already-open chat to refresh.
[ ] Inspect the owned registration without exposing other servers' settings:
codex mcp get telegram_files
    PASS: absolute verified Python command, -I -B and absolute installed server.py
    arguments, timeout 180. No Telegram credential appears in the user config.
    This confirms registration; it is not by itself actual tool discovery.
[ ] In a local project, ask: Check telegram_status. Do not send a file.
    PASS: the actual tool is available and reports configured true.
[ ] Confirm telegram_send_file is also discoverable. Its only inputs are one
    absolute file path and an optional caption, with no recipient parameter.
    If your app version does not show the tools, use its documented MCP refresh
    flow and review project policy/overrides. Do not invent a successful discovery.

9. SEND ONE HARMLESS SAMPLE AND VERIFY THE ACTUAL FILE
[ ] Resolve the installed sample path for your explicit request:
Join-Path $installRoot 'sample-delivery.txt'
[ ] Ask Codex: Send <THE_EXACT_ABSOLUTE_SAMPLE_PATH> to my Telegram as a file attachment.
    Replace the placeholder with the full path printed above. This request
    authorizes just that file, not a folder, bulk sends or a watcher.
[ ] Check the tool result. PASS at the API stage: telegram_api_accepted, filename,
    bytes and message ID. The sender verifies approved bot/private-chat identity
    before streaming the actual selected bytes as sendDocument multipart data.
[ ] Open Telegram. Confirm the file arrived from the intended bot in YOUR private
    chat as a document attachment, not as a pasted local-path link.
[ ] Download and open the attachment. Confirm you can read:
    CODEX-TELEGRAM-LOCAL-2026-11-01
[ ] Record the actual receipt/download/opening result. API acceptance alone does
    not prove it. Christopher's development test confirmed arrival and readable
    contents; a separate manual save-to-disk action was not independently recorded.
    Your own acceptance checklist explicitly includes that action.
    STOP on failure. For an uncertain upload, inspect Telegram before requesting
    another attempt. The sender never retries automatically. A 403 is a rejection,
    not success; check the recipient, bot-as-own-recipient mistake, exact bot chat,
    account and blocking/Start state. Never guess the detailed reason from a code.

10. CONFIRM THE SAME USER CONNECTION WORKS ACROSS PROJECTS
[ ] Switch to a second, separate local project context on this computer/account.
    Use a disposable fixture or another local project you choose. No project-only
    config should be added. Do not edit unrelated project files for the test.
[ ] Check telegram_status and discover telegram_send_file there too.
    PASS: both contexts see the same user-level connection and configured status.
[ ] Record project A and B discovery results separately from delivery acceptance.
    A second upload is not required merely to prove discovery. If you want live
    delivery from B as well, explicitly choose and request its harmless file once.
    Do not create chats automatically on another person's behalf. The development
    verification used two standalone app-server processes and disposable folders,
    without creating chats. CLI registration alone was not treated as discovery.
    The connection is user-wide on THIS computer. Project policies can disable or
    override it; another computer or cloud host needs its own verified deployment.

11. MAINTAIN THE CONNECTION AND KEEP AN ACCOUNTABLE RECORD
[ ] Keep the reviewed source ZIP, manifest, prior versions and test evidence.
[ ] For a new token or destination, rerun the same masked local setup and confirm
    the identities afresh. Do not edit the encrypted blob directly.
[ ] Preserve the bot's existing receiver, user config/comments/options and source
    edits during updates. No new bot, watcher, bidirectional agent, bulk sends,
    polling service, remote detection or bot-setting changes are required.
[ ] Record failures as failures, fixes as fixes, and observations as observations.
    Do not replace the history with a claim that everything worked first time.
[ ] If retiring the integration, remove only its reviewed user-config table,
    installed integration directory and encrypted private store after confirming
    the resolved paths. Do not delete a parent .codex directory or other servers.
    Removing this sender does not revoke a token or remove the existing receiver.

DONE WHEN
[ ] Correct local executor/account and Python prerequisites verified.
[ ] All 24 offline checks pass on your machine before real token entry.
[ ] User-level installation and original config/ACL preservation verified.
[ ] Your bot and your personal recipient identity confirmed in masked local setup.
[ ] Both tools discovered in two local project contexts.
[ ] Explicitly requested document accepted by Telegram, received, downloaded,
    opened and read by you with the correct marker.
[ ] Actual results and any remaining limitation recorded without private values.

OPTIONAL ADDENDUM: ONLY IF YOU DO NOT ALREADY HAVE A BOT
[ ] Open Telegram's official @BotFather and use /newbot. Choose a display name and
    available @username following its prompts. Keep its issued token private.
[ ] Return to step 3. Use the exact new @username and your PERSONAL user ID.
    Do not repeat bot creation when you already have a suitable bot, regenerate
    an existing receiver's token unnecessarily or copy token-bearing browser/curl
    examples into history. This implementation uses the masked local setup instead.

PRIMARY REFERENCES
OpenAI direct user-level MCP configuration and stdio options:
https://developers.openai.com/codex/mcp
https://learn.chatgpt.com/docs/extend/mcp?surface=cli
Python Windows distributions: https://www.python.org/downloads/windows/
Telegram attachment/identity API: https://core.telegram.org/bots/api
User-ID utilities: https://t.me/getmyid_bot and https://t.me/raw_data_bot
Optional bot creation: https://core.telegram.org/bots/tutorial#obtain-your-bot-token
DPAPI: https://learn.microsoft.com/en-us/windows/win32/api/dpapi/nf-dpapi-cryptprotectdata

EDITOR/PUBLISHER HANDOFF
Publish the reviewed reader ZIP alongside this checklist or insert its real download
link before publishing the blog post. No website, plugin or bot has been published
by preparing these files. Historical documents are included as anonymized copies;
runtime code is retained except server wording generalized to refer to the user.
The original full development evidence remains preserved separately for Christopher.
Clarity: name the value. Structure: put the actions in order. Accountability: keep
the evidence, acknowledge design/guidance failures and verify what the reader receives.
