Lunatic — stock tools for your own agent
Deterministic stock-investigation tools and review pages that run on your persistent agent VM, with your data subscription and your AI agent. Nothing runs on our servers — there is no “our servers” in the loop.
What is it?
Lunatic is an open-source toolkit your coding agent (Meta Muse, Claude, or any MCP host) installs and runs locally:
- An MCP server that computes quotes, indicators (RSI, SMA/EMA, ATR), FCF trends, screens and generic-rule signals from your market-data provider (FMP first), with every value stamped with its source and date.
- A strategy builder: your agent proposes a rule, deterministic code validates and evaluates it against your data, and your strategies are saved only on your VM.
- A review UI of static TypeScript pages — tables and price/FCF charts rendered by pinned code, byte-identical for identical data. Your pages look the same after any model update; your agent links you to them instead of improvising tables or charts in chat.
How do I use it with Muse?
- Paste the repo link —
https://github.com/Dmytroportianka/lunatic— into your Muse session on your persistent VM and say “install this.” Your agent clones it, installs dependencies, and starts the local servers. - Set your own provider key in the VM environment (for example
FMP_API_KEYfrom your own FMP subscription), outside the chat. Never paste a key into a conversation. - Do the short onboarding. On your first session your agent will offer to learn your provider, the stocks you follow, how you want to track them, and what you want to measure. It will also help you come up with a strategy — proposing plain-language candidates, testing the one you choose, and saving it only if you approve. It's skippable, your answers stay on your VM, and you're only asked once; they become your agent's defaults afterwards.
- Just ask about stocks you're interested in — “how is NVDA”, “screen these tickers for FCF inflection”, “build me a strategy that buys oversold quality names”. Your agent calls the tools, gives you a short factual summary, and links to the consistent review page (ticker page with charts, screen, signals, strategy builder) showing the same numbers.
- Review on the pages, decide yourself. The chat is prose; the pages are the record — same layout, same numbers, every model version.
git clone git@github.com:Dmytroportianka/lunatic.git cd lunatic && bun install export FMP_API_KEY="your-own-subscription-key" # outside any chat bun run mcp & # tools → http://127.0.0.1:3007/mcp bun run start & # pages → http://127.0.0.1:3008
See it in a Muse session
Imaginary example. This is an invented conversation to show the workflow — not a real user, recommendation, or market call. Names, prices, and headlines below are illustrative only.
I just bought 10 NVDA at $172. Can you keep track of it?
Stored. Lunatic only recorded the purchase you completed elsewhere — it processed no financial operation.
Before we finish: do you already have an investment thesis for NVDA, or should I propose one so we have a point for when to notify you about selling?
I don't really have one. I just think AI demand keeps growing.
Here is a proposed thesis. It is not yours until you agree:
Claim: NVDA keeps benefiting while AI infrastructure demand and its ecosystem lead hold.
Sell reference points: FCF trend turns declining · close below SMA50 · news dynamics turn negative after a strong run.
Would soften it: rivals repeatedly win the headline launches, or sector hype cools while NVDA lags.
Agree, edit, or reject?
Agree. Warn me if it closes below the SMA50 or the news turns bad.
Saved and linked to your stored position. I will only raise it when one of those points newly triggers — and I will show the price, your P&L, the indicators, and the latest news dynamics, not just say “sell.”
Can you backtest buying oversold names on my watchlist too?
Done — the widget has the equity curve, every transaction, win rate, and max drawdown. Past replay only; it does not promise the next trade.

New sell-reference point for NVDA: it closed below its SMA50. You hold 10 shares at a $172.00 average; the alert includes the current price and P&L, RSI/EMA/ATR, and whether the latest news is improving or turning negative — so you can decide with context. Lunatic sent nothing itself; this scheduled agent run is delivering the local runner's output.
Real pages, not mock-ups
The screenshots on this page are captured from the actual Lunatic UI and widgets running locally, against real market history for MU (Micron Technology) — price history via Yahoo Finance, annual FCF/share derived from Nasdaq statement tables and SEC EDGAR share counts, captured 2026-11-27. A volatile cyclical was chosen on purpose: the run-up, the halving, the losing trades and the drawdown are all real. Historical data only — not a recommendation.

What it is not
- Not a hosted service, data provider, or AI. No accounts, no our-side market data, no our-side analysis or “AI picks”.
- Not investment, financial, tax, or legal advice, and not a recommendation to buy or sell anything.
- Not a broker: it cannot place trades, and nothing in it should be treated as a signal to act without your own verification.
Your responsibility — read this
You, the user, are solely responsible for how you use this software and for every decision you make with it. By installing and running Lunatic you accept that:
- You provide your own market-data subscription and key, and you are responsible for complying with your provider's terms, for the security of your key on your VM, and for any costs your provider charges.
- The AI interpreting the results is your own agent under your control. Tool output can be delayed, incomplete, or wrong (providers err; markets move). Verify anything important against primary sources before acting.
- Any investment or trading decision, and its outcome — profit or loss — is yours alone. The authors and contributors provide this software “as is”, without warranty of any kind, and accept no liability for your use of it, to the maximum extent permitted by law.
- Saved strategies and watchlists live on your VM. Back them up or lose them; nobody else has a copy.
If you do not accept this, do not install or use the software.
Privacy
Everything runs on your VM: your provider key, your saved strategies, your questions. Lunatic phones home to nobody. The only outbound calls are to the market-data provider you configured, with your key.