Loading video player...
Hey, how it's going guys? In this video,
we are going to see how we can build our
own cloud code assistant, right? You
would have been using cloud code. Cloud
is by Enthropic. So, it also helps you,
you know, in your coding workflow or
when you are developing something,
right? So, in entire coding workflow, uh
it helps you to write code faster, build
applications, so on and so forth, right?
also part of the same w coding uh you
know the terminology that we know. So
that is fine. You would have been using
cloud code but how can you build your
own cloud code right? Uh that's what
we're going to do in this video. So if
you look at here on my screen, we have
this highle architecture diagram that I
will explain you because it's very
important for you to understand that how
it's going to work first and then I will
show you the demo and all and code is
completely for you know so you can take
this code uh make this better improve it
and do whatever you want to do. It's
Apache 2.0 license so you can do
whatever you want to do with this. So if
you look at here this is the GitHub
repository and the repository name is
your cloud code. So we are building this
you know using lang graph and MCP
servers. So lang graph we are using for
the orchestration and MCP servers that
we are using you know to use some tools
via uh you know MCP servers like local
file access directory access read access
uh duck go for web search and so on and
so forth. So if you look at here on this
user interaction layer you know here in
the user it kind of uh uses a CLI. So
this is based on CLI how we use cloud
code. Right? So on the CLI it's very
colorful. I'm using reach CLI for that.
And then once you interact with it is an
application layer. In the application
layer this is the main.py file. So this
is your main.py file. It says the main
entry point for the cloud code
assistant. A minimalist AI coding
assistant using langraph and MCP model
context protocol. Right. Uh very simple.
So you can see the reachy thing is
happening over here you know the
initialize agent uh it's all
asynchronous right you try it out
because there are multiple thing that's
going to happen at the same time uh and
you can see it over here right uh the
reach UI that you are using so this is
the mainpy file which is the entry point
it initializes the core agent so there's
an agent dopy file the core agent of the
application if you look at this agentpy
file here right uh just go up it says
core agent implementation using lang
graph and mcp we are loading everything
so you know we are getting get local
tools get mcp tools you know we are lang
lang graph langchen etc we have a
console so we initializing the console
we have an agent state because you know
through lang lang graph we are managing
all the states right so if you look at
here this is the core agent and then we
we have a state graph that compiles that
graph because lang graph is compile
compile the graph Right when you work
with Langra. So over here if you look at
this it has an agent state which is your
dictionary. It says type dictionary. You
can see the agent state. It has update
queries response persist invokes invokes
like the everything that we can do
within a langraph workflow. We are doing
it over here. Now this lang graph
basically manages multiple states. So
you can look at the core components. We
are using anthropic APIs cloud sonet 4.5
as an LLM. We have an SQL DB that
persist all the all the database related
thing that we persist and then it has
some local built-in tools. So we have
some tools that are locally built and we
use that in MCP tools optional like you
can also use Doug Duggo. You can also
use GitHub and etc through MCP and I'll
show you that. If you look at it, it
says local tools. What are the local
tools we have? We have run piest. So you
can also do you can also run some you
know test cases on your files etc. We
have search files. It can find out all
the files. It has get file info. So it
can find out the information about
different files. You know it has read
file. It can read some information from
the files. Uh it has list file. It can
list down all the files. It has write
files. It can write files. So it
performs all of these locally. Okay. In
your directory and also has MCP servers.
You know in the MC MCP servers we have
duck go search like if you want to
perform web search you know through
duck.go or GitHub API through personal
access token or pat. Right. So this MCP
I'll show you that in a little bit. So
this is a highle architecture very
simple anybody can understand nothing
technical garbage over here. Right. So
I'll go back to the code. So if you look
at here this is we have an class agent
state. Uh we have a base model
initializing it basically. Right. If you
look at here it says minimalist AI
coding assistant using lang graph and
MCP. It says state graph with three
nodes user input model response and tool
use. That's what we having three nodes
that we having. So lang graph is based
on nodes and ages. Then you compile it
and then you know run that uh your agent
workflow. So if you look at it says
persistent state using SQLite
checkpointing. So we have here SQLite.
If you look at this checkpoints DB in
the left hand side I'm using winds of
other agentic IDE just like VS code. Now
if you look at this checkpoints DB
that's where we persist everything that
we are doing over here. Now here we have
our init function. Of course, this is
fine. You know, we are like initializing
everything and like we have a we have a
dictionary that basically says stored
number options from bullet points. I'll
show you that in a little bit. Here we
are initializing the LLM and you can see
we initializing our chat entropic model.
So net 4.5. We have some tools that we
are initializing. We have local tools.
We are getting the local tools and I'll
show you from where we are getting these
local tools in a little bit. Right. And
then loading the MCP tools, binding
tools. We have some display options. Uh,
you know, we can make this better
actually a little bit. Excuse me. Uh,
this can also come back once.
Yeah, this can all go back.
Exactly. Or something like this. So, we
have this cloud code assistant. We are
setting up the workflow. You can see set
up the state graph workflow. Uh,
conditional routing. You know, we have
async def initial that initializes it.
We have a SQLite check pointer over
here, right? Uh that looks at our uh
local database that we have. It it try
to load the MCP tools. If S gives an
error, it gives an error. Compile the
workflow with recursion limit. It goes
in loop. So it has to set a recursion
limit over here. This is what we are
doing. These are all the terminal
things. I'll just go quickly. Model
response. You can see there's a simple
prompt. It says you are a minimalist AI
coding assistant. Your capabilities,
critical rules, blah blah blah. And you
can improve this uh by your own and you
can see the tool use and everything. So
this is our agent.py file. Fantastic,
right? This agent.py. You can also add
more things if you want. Now this is the
agent.py file. I already shown you the
entry point. So this is our entry point
main.py. Here we are writing all our MCP
tools. Let's see that guys. Right? It
says MCP tools integration. It supports
desktop desktop duck.go GitHub sandbox.
Now here we have get MCP tools. It says
load and return MCP tools. It has
desktop commander which is your all file
operations right? You can perform CRUD
applications you know locally if you
want remove the delete part but you can
do the CRU part create read update. We
have duck go web search that can search.
We have GitHub for repository management
and then we have sandbox python to run
python code to do testing so on and so
forth and you can see it over here.
We're using MCP toolkit from langen mcp
and we're writing all the commands.
These are all npx command that you see.
Make sure you have node installed. You
just do uv sync you know that will sync
because we have used uv to set this up.
So not a problem. duck dug go mcp web
that you see how we are using it from
over from here. Uh github mcp you need a
github pad token that I already have in
myb file that I cannot show you right
now. This is our mcp tools. Pretty
simple. Right now local tools you know
you can see the local tools written in
basic python as a decorator that we are
using over here that you can see. uh
pretty much standard things that we have
right how to read how to list how to you
know access files how to write files and
so on and so forth right simple thing
nothing fancy it's just about how do we
orchestrate these because orchestration
is important right so this is what is
happening uh we also have a uh MCP uh
Dino MCP over here that you see sandbox
python execution it says based on pyic
run python you can also run that uh
through a docker container I already
have that here you know in my system. So
I also have given this file. Now how
does this all work? Like I've been
talking for a while. I've been showing
you this first time. I'm showing you the
code first. Otherwise I would have shown
the demo. But this is a bit technical
video guys. It's not for like people who
don't understand code right. You have to
understand MCP and all to go through
this video. It's not for like pretty
beginner. It's for intermediate people.
Now what I'm going to do is I try to run
this right. That's that's the agenda of
this video and see how it works. So I
already have you can see I'm running UV
run. Now what happens is the moment you
run it says what would you like to do?
List all files in current directory. So
available tools run the test. Let's say
I just do first. It says list all files
in current directory. You can see
selected. Now it list down all the files
that I have. See here it says content of
this. It has listed down everything.
Executing tools. it executing that tool
list files then you can see list all
this is how it comes up let me first
show you that so this is where we are
running it right eval uh u run mainpy
the moment you run it it shows cloud
code cloud code assistant not cloud
cloud cloud code assistant uh you can
also make this a bit fancy it gone that
side it says minimalist AI coding
assistant powered by langraph plus mcp
type exit or quit to terminate So but we
are not going to do that. Now if you
scroll down a little bit it says loading
tools. So it's loaded the six local
tools agent in a slice successfully. It
says what would you like to do? I'm
saying okay list all files. So available
tools run the test read the readme file
search for code in the project and I
have given one as a choice and the
moment I have given this choice you can
see it has given me all the content you
know the tool result of this list file.
So this is one thing right. The the next
thing we can also do is you know you can
ask of of course you can do a lot of
other things actually here. Okay. So let
me just clear this terminal for you and
I'm going to again run this and you can
keep on going uh here you know so
available tools run the test read the
readme file and whatever. So let's say I
read the readmi files read the readme.md
file and you can see it's so beautifully
it has fetched the readme file for me.
So I'll just go and show it over here.
So this is the readmi file that we have
100% correct. Uh it's it's working
fantastically guys. Right now if you
look at here
I'll just go up. By the way this is my
entire yeah you can see the tool result
read file. This is my readme file. Let
me show you the readme.m here it says
cloud code assistant a minimalist AI
coding assistant built with langraph and
mcp. Now why I'm showing you this right?
If you really want to master this
technology, you cannot just be using
chat, GPT, Gemini, cloud, cursor and all
and say okay I'm an AI expert. You are
not an AI expert. You are just a prompt
engineer, right? You know how to build
this tools, how to build something like
cloud code, how to build something like
cursor. Take VS code which is open
source. Take VS code, take some other
models, build aentic workflows, aentic
IDEs, see how compiler works, how do you
make compiler, how the operating system
works. You have to go that deep guys.
Trust me then you becomes then you
become a master of this technology
otherwise you are just a prompt engineer
or you are just a context engineer right
so it should not happen like that right
you have to go deep dive and then learn
these things how I've combined lang
graph with MCPS and build this CLI tool
just like cloud code of course this is
not like exactly like cloud code because
they have billions of dollars of funding
they have a set of team they can do
whatever they want to do I'm a solo guy
right so I'm just trying to see how we
can start because if you can start you
can really you passionate about it and
you can go and exactly build it. So this
is what it is right uh over here. Now
everything is given. Let's say you want
to visualize the workflow. I also have a
mermaid diagram generator that can
generate the diagrams and you can go go
and learn about it. So this is what it
is. You go and get this code try to
improve it over here. This is already
the architecture I shown you. You can
also bring up MCP tools. You can also
have local tools. Call whatever you want
to want to do. It's it's up to you.
Right? This is where you'll find out the
GitHub repository. You know the code is
completely for you. Go and use it. If
you want to contribute to this project,
you can also contribute it. Okay, feel
free to contribute. This is what I
wanted to show you guys in this video. A
quick video of how Langraph can be used
as an orchestration framework that can
use multiple tools either through Python
functions or you are using through MCP
tools. combine it together build cloud
code a CLI based code assistant for you
guys right that's all for this video let
me know if you have any question
thoughts or feedback in the comment box
if you have any other feedbacks you can
also reach out to me through my social
media channels find those information on
channel banner and channel about us I'll
also give you an agentic toolkit link in
the video description if you want to
find out a learning road map or if you
want to you know get some toolkits and
frameworks around AI agent and agentic
AI that's that link is available in this
video description. If you want to buy
readym made projects let's say some SAS
tools and some AI tools and want to sell
it in US or anywhere else in a higher
price. I also have a bundle of that
which is available around $1,000 that
you can take it and you can sell it for
$10,000 if you have the connections and
leads to sell it. That link is also
available in the video description.
Right. If you want to get involved in
any kind of AI training, we're also
doing that in physically, you know,
offline in class in Hyderabad and also
online. Comment that and we'll share you
this information. That's all for this
video. Thank you so much for watching.
See you in the next one.
In this tutorial, I'll show you how to build a minimalist AI coding assistant from scratch using Claude 3.5 Sonnet, LangGraph, and the Model Context Protocol (MCP). This is a fully functional AI agent that can read files, run tests, search code, and help you with your development workflow - all through a beautiful terminal interface! 🎯 What You'll Learn In this video, I walk you through building a production-ready AI coding assistant with: 1. LangGraph StateGraph for workflow orchestration 2. Claude 3.5 Sonnet as the LLM brain 3. 6 Built-in Tools for file operations, testing, and search 4. MCP Integration for optional web search and GitHub tools 5. Rich Terminal UI with colorful output and numbered options 6. SQLite Checkpointing for conversation persistence 7. UV Package Manager for fast dependency management Key Features: ✅ Interactive CLI with colorful UI ✅ 6 Local Tools (read_file, list_files, write_file, run_pytest, search_files, get_file_info) ✅ Optional MCP servers for web search and GitHub integration ✅ Automatic tool execution based on user requests ✅ Numbered option selection for easy interaction ✅ SQLite-based conversation history ✅ Complete test suite included ✅ Docker support for sandboxed execution 💬 Let's Connect If you found this tutorial helpful, please LIKE this video, SUBSCRIBE to the channel for more AI development content, and COMMENT below with any questions or what you'd like to see next! 🔔 Don't forget to hit the notification bell to stay updated with my latest videos on GenAI, machine learning, and software development. Get the Agentic AI Master Bundle Kit: https://aianytime5.gumroad.com/l/uqmyk 6 in 1 AI Agents Project & SaaS App: https://aianytime5.gumroad.com/l/fbeifc GitHub Repo: https://github.com/AIAnytime/Your-Claude-Code Build real-world AI with tutorials, tools, and research from India’s fastest-growing AI community. 👤 Creator’s LinkedIn (Sonu Kumar) Portfolio Site: https://sonukumar.site/ 🌐 AI Anytime's Website: https://aianytime.net/ 🗓️ Office Hours (AI Consulting): https://officehours.aianytime.net/ 👥 LinkedIn (Community Page): https://www.linkedin.com/company/ai-anytime/ 💬 Join Our Discord: https://discord.com/invite/4aGc9PSMgE 👤 Creator’s LinkedIn (Sonu Kumar): https://www.linkedin.com/in/sonukr0/ 🎁 Support the Channel 💸 UPI ID: sonu1000raw@ybl ₿ Bitcoin Wallet: bc1qsneqznxpzyxzzv006jthz4c8v8h5cs57myw342 ✅ Join this Channel for Perks Get access to members-only content and community perks: https://www.youtube.com/channel/UC-zVytOQB62OwMhKRi0TDvg/join #claudecode #claude #mcp