9 ms·
Trading with Claude, and writing your own MCP server
- faizshah 1y agoI’ve been doing this as well it also works well when you hook it up to Edgar or feed in investor relations documents or earnings transcripts. You can extract a lot of data at scale for regressions using small models with few shot prompts running locally.
- whinvik 1y agoWhat do you mean by "regressions"?
- drnex 1y agoOP likely means statistical regressions.
- ozgrakkurt 1y agoScraping the documents with llm to generate numerical metrics and applying statistics on numbers
- peterldowns 1y agoGreat writeup! I was just working at Alpaca --- if you're interested in using Alpaca via MCP (or another way of integrating with LLMs), reach out with your usecase and I'd be happy to put you in touch with the right people.
- dokka 1y agoI also did this a few months ago using a custom MCP server I built for the Alpaca API, the yfinance MCP server, and a reddit MCP server, and the "sequential thinking" mcp server. I hade claude write a prompt that combined them all together starting with checking r/pennystocks for any news, looking up the individual ticker symbols with alpaca and yfinance, checking account balance and making a trade only if a very particular set of criteria was met. I used claude code instead of desktop so that I could run it as a cron job, and it all works! I mostly built it to see if I could, not for any financial gain. I had it paper trading for a few months and it made a 2% profit on 100k. I really think someone that knows more about trading could do quite well with a setup like this, but it's not for me.
- duggan 1y agoDid you benchmark it against holding the same value in S&P 500 or similar ETF over the same period?
- mattnewton 1y agothey 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"
- puppymaster 1y agoeh depending on what he means by 'specific set of criteria'. The vol might be lower than benchmark (i doubt it since they are pennystocks) Pretty sure OP sharpe ratio is higher than benchmark for the last two months.
- duggan 1y agoI'm curious because 2% over the last few months while the S&P 500 is tanking might be interesting, but doing worse than the S&P 500 over the same period is less so. Hell, that's lower than inflation. It may be no better than flipping coins.
- nickysielicki 1y agoThis year? 2% is most certainly is outperforming the S&P500.
- mattnewton 1y agoeh, depends on the two months in question.
- swexbe 1y agoSomething like Russell 2k would be a better comparison if GP is trading pennystocks.
- cedws 1y ago
- maxwellg 1y agoSometimes 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.
- UltraSane 1y agoGo is pretty miserable for dealing with JSON compared to Python
- Zambyte 1y agoInteresting, Go is actually a language I tend to reach for when dealing with JSON.
- abound 1y agoI feel the same way, but to defend GP, if you're dealing with unknown JSON, the experience of deserializing `any` (or `map[string]any` if you know the top-level entity is an object) can be extremely tedious. For things like structured API requests/responses, Go's struct tags are basically exactly how I want my JSON ser/de to look.
- maxwellg 1y agoIt looks like there are a few Golang implementations of MCP. The one used in the article doesn't use tags but mcp-golang does. Tags are great! I love tags. - https://github.com/metoro-io/mcp-golang https://github.com/metoro-io/mcp-golang
- worldsayshi 1y agoI like Go, but Typescript/Javascript really seem like the ideal languages for dealing with JSON.
- 1y ago
- fdsafaefew 1y ago[flagged]
- shibayu36 1y agoI recently built an MCP server in Go too, so the use cases and implementation guide were very helpful, thank you.
- drob518 1y agoYikes! I can only imagine an LLM hallucinating my portfolio to zero.
- Incipient 1y agoIt may not hallucinate yours to zero, or mine, or franks, or Mary's, but at some point it will do it to someone. That's the issue I have with these approaches *at scale*. I'm sure one day we'll get 100.00% reliable outputs such that autonomous agents can do this, however that's not today.
- malfist 1y agoWe have those today, it's just not called AI, it's called things like idempotent APIs
- sgt101 1y agoYeah - feels like lunacy to me. I love the way that they get to the end of the article and then write that it doesn't really work!
- sgt101 1y agoI remember that John McCarthy used to condemn AI research as being a series of "look mom no hands" demos, but now we've got to "look mom I face planted". This work would be valid if it did things like : - Describe an intelligent effect rather than "invoked an API" - so something like the system evaluating the portfolio and the market and deciding what should be sold or offering buying opportunities based on some inference (this is not a great example for many reasons). - Measure and report the systems performance. The write-up says that the LLM fails, ok... how often? - Describe the failure cases, provide some theory as to why some things succeeded and others didn't. - Provide a way forward. What's next? Without doing these things this work isn't helpful and is part of the AI/Agent/MCP hype. Basically it's Bored Apes for AI.
- bboygravity 1y agoThe way this is done at scale is legalized front-running. You buy order flow from "free" retail brokers like Robin Hood (as a market maker) and then literally front run ALL trades. You then tell everybody you're giving them the best price (also the only price), lol. In other words: legalized crime.
- RyanShook 1y agoAny Claude desktop MCP recommendations?
- atlgator 1y agoThis thread is more about building your own custom mcp server. You can find a lot of official pre-made ones at https://mcpservers.org/ https://mcpservers.org/
- tonyhart7 1y agoalgo trading already there for decades but addition with AI that can process corporate performance, trends etc can make it to another level but if we do this, does this good for market??? since if everyone have access to this tool. meaning that market would get optimized to the ground and what happen to daily trader etc ??? does that mean everyone just win/lose money equally???
- life_enjoyer 1y agomeans the market becomes more efficient (assuming that the models are better at pricing assets compared to humans) as it's been getting more and more efficient as more people trade, information becomes more democratized.
- Stem0037 1y ago[dead]
- vFunct 1y agoMCP 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 really is as big as the iPhone.
- worldsayshi 1y agoBuy and sell agent, no confirmation needed. Here's my bank account. What can go wrong? I'm not categorically against the development, but I want to categorically confirm bank transactions.
- vFunct 1y agoWhat will likely happen is you give it a separate sandbox bank/credit card account with a small budget, and it transacts from that. I doubt it'll buy a house for you anytime soon. Honestly you wouldn't believe how good these models are if you haven't tried it. They really are amazing.
- flakeoil 1y ago/s
- piva00 1y agoFor speeding up chores it can be useful but removing the actual fun part of experiences, the research, the looking into, the figuring out, to instead only get the result of it sounds like a quick path into unfulfilling experiences. But to be honest, I don't think it will get to the state you dream about, just like smart homes never got close and are more of a hassle than an actual life improvement. Unless it is almost 100% perfect it will error out in ways that are extremely annoying, ordering the wrong groceries, booking the wrong trip, etc. It's really hard to cross over the point where it's absolutely helpful without hiccups.
- 1y ago
- shireboy 1y agoI’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?
- zackify 1y agoIt does an oauth redirect flow and the client stores the access token and sends it with requests after. I have built a couple using the spec from a month ago. It works alright. A lot of bad decisions are in the official implementations. For instance not using native Request / Response types in node, so you’re forced to write a bunch of garbage code to convert it, or install express just to use an mcp server. If I had the time I’d really make my own mcp implementation in typescript at least. I find most of the implementations to be so over engineered and abstracted on what could be simple function calls on top of the built in language For simple stuff like a json file that returns the location of your auth routes, you need to add a “middleware” When in reality you can just make a route and explicitly return that information. Every piece is some new abstraction it feels vibe coded.
- gemanor 1y agoYou answer is just about a discussion we had yesterday about the race between 'let build a standard that will allow the LLM to get programmatic decisions' and 'let build something that works' Most of the standard and implementation is focused in the vision of models and clients that automatically handle the tool overhead, while in reality everything that is related to MCP requires tons of boilerplate/middleware/garbage code.
- monai 1y agothese questions kill the vibe.
- dangelov 1y agoAuthor 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.
- whazor 1y agoI 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.
- kachapopopow 1y agoThere'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).
- rco8786 1y agoI didn't get the impression this was about competing on speed.
- fadsiooie3 1y ago[dead]
- foxes 1y agoYou trust a model to trade for you? Here [0] is a funny paper where a group of llms attempt to manage a vending machine. It ended with them trying to contact the fbi. [0] https://arxiv.org/pdf/2502.15840 https://arxiv.org/pdf/2502.15840
- DougN7 1y agoThat was a great read! Thanks for sharing.
- pglevy 1y agoDesigner and vibe coder here... I also had trouble getting Claude to create an MCP server. What I finally realized was I could just point it at one of the Typescript demo repos from Anthropic. Then it easily cranked out what I was asking for. Maybe not an issue now with Claude 4.
- varelse 1y ago[dead]
- belter 1y agoBe careful about the new version of Claude. Its very verbose, it writes a lot of code, but I just caught it, hard coding some replies to an API I was creating an introspection for. All this like in the middle of many hundreds of innocent lines of code. Go and review every single line of code. This is a pro developer colleague that will fail you when you least expect. Frankly the time savings are minimal for professional quality code. Some will say it was a problem with the prompt, but I would say it was mimicking the behavior I have seen professional developers do under a deadline. :-)
- vonnik 1y agoWould be great to see how you connect the server to data sources to create signal for trades.
- neomantra 1y agoI have an example of this with Databento market data. The MCP server was a proof-of-concept and needs improvement, but certainly a good base from fashioning your own specific MCP Tool [1]. This week I'm adding a SQL-based MCP server to my DataBento Golang Tutorial, but it's not there yet. [2]. That step will follow an MCP implementation like this, where it will just give a "sql" endpoint along with other tools to fill the database [3]. [1] https://github.com/NimbleMarkets/dbn-go/blob/main/cmd/dbn-go-mcp/README.md https://github.com/NimbleMarkets/dbn-go/blob/main/cmd/dbn-go... [2] https://github.com/NimbleMarkets/dbn-duckduck-goose https://github.com/NimbleMarkets/dbn-duckduck-goose [3] https://github.com/AgentDank/dank-mcp/blob/main/data/us/ct/mcp.go#L35 https://github.com/AgentDank/dank-mcp/blob/main/data/us/ct/m...
- Theodoreelissa 1y ago[dead]