Connect an agent
nox has an MCP server, so your agent can write scripts for you, test them, read the logs, fix what fails and schedule them, all from a chat. You approve the connection once, in nox, and can disconnect it whenever you like.
Your MCP server address
https://pernox.dev/mcp
Add nox to your agent
- In your agent's settings, add a remote MCP server (sometimes called a connector), name it nox, and paste the address above. It uses the HTTP transport.
- Leave any OAuth client ID and secret fields empty; nox registers the agent itself.
- Connect. nox opens, asks you to log in, and shows what the agent will be able to do. Choose Allow.
- Turn nox on in your agent's tools, then ask for what you need.
An agent that runs in the cloud connects from its provider's servers, so this nox has to be reachable on the public internet over HTTPS. An agent running on your own machine can connect to a local nox too.
Things to ask
- "Write a script that fetches the Bank of England base rate every weekday at 07:00 London time and prints it. Test it first."
- "My FX rates script failed last night. Look at the run and fix it."
- "Pull yesterday's closing prices for these tickers and post a summary to my Google Sheet. I'll give you the API key."
- "Which of my scripts haven't succeeded this week?"
- "Move all my morning scripts to 06:30."
- "Check the price of a QZ every morning and email me when it drops."
Your agent creates scripts paused, runs them to check the output, and only turns a schedule on when you say so.
Tools
What the nox MCP server lets your agent do. Most clients ask before each action.
-
list_scriptsread-onlyList the user's scripts with their schedules, next run times and the status of their last run.
-
get_scriptread-onlyGet a script's code, packages and settings, the names of its keys (never their values), its next runs and its most recent runs.
script_idstring, required- The script's id, from list_scripts or create_script.
-
create_scriptCreate a Python script. It's created paused unless enabled is true; test it with run_script before turning the schedule on.
namestring, required- A short name the user will recognise, e.g. "Gilt curve to sheet".
codestring, required- The Python source. Print results to stdout; read secrets from os.environ.
requirementsstring- Packages to install, one per line in requirements.txt format, e.g. "requests\npandas==2.2.3".
runtime_versionstring- The Python version the script runs on: 3.11 or 3.12. Defaults to 3.12.
schedulestring- Five-field cron expression in the script's timezone. Defaults to "0 7 * * 1-5" (07:00 on weekdays). Runs at most once an hour on the free plan, or once a minute on Pro.
timezonestring- IANA timezone for the schedule and the script's TZ, e.g. "Europe/London". Defaults to the user's own timezone (as their browser last reported it), or UTC if nox hasn't seen it yet.
timeout_secondsinteger- Kill the run after this many seconds (1-3600). Defaults to 300.
enabledboolean- Run on the schedule. Defaults to false; only set true once the user agrees.
email_on_failureboolean- Email the user when a scheduled run fails or times out, once until the script succeeds again. Runs from run_script don't send one. Pro accounts with a verified address only. Defaults to false. Ask the user before turning it on.
-
update_scriptChange any of a script's code, packages, Python version, name, schedule, timezone, timeout, whether it runs on schedule, or whether it emails the user on failure. Only the fields given are changed.
script_idstring, required- The script's id, from list_scripts or create_script.
namestring- New name.
codestring- New Python source, replacing the old.
requirementsstring- New packages, replacing the old list. An empty string removes them all.
runtime_versionstring- The Python version the script runs on: 3.11 or 3.12.
schedulestring- New five-field cron expression. Runs at most once an hour on the free plan, or once a minute on Pro.
timezonestring- New IANA timezone.
timeout_secondsinteger- New timeout in seconds (1-3600).
enabledboolean- true to run on schedule, false to pause.
email_on_failureboolean- Email the user when a scheduled run fails or times out, once until the script succeeds again. Runs from run_script don't send one. Pro accounts with a verified address only. Ask the user before turning it on.
-
run_scriptRun a script immediately and wait for it to finish, returning its status, exit code and logs. Waits up to wait_seconds (default 30, max 50); if it's still running, call get_run with the script_id and run number. If the script is already running, waits on that run instead of starting another. It's a test run by default: notifications the script sends are checked and written to the logs, not emailed.
script_idstring, required- The script's id, from list_scripts or create_script.
wait_secondsinteger- How long to wait for the run to finish (0-50). 0 returns straight away.
send_notificationsboolean- Email the notifications the script sends, as a scheduled run would. Defaults to false. Only set true when the user asks to receive them.
-
get_runread-onlyGet a run's status, exit code, timings and logs, optionally waiting for it to finish. Runs are numbered from 1 within each script.
script_idstring, required- The script's id, from list_scripts or create_script.
runinteger, required- The run's number within the script, from run_script or list_runs.
wait_secondsinteger- Wait up to this long for the run to finish (0-50). Defaults to 0.
-
list_runsread-onlyList a script's recent runs, newest first, with status, trigger and duration. Use get_run for a run's logs.
script_idstring, required- The script's id, from list_scripts or create_script.
limitinteger- How many runs to return (1-50). Defaults to 10.
-
set_keySet an environment variable for a script, such as an API key or database URL. Values can't be read back. Only use values the user has given you for this purpose.
script_idstring, required- The script's id, from list_scripts or create_script.
namestring, required- Variable name, e.g. DB_PASSWORD. Letters, numbers and underscores.
valuestring, required- The value.
-
delete_keydestructiveRemove one of a script's environment variables.
script_idstring, required- The script's id, from list_scripts or create_script.
namestring, required- The variable to remove.
-
delete_scriptdestructivePermanently delete a script with its keys and run history. Confirm with the user first.
script_idstring, required- The script's id, from list_scripts or create_script.
How scripts run
- Language
- Python, one file. Packages go in requirements.txt format, one per line.
- Output
- Anything printed to stdout or stderr is the run's log, up to 1 MB.
- Success
- Exit code 0 succeeds. A non-zero exit or an uncaught exception fails the run.
- Keys
- Environment variables, read with
os.environ["NAME"]. Values are never shown again, to you or to your agent, and show as***if a script prints them. - Time
TZis set to the script's timezone, sodatetime.now()is local time.- Schedules
- Five-field cron, e.g.
0 7 * * 1-5is 07:00 on weekdays. At most once an hour, or once a minute on Pro. - Timeout
- Up to 3600 seconds, then the run is stopped.
- Files
- The working directory is temporary and wiped after each run. Send results somewhere: an API, a database, a sheet.
- Overlaps
- A script never runs twice at once. A slot that comes up while it's still running is skipped.
Notifications
A script can send an email when something happens. Add pernox to its requirements and
call notify:
from pernox import notify
notify("3 new flats under £1,500", title="Flat search")
- Who
- Accounts on Pro with a verified email address. Verify yours in Settings.
- To
- Your account's address, from [email protected]. The title is the subject; without one, it's the script's name.
- Elsewhere
- Run the script on your own machine and
notifyprints the message instead of sending it. - Source
- Find
pernoxhere: s3bw/pypernox ↗ - Limits
- Up to 30 notifications an hour. A message is at most 1,024 characters, a title 250.
- Logs
- Each notification sent adds a line to the run's log.
- Tests
- When your agent runs a script to test it, notifications go to the run's log instead of your inbox, unless you ask it to send them.
- Failures
- Turn on Alerts in a script's settings, and when a scheduled run fails or times out, nox emails you the error and the end of its output. You hear once, not on every run after: the next email comes only after the script has succeeded and then failed again.
Help
Something on your mind? Email [email protected]. We'll probably read it.