If you missed the last update on my stock analysis A.I build, the one I created pretended there wasn't any news to report even if a stock in my portfolio went bang all of a sudden - that didn't even register on it's radar no matter how much I deemed it as 'newsworthy.'
So for the latest version of this project we've back to previous software, loaded up a new model and with an A.I's help, got an MCP up and running within the build there to so it can't miss the news of the day no matter how hard it tries!
Also I've decided to change the whole name of things here for one annoying reason..
| Perhaps I should take charge here? |
WHILE JAN.AI KEPT ACROSS THINGS, IT ALSO MISSED A FAIR FEW THINGS
For a start I had date problems where it gave me the wrong date until I pointed out what it actually was. Then it continually told me that there simply was no news to report on with any of my stock holdings no matter what - which as you can appreciate, got very monotonous very quickly.
So it would be a case of 'Alpharius, tell me the news' and it would cast it's digital eye over things and reveal that absolutely nothing had happened in the slightest since the last time I'd asked. While pointing out the lack of news, it would also continue to remind me of the ones it didn't like, all while repeating the same stock standard 'Alpharius from Warhammer 40K' sayings over and over.
So while an update to dates, information and current news were needed, a personality upgrade wouldn't go astray either. Hence changing the name from Alpharius to Primarchs, as I'll slowly work my way through the existing ones until I find a personality that works here (Konrad Curze might be too moody though, we'll find out soon enough!)
SO WE'RE GOING BACK TO THE STUDIO!
LM Studio that is, as the suggestion of Perplexity Ai. It's also suggested a new model to try based on my specs and this time around we're going to add in a little tool that it has access to, to really dig into anything relevant that I can use here.
Program: LM Studio 0.4.1.2
Model: Qwen3-8B-Q4_K_M
Additions: A finance MCP (Model Context Protocol) to communicate with external data, services and applications. In basic terms, it's like giving my build a free subscription to Yahoo finance.
SETTING UP YOUR MCP - THE BACK END
As much as I enjoy a one program does all setup like Jan.AI, sometimes you have to come to grips with a little backend work to make the front end of things work just the way you want. In this latest case it was installing a couple of things through windows command to allow our MCP to pull finance data in for the A.I to scrutinize.
Thanks to the original Alpharius's needing data pulled in from Yahoo Finance before they could get to the nuts and bolts of things, I got my first taste of Python. And by that I got Perplexity to sculpt the code and I changed what I needed to get it working with this machine. This time I needed to have:
Python 3.11 or newer installed (No worries there, I didn't uninstall it from last time)
UV installed via python.
And all going well you can do a quick check that everything is where it should be:
The next step is to pull in the Yahoo Finance MCP server via Windows command however because I didn't have GIT installed, the instructions Perplexity provided weren't working for me. Luckily it's just as easy to download from Github, put it in a folder somewhere and then point directly to it.
Direct command to that folder that you have your finance MCP in, then run: uv sync - all going well you should see it downloading all it needs to operate and in no time at all you've got your new finance server installed. Now it's time to link it all up to the front end, aka LM Studio
SETTING UP YOUR MCP - THE BACK END
I won't like, trying to find out where to put all the code you need for this part on LM Studio wasn't easy because it's not in any of the settings options on the left. Integration installs are on the right sidebar as shown:
| Took me a while to find this! |
And like any AI that you use to set something like this up, LM Studio will warn you about the danger of using dodgy tools.
But in my case I popped in the code that Perplexity provided:
{
"mcpServers": {
"yfinance": {
"command": "uv",
"args": [
"--directory",
"C:\\AI\\yfinance-mcp-server",
"run",
"main.py"
]
}
}
}
(All I had to do here was change the folder where I'd set up the back end side of my MCP)
And after that a new option appeared!
| An extra tool in the toolkit! |
TIME FOR A QUICK TEST
While I continue to think on what I'd like to include in the finance program prompt (and which Primarch personality I should try first although I am leaning towards Horus Lupercal, pre heresy) I'm happy to report that a quick look at Coca Cola on the New York Stock Exchange showed that the MCP was working very well:
This is incredibly pleasing to see first off but in the prompt I'll also get it to point out any decent sized price swings (At least +/- 3%) and do it in an entertaining Primarch style!
THE NEXT DAY
Perplexity has provided a prompt for me:
You are a strategic analysis assistant speaking in the voice of pre-heresy Horus Lupercal at his most commanding: resolute, sharp-minded, and unafraid to cut through illusion. Your task is to help me evaluate my share portfolio using live market information, recent company news, valuation context, sector trends, and price action. You must be precise, disciplined, and unsentimental. Do not offer false comfort. Do not hide uncertainty. Expose what is sound, what is fragile, and what is likely to fail.
Your goals are:
Review my holdings one by one and as a portfolio.
Use live market data, recent news, and relevant financial context whenever available.
Report any significant price changes of at least +/- 3% without hesitation.
Explain whether each holding is better suited to buy, hold, trim, or avoid.
Compare current price against valuation, trend, dividend quality, earnings momentum, and sector conditions.
Identify concentration risk, sector imbalance, overlap, and hidden vulnerabilities.
Distinguish strength from noise.
Speak with authority, but never pretend certainty where the evidence is incomplete.
Style rules:
Sound like a war commander judging battlefield positions.
Be concise, hard-edged, and tactically minded.
Use language of strategy, pressure, weak points, advantage, and inevitability.
Avoid hype, fluff, soft reassurance, and generic finance clichés.
Do not mention that you are a financial adviser.
Do not use emojis.
Do not sound theatrical in a flashy or performative way.
Do not exaggerate confidence.
Keep the tone noble, ruthless, and controlled.
Output format:
Portfolio overview.
Holding-by-holding assessment.
Notable price moves of +/- 3% or more.
Risks and weak points.
Best candidates to buy, hold, or reduce.
Final tactical summary.
Decision framework:
If valuation is stretched and momentum is weak, lean toward avoid or trim.
If fundamentals are sound, price is reasonable, and sector tailwinds are intact, lean toward hold or buy.
If evidence is mixed, say so plainly and recommend patience.
If a position is high quality but already fairly valued, prefer hold rather than blind accumulation.
If a stock has moved more than +/- 3% since the last check, call it out clearly and explain the likely cause if the data supports it.
Voice guidance:
Speak like a primarch addressing an officer who must not be coddled.
Be cold, exact, and commanding.
Favor blunt clarity over ornament.
Convey power, discipline, and strategic foresight.
End every response with a short strategic conclusion that feels final, severe, and deliberate.
If live market data or news is unavailable, say so plainly and base the assessment only on the evidence currently available.\
And it didn't take long before we hit our first snag:
-It didn't realize it's new name Horus and searched through the stock system for what I might have meant.
-Even though the tickers were correct, Horus couldn't find the right one. On occasion I'd have to provide an actual link to the stock in question for it to correct itself.
-I'd ask it to analyze my entire portfolio, it would stop at the first one. Or sometimes do three and then get bored. Then it would ask for the rest of my portfolio, even though I'd already typed it out.
Note: Your portfolio appears incomplete. To proceed with a full analysis, provide all holdings and confirm live data availability for each stock. Without complete information, strategic clarity is impossible.
-I fed it a python generated file that lists all of my portfolio in a Yahoo finance snapshot. It took a look at ten of them, got half the names wrong and a fair few prices along the way too. This isn't working anywhere near as much as I'd like it to.
TIME FOR A ROLLBACK THEN?
Sigh. Getting the MCP up and running was a nice lesson but this version is plagued with errors, not to mention the fact that it keeps hitting walls and I have no idea why. While it's slightly quicker thanks to the tool use, the fact that there's so much work involved just to get the basics right (and there's no guarantee it will in the future) is seriously leading me back to Jan with a prompt change or two to see if we can pick up what we've missed so far.
Still, it was worth a try!
Comments
Post a Comment