Live data from Hacker News

Trading with Claude, and writing your own MCP server

dangelov.com

51–60 of 90 posts

Re: Trading with Claude, and writing your own MCP server

#51
post #46

I think many firms already have (faster) 'sentiment' tools that parse news messages and automatically trade on those. I don't think a LLM can compete on speed which such tools. But a LLM could build a knowledge graph that parses niche news messages and tries to understand the entire picture and make bigger predictions.

There's always anomalies like copying a politicians portfolio, following insider trades with early recognition, etc, etc.

The market is unfortunately not really efficient. Or well... too efficient at times (insider information).

Re: Trading with Claude, and writing your own MCP server

#52

I’m trying to wrap my head around mcp but auth and security is still the confusing thing to me. In this case, I get there is an oauth redirect happening, but where is the token being stored? How would that work in an enterprise or saas environment where you want to expose an mcp for users but ensure they can only get “their” data? How does the LLm reliably tell the mcp who the current user is?

these questions kill the vibe.

Re: Trading with Claude, and writing your own MCP server

#54

I’m trying to wrap my head around mcp but auth and security is still the confusing thing to me. In this case, I get there is an oauth redirect happening, but where is the token being stored? How would that work in an enterprise or saas environment where you want to expose an mcp for users but ensure they can only get “their” data? How does the LLm reliably tell the mcp who the current user is?

Author here.

There's basically a couple of different ways to implement an MCP server - for this demo it's a local binary that communicates over stdio, so no OAuth process is taking place. It's only meant to run on your local machine.

To make the demo simpler to explore and understand, the binary loads it's configuration (SnapTrade API client id, secret, and username and secret) from a .env file that you populate with your credentials which allows it to fetch the right data.

Re: Trading with Claude, and writing your own MCP server

#55
post #6

Sometimes Go can get under my skin. The MCP SDK makes you jump through all these hoops to configure tools according to a JSON schema, but when it comes to handling the actual request you need to deal with parsing everything again out of a `map[string]any`. It's such a pain to need to reach for codegen all the time.

Yeah it's not ideal, but it mostly works - at least in this case. I think each MCP tool works best when it can be kept lean and needs only a small number of arguments.

Re: Trading with Claude, and writing your own MCP server

#57
post #25

MCP everywhere is going to be such a societal changer. Once your bank and credit cards get MCP servers, that's it. It's next level society. Like, immediately, I want it to order me some groceries based on what it sees in my fridge and what I cook. And to remind me to change my air filters. Or book my vacation for me, knowing I like a mediterranean vibe and Bistecco Florentine. I am absolutely excited for all of this.…

Given some of the caveats I mentioned towards the end of the article I'd be a bit wary putting too much trust in LLMs for this use case at this stage. But the field is moving so fast that I don't doubt it will soon be less error prone than a human doing it.

Re: Trading with Claude, and writing your own MCP server

#58

I’m trying to wrap my head around mcp but auth and security is still the confusing thing to me. In this case, I get there is an oauth redirect happening, but where is the token being stored? How would that work in an enterprise or saas environment where you want to expose an mcp for users but ensure they can only get “their” data? How does the LLm reliably tell the mcp who the current user is?

I've built a remote mcp with oauth2 auth from scratch just last week.

The standard has a page on authorization[0], though it's not particularly easy to read for someone not well-versed with OAuth.

In short, MCP just uses plain boring oauth, like any other oauth authorization. Like when you authorize an app to access your google calendar. The only difference is that instead of accessing your normal API, they access your MCP http endpoint. Each connection to that endpoint will pass the Authorisation header with an oauth token, which you can resolve to a user on your side. Same as you would with normal OAuth.

One cool bit is that MCP providers are supposed to support OAuth2 Dynamic Client Registration, which means that e.g. Claude can provision an OAuth2 client in your app programmatically (and get a client_id/client_secret that it can use for authorization flows).

When you add an MCP server to your Claude organization, you just add the MCP server. Each user will have to go through the integration's OAuth2 authorization flow separately.

[0]: https://modelcontextprotocol.io/specification/2025-03-26/bas...

Re: Trading with Claude, and writing your own MCP server

#59
post #11

Earlier quoted context omitted.

Did you benchmark it against holding the same value in S&P 500 or similar ETF over the same period?

they said their paper account did 2% over a few months, which is not beating the s&p 500, and is probably why they said "someone could make money off this, but not me"

This year? 2% is most certainly is outperforming the S&P500.

Re: Trading with Claude, and writing your own MCP server

#60
post #25

MCP everywhere is going to be such a societal changer. Once your bank and credit cards get MCP servers, that's it. It's next level society. Like, immediately, I want it to order me some groceries based on what it sees in my fridge and what I cook. And to remind me to change my air filters. Or book my vacation for me, knowing I like a mediterranean vibe and Bistecco Florentine. I am absolutely excited for all of this.…

> It's next level society. Like, immediately, I want it to order me some groceries based on what it sees in my fridge and what I cook. And to remind me to change my air filters. Or book my vacation for me, knowing I like a mediterranean vibe and Bistecco Florentine. This thing already exists though, it’s called a personal assistant. And since you’re already not willing to spend $400 a month on getting one, likely rev…

Surely a personal assistant costs more than $400/month?
Post reply on HN