Hacker News new | ask | show | jobs
Show HN: mcp-golang – Build custom tools for LLMs in go (github.com)
5 points by cbatt 557 days ago
Anthropic released the Model Context Protocol a couple weeks ago - https://www.anthropic.com/news/model-context-protocol. They have official sdks for python and typescript but nothing for go, so I wrote one!

The main goal is to provide a low boilerplate sdk to write MCP servers, you can spin up a server which can give an LLM access to weather forecasts like this: https://github.com/metoro-io/mcp-golang/blob/main/examples/g... . Using it here: https://youtu.be/xaMkMl_R-0A

The library handles generating all the MCP endpoints and input schemas for the model by introspecting the types of the structs + annotations for the handlers.

I'm currently working on filling out the rest of the optional server features in the protocol and hope to move on to a client implementation soon. If any folks find this interesting, help is always appreciated!

1 comments

Something that I don’t get about MCP servers is how will this work in Production when the MCP server is used by many clients. It does not have auth built in. Does this mean that users will have to host their own MCP Servers locally? It’s just not very practical.

I know it’s not related to your Go SDK, it’s just something that I have been wondering.

Yeah auth is not part of the MCP spec at the moment. This thread has the current state of the world though: https://github.com/modelcontextprotocol/specification/discus...

And there's a concrete PR open at https://github.com/modelcontextprotocol/specification/pull/1... which suggests that there will be an auth capability with both oauth and credential (api keys etc) which seems like it will make it's way into the next release of the spec