Turn a Jira ticket into a PR with coding Agents
Now you can solve Jira tickets directly via Coding Agents. Just assign the ticket to Codegen and done!
This will generate a PR in a few minutes based on what’s detailed in the ticket!
Thanks to Codegen for partnering today!
Build a 100% local MCP Server and Client
Claude Desktop and Cursor rely on external LLMs to leverage MCP capabilities.
When building enterprise-grade solutions, keeping your data on your own servers becomes critical.
This is where learning to build local MCP clients becomes essential.
Let’s learn that today by building a 100% local MCP server and client.
Stack:
Build a 100% local and secure MCP client using mcp-use.
Integrate the client with Stagehand MCP server.
Use this setup to control and automate the browser.
A quick background before we get into the code.
MCP follows a client-server architecture where:
Host (Agent/IDE) runs the MCP Client to communicate with MCP Servers.
MCP Servers expose tools that can perform various actions.
This architecture enables secure and standardized AI tool integration.
With this understanding in mind, let's start building our own MCP servers and clients.
1️⃣ Build a simple MCP server
First, we create a simple MCP server using FastMCP with a tool that adds two numbers.
Decorate the method with the specified decorator.
Add a docstring to the method.
Implement the functionality.
Then create a configuration file that tells any client how to connect to this server.
2️⃣ Create MCP Client
Next, we build a client using mcp-use, powered by locally running LLMs.
It's completely secure and can run on your machine.
Let's integrate the MCP client and server we just created.
Here's a Streamlit UI for better accessibility that wraps the client we created above.
For didactic purposes, we're starting with a very simple server.
Now, let's make this more practical. We're going to build a browser automation MCP server using Stagehand.
With this, we can navigate websites, click buttons, fill out forms, and extract data using natural language commands (full code is in the GitHub repo shared later).
Here is the implementation:
Next, let's interact with the Stagehand MCP server.
In the video attached at the top, when asked to find the cheapest flight from one city to another:
It navigated to Google.
Typed in the query.
Scraped the relevant information.
Returned the results to the agent to generate a response.
That was simple, wasn’t it?
We used mcp-use because you can use it to connect any LLMs to MCP servers & create local MCP clients easily.
Compatible with Ollama & LangChain
Stream Agent output async
Built-in debugging mode, etc
Find the code for this project on GitHub here →
Thanks for reading.
P.S. For those wanting to develop “Industry ML” expertise:
At the end of the day, all businesses care about impact. That’s it!
Can you reduce costs?
Drive revenue?
Can you scale ML models?
Predict trends before they happen?
We have discussed several other topics (with implementations) that align with such topics.
Here are some of them:
Learn everything about MCPs in this crash course with 9 parts →
Learn how to build Agentic systems in a crash course with 14 parts.
Learn how to build real-world RAG apps and evaluate and scale them in this crash course.
Learn sophisticated graph architectures and how to train them on graph data.
So many real-world NLP systems rely on pairwise context scoring. Learn scalable approaches here.
Learn how to run large models on small devices using Quantization techniques.
Learn how to generate prediction intervals or sets with strong statistical guarantees for increasing trust using Conformal Predictions.
Learn how to identify causal relationships and answer business questions using causal inference in this crash course.
Learn how to scale and implement ML model training in this practical guide.
Learn techniques to reliably test new models in production.
Learn how to build privacy-first ML systems using Federated Learning.
Learn 6 techniques with implementation to compress ML models.
All these resources will help you cultivate key skills that businesses and companies care about the most.
Share this post