You're in a Research Scientist interview at OpenAI.
The interviewer asks:
"How would you expand the context length of an LLM from 2K to 128K tokens?"
You: "I will fine-tune the model on longer docs with 128K context"
Interview over.
Here's what you missed:
Extending the context window isn't just about larger matrices.
In a traditional transformer, expanding tokens by 8x increases memory needs by 64x due to the quadratic complexity of attention. Refer to the image below!
So, how do we manage it?
continue...๐
1) Sparse Attention
It limits the attention computation to a subset of tokens by:
- Using local attention (tokens attend only to their neighbors).
- Letting the model learn which tokens to focus on.
But this has a trade-off between computational complexity and performance.
Everyone's using Cursor, Claude Desktop, and ChatGPT as MCP hosts, but if you're building your own apps that support MCP, you need custom clients.
Here's the problem: Writing MCP clients from scratch is painful and time-consuming.
Today, I'm showing you how to build custom MCP clients in minutes, not hours.
To prove this, I built a fully private, ultimate AI assistant that can:
- Connects to any MCP server
- Automates browser usage
- Scrapes web data seamlessly
- Controls the terminal of my computer
- Processes images, audio, and documents
- Remembers everything with knowledge graphs
The secret? mcp-use โ a 100% open-source framework that makes MCP integration trivial.
Building custom MCP agents takes 3 steps:
1. Define your MCP server configuration 2. Connect any LLM with the MCP client 3. Deploy your agent
That's it. No complex setup, no proprietary dependencies.
The best part? Everything runs locally. Your data stays private, and you control the entire stack.
Full breakdown with code...๐
Let's break this down by exploring each integration and understanding how it works, using code and illustrations:
1๏ธโฃ Stagehand MCP server
We begin by allowing our Agent to control a browser, navigate web pages, take screenshots, etc., using @Stagehanddev MCP.
Below, I asked a weather query, and the Agent autonomously responded to it by initiating a browser session.
There's one rule you can not miss if you want to do the same!
Here's the full breakdown (with code):
There are primarily 2 factors that determine how well an MCP app works:
- If the model is selecting the right tool?
- And if it's correctly preparing the tool call?
Today, let's learn how to evaluate any MCP workflow using @deepeval's MCP evaluations (open-source).
Let's go!
Here's the workflow:
- Integrate the MCP server with the LLM app.
- Send queries and log tool calls, tool outputs in DeepEval.
- Once done, run the eval to get insights on the MCP interactions.