<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Serena on miti99</title><link>https://miti99.com/en/tags/serena/</link><description>Recent content in Serena on miti99</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 16 Nov 2026 17:39:19 +0700</lastBuildDate><atom:link href="https://miti99.com/en/tags/serena/index.xml" rel="self" type="application/rss+xml"/><item><title>Setting Up Claude Code &amp; Serena MCP on Windows</title><link>https://miti99.com/en/post/2025/07/27/</link><pubDate>Sun, 27 Jul 2025 00:00:00 +0700</pubDate><guid>https://miti99.com/en/post/2025/07/27/</guid><description>&lt;p&gt;&lt;em&gt;Lately I&amp;rsquo;ve been spamming quite a few AI-generated newsletters, which gets a bit repetitive. Since I recently tinkered with the Claude Code &amp;amp; Serena combo and found it pretty solid, I decided to write a post myself for a change of pace.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;&lt;p&gt;Recently I paid for a Claude Pro subscription, which includes Claude Code. Playing around with it has been fun, and I rate it higher than other agents because it works via the CLI without forcing me to install a new IDE (I&amp;rsquo;m much more used to JetBrains IDEs than VS Code. Plus, Cursor and Windsurf are annoying because they don&amp;rsquo;t sync settings across different machines, whereas Claude Code lets you share project configs). Besides, since Claude models are first-party from Anthropic, using them inside Claude Code is probably much better optimized :v&lt;/p&gt;
&lt;p&gt;In this post, I&amp;rsquo;ll walk through setting up Claude Code &amp;amp; Serena on Windows. Although &lt;a href="https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#:~:text=Added%20support%20for%20native%20Windows" rel="noopener noreferrer"&gt;Claude Code already supports Windows natively&lt;/a&gt;, when I tried it recently I still frequently ran into errors when creating new files. My guess is that it&amp;rsquo;s probably due to &lt;code&gt;/&lt;/code&gt; and &lt;code&gt;\&lt;/code&gt; in file paths, so for now I still use Claude Code through WSL. In addition, I&amp;rsquo;ll also show how to set up Serena for a Java project in this post.&lt;/p&gt;
&lt;p&gt;Alright, let&amp;rsquo;s get right to it!!&lt;/p&gt;
&lt;h2 id="installing-wsl"&gt;Installing WSL&lt;/h2&gt;&lt;p&gt;This part is easy — just follow the official guide here: &lt;a href="https://learn.microsoft.com/en-us/windows/wsl/install" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/windows/wsl/install&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;TLDR: Run the following command:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wsl --install
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Wait for the command to finish, restart your machine, and after rebooting it will install Ubuntu. Follow the prompts to set up a username and password for the distro.&lt;/p&gt;
&lt;h2 id="installing-claude-code"&gt;Installing Claude Code&lt;/h2&gt;&lt;h3 id="installing-nodejs"&gt;Installing Node.js&lt;/h3&gt;&lt;p&gt;Even though &lt;a href="https://docs.anthropic.com/en/docs/claude-code/setup#:~:text=Software%3A%20Node.js%2018%2B" rel="noopener noreferrer"&gt;Claude Code currently only requires Node.js 18+&lt;/a&gt; and a fresh WSL install gives you Ubuntu 24.04 (whose default &lt;code&gt;nodejs&lt;/code&gt; package is already version 18.x), my view is that you should always use the latest Node.js LTS release (currently 22.x) — who knows if Claude Code will bump its requirements later, and this way we&amp;rsquo;ll still be good to go :v So let&amp;rsquo;s follow the instructions here: &lt;a href="https://nodesource.com/products/distributions" rel="noopener noreferrer"&gt;https://nodesource.com/products/distributions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;TLDR:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;sudo apt-get install -y curl
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
node -v
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Next, we need to set up a global npm prefix so packages are installed into a subdirectory in your home folder, avoiding permission errors when running without root privileges, following this guide: &lt;a href="https://docs.anthropic.com/en/docs/claude-code/troubleshooting#alternative-solution%3A-create-a-user-writable-npm-prefix-for-global-installs" rel="noopener noreferrer"&gt;https://docs.anthropic.com/en/docs/claude-code/troubleshooting#alternative-solution%3A-create-a-user-writable-npm-prefix-for-global-installs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;TLDR:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo &amp;#39;export PATH=~/.npm-global/bin:$PATH&amp;#39; &amp;gt;&amp;gt; ~/.bashrc
source ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="installing-claude-code-1"&gt;Installing Claude Code&lt;/h3&gt;&lt;p&gt;Follow the official setup guide here: &lt;a href="https://docs.anthropic.com/en/docs/claude-code/setup" rel="noopener noreferrer"&gt;https://docs.anthropic.com/en/docs/claude-code/setup&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;TLDR:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;npm install -g @anthropic-ai/claude-code
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then run &lt;code&gt;claude&lt;/code&gt; and log in with your Claude Pro account or Anthropic &lt;code&gt;API_KEY&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="installing-serena"&gt;Installing Serena&lt;/h2&gt;&lt;h3 id="installing-uv"&gt;Installing uv&lt;/h3&gt;&lt;p&gt;Follow the installation guide here: &lt;a href="https://docs.astral.sh/uv/getting-started/installation/" rel="noopener noreferrer"&gt;https://docs.astral.sh/uv/getting-started/installation/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;TLDR:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;curl -LsSf https://astral.sh/uv/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="setting-up-serena-in-your-project"&gt;Setting Up Serena in Your Project&lt;/h3&gt;&lt;p&gt;Use &lt;code&gt;cd&lt;/code&gt; to navigate to your project directory and run the following command:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;claude mcp add -s project serena -- uvx --from git+https://github.com/oraios/serena serena-mcp-server --context ide-assistant --project $(pwd)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And that&amp;rsquo;s it! Every time you run &lt;code&gt;claude&lt;/code&gt; inside the project, the Serena MCP server will start automatically (remember to check Claude&amp;rsquo;s prompt when you run &lt;code&gt;claude&lt;/code&gt;, since Claude Code may ask you to confirm which MCP servers to launch).&lt;/p&gt;
&lt;h2 id="setting-up-serena-for-a-java-project"&gt;Setting Up Serena for a Java Project&lt;/h2&gt;&lt;p&gt;Because &lt;a href="https://github.com/oraios/serena?tab=readme-ov-file#claude-code:~:text=There%20may%20be%20issues%20with%20java%20on%20macos%20and%20linux" rel="noopener noreferrer"&gt;Serena currently has issues with Java projects when running on Linux and macOS&lt;/a&gt; — I tested it on a Gradle project and kept running into permission errors where it couldn&amp;rsquo;t execute the &lt;code&gt;java&lt;/code&gt; command, even though calling it directly in the terminal worked fine with no path or &lt;code&gt;chmod&lt;/code&gt; issues — there&amp;rsquo;s a slightly janky workaround for now: run Serena on Windows, then connect the Serena MCP client from WSL over SSE. Here are the details:&lt;/p&gt;
&lt;h3 id="on-windows"&gt;On Windows&lt;/h3&gt;&lt;h4 id="install-python"&gt;Install Python&lt;/h4&gt;&lt;p&gt;This part is pretty straightforward. Head over to the official site to download and install it: &lt;a href="https://www.python.org/downloads/" rel="noopener noreferrer"&gt;https://www.python.org/downloads/&lt;/a&gt;&lt;/p&gt;
&lt;h4 id="install-uv"&gt;Install uv&lt;/h4&gt;&lt;p&gt;TLDR:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;powershell -ExecutionPolicy ByPass -c &amp;#34;irm https://astral.sh/uv/install.ps1 | iex&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Or:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;pip install uv
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id="run-the-serena-server"&gt;Run the Serena Server&lt;/h4&gt;&lt;p&gt;Navigate to your project folder, open CMD or PowerShell, and run the following command:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;uvx --from git+https://github.com/oraios/serena serena-mcp-server --context ide-assistant --project . --transport sse --port 9121
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="in-wsl"&gt;In WSL&lt;/h3&gt;&lt;h4 id="find-the-host-ip"&gt;Find the Host IP&lt;/h4&gt;&lt;p&gt;Find the Windows host IP to access it from WSL following this guide: &lt;a href="https://learn.microsoft.com/en-us/windows/wsl/networking" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/windows/wsl/networking&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;TLDR:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;ip route show | grep -i default | awk &amp;#39;{ print $3}&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note down the IP in the output. For example, mine is &lt;code&gt;172.21.0.1&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: On WSL1, the IP is simply &lt;code&gt;127.0.0.1&lt;/code&gt;.&lt;/p&gt;
&lt;h4 id="set-up-the-serena-mcp-client"&gt;Set Up the Serena MCP Client&lt;/h4&gt;&lt;p&gt;Use &lt;code&gt;cd&lt;/code&gt; to go to your project folder and run:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;claude mcp add -s project --transport sse serena http://172.21.0.1:9121/sse
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Replace &lt;code&gt;172.21.0.1&lt;/code&gt; with the IP from the output in the previous step.&lt;/p&gt;
&lt;p&gt;After that, running &lt;code&gt;claude&lt;/code&gt; will connect to the MCP server running on the Windows host.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: For Java projects, Serena takes a while to initialize (sometimes up to a few minutes), so keep an eye on the dashboard (by default at http://127.0.0.1:24282/dashboard/index.html) to monitor its progress.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;&lt;p&gt;That wraps up my guide on setting up Claude Code &amp;amp; Serena MCP on Windows. Thanks for reading all the way to the end! If you run into any issues, feel free to leave a comment below and I&amp;rsquo;ll get back to you. See you in future posts!&lt;/p&gt;
&lt;p&gt;P.S.: Right now I&amp;rsquo;m experimenting with Claude Code on a refactoring task — if it goes well, proves effective, and I&amp;rsquo;m not too lazy, I&amp;rsquo;ll write a follow-up post to share how it went hehe :v&lt;/p&gt;
&lt;h2 id="update-29072025"&gt;Update 29/07/2025:&lt;/h2&gt;&lt;p&gt;For large projects, you should run &lt;code&gt;index-project&lt;/code&gt; before starting &lt;code&gt;serena-mcp-server&lt;/code&gt;, as documented here: uvx &amp;ndash;from git+https://github.com/oraios/serena index-project&lt;/p&gt;
&lt;p&gt;TLDR:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;uvx --from git+https://github.com/oraios/serena serena project index
&lt;/code&gt;&lt;/pre&gt;</description></item></channel></rss>