A friendly robot holding a phone that says "Daily check: done!" beside the words Run AI agents from Claude chat, with a chain of Claude chat, locked door, fixed menu and your agent, and badges reading $72 a year, 7 security layers and rebuild in minutes

For months, every script in my Agentic AI series ran the same clumsy way. Claude wrote a command, I ran it on my laptop, and I pasted the output back. So I built a Claude custom connector instead. Now I type “run the daily check” in a chat, on my phone, from anywhere, and a small server I rent does the work.

This post shows how my Claude custom connector fits together, what it costs, how it is locked down, and what went wrong on the way. All of the code is open source, so you can run your own agents the same way.

What a Claude custom connector is

A connector lets Claude use tools that live outside the chat. It speaks the Model Context Protocol, an open standard for connecting AI apps to tools and data. Claude has a directory of ready-made connectors. You can also add your own by giving Claude a web address. Custom connectors work on every Claude plan, including the free one.

Here is the key fact. Claude calls a custom connector from Anthropic’s cloud, not from your device. That one detail shapes the whole design, as you will see in the security section.

Where this fits in the series

The series builds an open source investment thesis tracker, one module at a time.

  • Module 1 turns a research document into claims that reality can test.
  • Module 2 checks those claims against SEC filings every day.
  • This post is the workshop between them and Module 3. It moves both modules onto a server I can drive from chat.

How the Claude custom connector fits together

Block diagram of the Claude custom connector: a Claude chat calls a small Ubuntu server through a firewall, an HTTPS front door and a connector container that runs one flow from a fixed menu, with project code, secrets and a daily timer behind it, and GitHub, SEC EDGAR and DeepSeek outside
The whole system: Claude in Anthropic’s cloud calls a locked-down connector on a $6-a-month server.

There are only a few moving parts. Each one has a single job.

PartWhat it does in plain English
ClaudeReads my message and decides which tool to call. It runs in Anthropic’s cloud.
FirewallIgnores every visitor except Anthropic’s published addresses.
Front door (Caddy)Encrypts every request. It also gets and renews its own HTTPS certificate.
ConnectorA small Python program in a Docker container. It checks a secret token, then runs one command from a fixed menu.
Menu (flows.yaml)One settings file that lists every command allowed to run. If it is not on the list, it cannot run.
ProjectThe thesis monitor code and its data, cloned from GitHub.
SecretsAPI keys kept outside the project folder. Only one user on the server can read them.
TimerStarts the daily check at 11:00 every day, with or without me.

Docker packages the connector so it runs the same way on any server. Think of it as a sealed lunchbox. What happens inside is kept away from the rest of the machine.

What happens when I type a request

Sequence diagram of one request: you ask Claude to run the daily check, Claude sends an HTTPS request with a secret token, the front door checks the sender's address, the connector checks the token and the menu, runs the fixed command, hides secrets in the output, and Claude answers in plain English
Seven steps and two locks between a chat message and a script running on the server.

Say I type “run the daily check.” Claude sends a request to my server with a secret token attached. The firewall checks where the request came from. The connector checks the token, then looks the command up on the menu. Only then does the script run.

The answer travels back the same way. On the way out, the connector replaces any secret value with the word “hidden.” Then it writes a line to its log. The whole round trip takes a few seconds.

The flows on the menu

A flow is one command I wrote down in advance. Claude can pick from the menu, but it cannot invent a new item. Some flows take an input, such as a stock ticker. Each input must match a strict pattern, or the request is refused.

FlowWhat it does
digestPrints the morning note. No network, no AI.
nightlyThe daily check from Module 2. It runs on its own at 11:00.
nightly dry runRecomputes every claim and saves nothing.
nightly forceRecomputes every claim and records any new or corrected verdicts.
testsRuns all 108 tests in the project.
capture dry runModule 1: an AI suggests claims from a research PDF. Saves nothing.
auditModule 1: an AI double-checks every “wrong if” test for one stock.
consolidate previewShows what would be copied into the live claims folder. Saves nothing.
consolidateCopies my reviewed claims into the live folder.
updatePulls the latest merged code from GitHub.
git statusShows what changed on the server since the last update.

A word on “verdicts.” A verdict here is only a test result for a claim I wrote: held, wrong, or still open. It is not a buy or sell signal, and it is not advice.

How Module 1 and Module 2 run through the Claude custom connector

Eight-step workflow: upload a research PDF, capture claims with DeepSeek, review them, merge a GitHub pull request, update and audit on the server, run the daily check at 11:00, read the morning note in chat, and a security check at 11:43
Module 1 turns a document into testable claims; Module 2 checks them against SEC filings every day.

The connector does not change the modules. It changes who presses the buttons. Here is a typical week.

  1. I upload a research PDF to a private folder. Paid research never goes into the public code.
  2. I ask Claude to run the capture flow. DeepSeek suggests claims, each with a test that would prove it wrong.
  3. I keep a few and rewrite each test as one clear number or event. This part stays human.
  4. The kept claims become a pull request on GitHub. I read it and merge it.
  5. Claude runs the update flow, then the audit flow, then a dry run to prove the new claims are picked up.
  6. At 11:00 the timer runs the daily check. Later I ask, “What changed today?” Most days the honest answer is nothing.

Notice what the connector cannot do. It cannot edit code, so every change goes through GitHub first. That gives me a review step and a full history for free.

Giving the server a name

A server comes with a number, not a name. The HTTPS certificate needs a name, though. So I added one record to my blog’s domain settings: a new subdomain pointing at the server.

My blog runs on WordPress.com, and Claude already had a WordPress.com connector. So Claude added the record for me, after I approved it. The blog and email settings were not touched. Within minutes, the server could get its certificate.

One lesson from this step. To check a new name, ask a public lookup service, not the server itself. A server often answers its own name with “that’s me,” which looks like a broken record when it isn’t. I lost ten minutes to that.

Security questions before trusting a Claude custom connector

Seven stacked security layers: firewall, encryption, secret token, fixed menu, sealed container, secrets kept apart, and watching with logs, a daily security check and a spending cap
Defense in depth: each layer assumes the one before it might fail.

A Claude custom connector that can reach an API key needs real protection. I asked Claude the questions I would ask any vendor. Here are the honest answers.

Is this setup industry standard?

The building blocks are. It uses encryption, a firewall that blocks by default, key-only remote login, least privilege, secrets kept out of code, pinned software versions, logging and automatic security updates.

One part falls short of the gold standard: sign-in. The official standard for connectors is OAuth, where you log in and receive short-lived passes. Mine uses one long secret token instead. That is common and fine for a one-person server, and Claude supports it directly. It would not be enough for a team.

I travel a lot. Does it work from a hotel?

Yes. Every request reaches my server from Anthropic’s cloud, never from my laptop or phone. My location never matters, so I never open the server to “wherever I am today.”

Why not let Claude run any command it likes?

Because Claude reads documents, and documents can contain text written to trick an AI. With a fixed menu, the worst a tricked AI can do is run one of my own commands. That is a much smaller problem than “anything at all.”

Can I rotate the secret token?

Yes. One command on the server makes a new token, and the old one stops working at once. Then I paste the new token into Claude’s connector settings. A reminder fires every three months so I actually do it.

How would I know if it were compromised?

A security report now sums up the last 24 hours. It lists every flow that ran, every request turned away at the door, any remote logins, and whether the menu changed. A scheduled Claude task reads that report every day. It sends one line when all is clear, and a list when something looks wrong.

One honest limit. If someone stole my real token, their runs would look like mine. So the report always lists every run, and I glance at it for anything I don’t remember asking for.

What is the worst case if the token leaks?

They could run my eleven menu commands. They could not read my API key, change code, download my research files, or run commands of their own. My DeepSeek account is prepaid with about $2 and does not top itself up. So the worst case for that key is $2.

What still needs care?

Two things sit outside the code. Your hosting control panel can rebuild or wipe the server, so it needs a strong password and two-step login. Your Claude account can run your flows, so it needs the same.

What a Claude custom connector costs to run

I expected a Claude custom connector on its own server to be expensive. It isn’t.

ItemCostNotes
Server$72 a year (about $6 a month)4 GB of memory, 2 processors, 120 GB of disk, Ubuntu
DeepSeek API$1.94 in total so farPrepaid. The last 7 days cost $0.29 for 23 requests and about 110,000 tokens.
Domain name$0 extraA subdomain of a domain I already own
GitHub and the code$0Public repository, MIT license
ClaudePlan I already hadCustom connectors work on every plan

The daily check uses no AI at all, so it costs nothing beyond the server itself. Only Module 1’s capture and audit flows call DeepSeek, and they cost cents.

Rebuilding the Claude custom connector in five minutes

I wanted to be able to throw this server away. If it breaks, or I find a better deal, I want a new one running before my coffee gets cold.

So everything lives in one public repository. On a fresh Ubuntu server, one command does the whole setup in about five minutes. My first run took longer, as you will see below. It installs updates and Docker, turns on the firewall, starts the connector and sets the daily timer. It asks for three things: the server’s name, a token, and your project’s keys. Those keys are typed on the server and never stored in the code.

I was torn between Docker and a Claude skill for this. It turns out they do different jobs. Docker makes the server repeatable. The skill is a page of instructions that teaches any Claude chat how to use and look after the lab. Both are free, so the repository has both.

What went wrong, and what I changed

The first real setup did not go smoothly. Each problem made the setup better.

  • I locked myself out. The script closed remote login before setup had finished, and my connection dropped. My host’s repair mode got me back in. The script now locks the doors last.
  • The script stopped halfway. One command quietly swallowed the rest of the script. Now the script is read in full before any of it runs.
  • The first token was refused. The connector now accepts the token with or without the word “Bearer,” and its log says why it refused a request.
  • The data was on the wrong machine. My personal laptop held two weeks of verdicts the server didn’t have. I moved them through a GitHub pull request before switching the daily check over.

Run your own Claude custom connector

The code for this Claude custom connector is at github.com/psachdev/funaibuddy-lab. It is not tied to my project. Swap in your own agent by editing one file.

  1. Rent a small Ubuntu server and point a name at it.
  2. Run the one setup command from the README.
  3. In Claude, add a custom connector with your server’s address and token.
  4. Ask Claude to list your flows, then run the safest one first.

The thesis monitor itself lives at github.com/psachdev/thesis-drift-monitor. If you are new to how agents reason and act, my guide to ReAct prompting is a good place to start.

What comes next

Module 3 is retrieval: finding the one right paragraph inside a 200-page annual report. Now that the lab runs from chat, I can test it there, one flow at a time. Follow along on the series page.

Sources

Disclaimer

I own shares of BWX Technologies (BWXT) and Sterling Infrastructure (STRL), the companies the thesis monitor tracks. Nothing here is investment advice. It is software, and a record of building it. Claude, made by Anthropic, helped build and write this project.


Discover more from AIBuddy

Subscribe to get the latest posts sent to your email.

Leave a Reply

I’m Prateek

Greetings and welcome to AIBuddy, my cherished digital haven where AI intersects with insightful discourse. Together, we’ll embark on a voyage filled with creativity, delve into spiritual wisdom, and conduct intriguing experiments using OpenAI’s groundbreaking tools. Prepare to infuse innovation into every step we take!

Let’s connect

← Back

Thank you for your response. ✨

Discover more from AIBuddy

Subscribe now to keep reading and get access to the full archive.

Continue reading