NetrunHome

Code from an AI

How to deploy a Telegram bot from Cursor with one sentence

· 5 min read

In short

You can deploy a Telegram bot from Cursor without leaving the editor: connect the Netrun server to Cursor (a button or one block in the config file, with Node.js installed) and tell the agent “publish this bot to Netrun”. The agent packs the project folder without the junk directories, asks you for the BotFather token, waits for the build and reports that the bot is running. From then on the same chat ships updates, reads logs and restarts the project. The agent cannot pay or delete projects — that stays with you in the dashboard.

A bot written in Cursor lives exactly as long as your laptop stays awake. For it to answer people around the clock, the code has to move to a machine that is online all the time — and that is usually the least loved part: an archive, a dashboard, settings, environment variables. The context switch costs more than the work itself: you leave the editor where you were thinking about the bot and land in an interface where people think about servers.

That part no longer requires leaving the chat. Netrun connects to Cursor as an ordinary external service, and the agent gets permission to do exactly what you would have done by hand: upload the code folder, ask for the missing token, wait for the build and tell you how it went. Here is how to set it up and what happens at each step.

  1. Make sure the bot starts on your machine#

    The agent uploads exactly the code sitting in the folder and works no miracles: if the bot crashes locally, it will crash on the server too. Check that the project starts with a single command, that a dependency list is next to it — requirements.txt for Python or package.json for Node.js — and that the token is read from an environment variable instead of being typed into a file. Cursor can do that last part for you if you ask it to move the token into an environment variable.

  2. Create an access key in the dashboard#

    The key is the pass your editor uses to reach your account. You create it in the “MCP” section of the Netrun dashboard in about a minute, and it is shown once, so copy it right away. The key lives only in your editor config; if it ends up somewhere it should not, or you switch laptops, revoke it in the same section and create a new one — your projects are unaffected.

  3. Connect Netrun to Cursor#

    On the setup page pick Cursor and press the button — the editor opens and offers to add Netrun. If the button is not available, the same page has a ready-made config block for ~/.cursor/mcp.json where you paste your key. There is one requirement: Node.js installed, which AI editors usually ship with. Restart Cursor afterwards so it picks up the new server.

  4. Open the bot folder and ask for a deploy#

    Open the project in Cursor and write to the agent in plain words: “publish this bot to Netrun”. From there it works on its own — it packs the folder, leaving out the virtual environment, node_modules and caches, uploads it, follows the build and reports the result. You can name the project right in the request, for example “call it shop-bot”; otherwise the agent suggests a name itself.

  5. Hand over the token when the agent asks#

    If the code reads a token from an environment variable and there is no value yet, the agent stops and asks you for it — it never invents values. Paste the BotFather token in your reply: it is stored encrypted on the platform side and never ends up in the archive or the repository. API keys for paid services and database addresses are set the same way.

  6. Keep living in the chat#

    Fixed the greeting? Say “update the project” and a new version ships: the address and the settings stay the same. Bot gone quiet? “Check the logs”, and the agent reads the last lines of output and names the cause. There are also start, stop, restart, the project list and the account state. What the agent will never do: pay, renew a plan, or delete a project or files — the platform keeps anything irreversible with the human.

Publishing from the editor does not replace the dashboard — it removes the context switch at the most common moment, when the code is already done. The free plan carries a website for a long time: it sleeps while idle and wakes up by itself on the first visit. A bot has nobody to wake it, so it gets free running time to try things out, and after that it needs the Pro plan with round-the-clock operation — the code, the settings and the secrets stay in place either way. Setup and ready-made commands are on the publish-from-your-editor page.

Common questions

What is MCP in plain words?

It is the common way to connect external services to AI editors. The editor learns which actions a service supports and can perform them when you ask in the chat. For you it looks like this: you write “publish this bot to Netrun”, and the agent does what you would have done in the dashboard.

Is it safe to give an AI agent a key to my account?

The key allows exactly the listed actions: publish, status, logs, secrets, start and stop, the project list and the account state. Payments, buying places, deleting a project and deleting files from persistent storage are closed at the platform level: such requests are rejected even if the agent sends them. The key is stored in your editor config and can be revoked in the dashboard with one click.

Can the agent spend my money by mistake?

No. The checkout is out of reach for the agent: the plan, renewals and places are bought only by you in the dashboard. The worst that can happen by accident is one extra publish, and publishing is free.

Do I need GitHub to publish from Cursor?

No. The agent uploads the folder open in the editor, and neither Git nor a remote repository is involved. If your code already lives on GitHub, you can still import the repository in the dashboard — the two ways do not conflict.

What happens if the build fails?

The agent receives the reason and shows it to you in words rather than as a raw error dump. Most often it is a missing library in the dependency list or an empty token. Ask it to check the logs — it reads the last lines of output and suggests a fix right in the code.

Does this work in other editors?

Yes. Besides Cursor there are Claude Code, Codex, Claude Desktop, VS Code and Windsurf — anything that can connect MCP servers. One key per account is enough, and you can use it in several editors at once.

Can I publish straight from Cursor, Claude Code or ChatGPT?

Yes. The dashboard has an “MCP” section: create an access key there and connect it to Cursor, Claude Code, Codex or any other AI editor — with one button or one command. After that you just tell the agent “publish this bot to Netrun”: it uploads the code folder, asks you for the token if the code needs one, waits for the build and gives you the link. “I fixed the greeting — update it” ships a new version, “why is the bot silent?” shows the logs. The agent cannot pay, renew or delete projects — that stays in the dashboard.

Where do I set tokens and other secret values?

Every project has a Secrets tab where you set the values from your code — for example the token from BotFather. We store them encrypted: you can see the variable names, but the values are shown to no one, including you.

What happens to my bot after 3 hours on the free plan?

The bot switches off, but your code, settings and secrets stay where they are — we delete nothing. Shortly before it switches off we send you a warning. The three hours only count while the bot is actually running: while it is stopped, still building or crashed with an error, the clock stands still — you can fix the code and start it again without losing time. Switch to the Pro plan, and the bot starts again from the same place and runs around the clock. A new bot uploaded after that is built too, but it will not start: free time is counted per account, not per project.

How do I update the code of a project that is already published?

Open the project and upload a new version or update it from GitHub. The link stays the same, and your data is kept as long as it lives in persistent storage — the /data folder or a volume from your compose file.

Get your own project online

Upload your code, answer a couple of questions and get a working link. There is a free plan

Try Netrun
All blog articles