Re:Trading with Claude (and writing your own MCP server)
by maxwellg on Sunday May 25, 2025 @06:44PM
(#44091935)
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.
[ Parent
| on HN ]
Re:Trading with Claude (and writing your own MCP server)
by UltraSane on Sunday May 25, 2025 @07:39PM
(#44092354)
Go is pretty miserable for dealing with JSON compared to Python
Re:Trading with Claude (and writing your own MCP server)
by Zambyte on Sunday May 25, 2025 @09:25PM
(#44093034)
Interesting, Go is actually a language I tend to reach for when dealing with JSON.
Re:Trading with Claude (and writing your own MCP server)
by abound on Sunday May 25, 2025 @09:50PM
(#44093182)
I 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.
Re:Trading with Claude (and writing your own MCP server)
by maxwellg on Monday May 26, 2025 @10:53AM
(#44098009)
It 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.
Re:Trading with Claude (and writing your own MCP server)
by worldsayshi on Monday May 26, 2025 @03:53AM
(#44095043)
I like Go, but Typescript/Javascript really seem like the ideal languages for dealing with JSON.
Re:Trading with Claude (and writing your own MCP server)
by haolez on Monday May 26, 2025 @06:05AM
(#44095807)
Well, the JS in the name is for JavaScript :)
Re:Trading with Claude (and writing your own MCP server)
by worldsayshi on Monday May 26, 2025 @07:41AM
(#44096437)
Yeah, although I'm surprised that not more languages have designed data interaction to be more JSON like. In JS it just feels like I'm interacting with JSON directly. Most other languages have some layer of "weirdness"/indirection between the language runtime and the data.
Like in Go I have to define field names twice. Once for the Go field and once for the field name in the actual JSON structure. Not even Python allows for copy-paste-able json. I have to do a bunch of syntax corrections for it to work.
Re:Trading with Claude (and writing your own MCP server)
by pjmlp on Monday May 26, 2025 @04:04AM
(#44095117)
It applies to most stuff not only dealing with JSON, but it got lucky being tied to Docker and Kubernetes adoption and everything else that sprung out their ecosystem, so here we are.
Re:Trading with Claude (and writing your own MCP server)
by dangelov on Monday May 26, 2025 @08:30AM
(#44096830)
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)
by maxwellg on Monday May 26, 2025 @10:55AM
(#44098033)
Check out https://github.com/metoro-io/mcp-golang - looks like they support strongly typed tool arguments.