6 ms·
Show HN: Mcp-use – Connect any LLM to any MCP
Hey Pietro and Luigi here, we are the authors of mcp-use (https://github.com/mcp-use/mcp-use https://github.com/mcp-use/mcp-use).
When the first MCP servers came out we were very excited about the technology, but as soon as we wanted to get our hands dirty, we found out that MCP could be used only through Claude Desktop or Cursor. As engineers, we did not like that. MCP seemed like something you wanted to use to build products and applications yourself, not something to hide behind a closed source application.
So we approached the SDK but were pretty dissatisfied with the developer experience (double async loops, lots of boilerplate). We decided to write mcp-use to make our lives easier.
mcp-use lets you connect any LLM to any MCP server in just 6 lines of code. We provide a high level abstraction over the official MCP SDK that makes your life easier and supports all the functionalities of the protocol.
Demo video here: https://www.youtube.com/watch?v=nL_B6LZAsp4 https://www.youtube.com/watch?v=nL_B6LZAsp4.
The key abstractions we provide are called MCPClient and MCPAgent.
MCPClient takes in a set of server configurations, automatically detects the transport type and creates a background task which handles the stream from/to the server.
MCPAgent is a combination of the MCPClient, an LLM, and a custom system prompt. It consumes the MCP client by transforming the tools, resources and prompts into model agnostic tools that can be called by the LLM.
The library also contains some cool utilities:
- secure sandboxed execution of MCP servers (we know the protocol doesn't shine for security)
- meta-tools that allow the agent to search over available servers and tools (to avoid context flooding) and connect dynamically to the server it needs (you could create the omnipotent agent with this).
Some cool things we did with this:
- write an agent that can use a browser and create/read linear tickets updated with latest information on the internet
- write an agent that has access to the metrics of our company to automatically create weekly reports.
- I connected an agent to an IKEA curtain I hacked an MCP on to adapt the lighting of my room from images of the lighting situation.
- recreated am open source claude code like CLI, with full MCP capability but with custom models and BYOK (https://github.com/mcp-use/mcp-use-cli https://github.com/mcp-use/mcp-use-cli).
We recently crossed 100,000 download and we are used by many organizations, including NASA!
We’d love to hear what you think of it, most importantly how we can improve it! We are happy to answer any questions and look forward to your comments.
- Tadpole9181 1y agoI'm not sure how this relates to the comment you replied to?
- d4rkp4ttern 1y agoRelated, in the sense that it is also a way to connect any LLM to any MCP. Not sure what you meant, I.e when there’s a discussion of a feature I think it’s normal to mention other systems with similar features?
- d4rkp4ttern 1y agoI see the confusion :) I meant my comment not as an actual reply to my own comment but more as an afterthought.
- tomhow 1y agoOK, we detached that comment to make it a root comment. Explained in detail here: https://news.ycombinator.com/item?id=44752785 https://news.ycombinator.com/item?id=44752785.
- tomhow 1y agoWe detached this subthread from https://news.ycombinator.com/item?id=44751518 https://news.ycombinator.com/item?id=44751518 and marked it off topic. We also detached https://news.ycombinator.com/item?id=44751518 https://news.ycombinator.com/item?id=44751518 from https://news.ycombinator.com/item?id=44751285 https://news.ycombinator.com/item?id=44751285 to make it a root comment, given that the author agreed it didn't make sense to be a reply (https://news.ycombinator.com/item?id=44751620 https://news.ycombinator.com/item?id=44751620).
- Tadpole9181 1y agoAppreciate your work, Tom!
- tomhow 1y ago