<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mohannad Abdulaziz</title>
    <description>The latest articles on DEV Community by Mohannad Abdulaziz (@mohannad_ahmed).</description>
    <link>https://dev.to/mohannad_ahmed</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4023962%2Fd4b26e34-9341-49bf-9506-5807990e228a.jpg</url>
      <title>DEV Community: Mohannad Abdulaziz</title>
      <link>https://dev.to/mohannad_ahmed</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohannad_ahmed"/>
    <language>en</language>
    <item>
      <title>linux-mcp - My agent kept running terminal commands, so I built this</title>
      <dc:creator>Mohannad Abdulaziz</dc:creator>
      <pubDate>Fri, 10 Jul 2026 11:34:13 +0000</pubDate>
      <link>https://dev.to/mohannad_ahmed/linux-mcp-my-agent-kept-running-terminal-commands-so-i-built-this-2nim</link>
      <guid>https://dev.to/mohannad_ahmed/linux-mcp-my-agent-kept-running-terminal-commands-so-i-built-this-2nim</guid>
      <description>&lt;h1&gt;
  
  
  linux-mcp
&lt;/h1&gt;

&lt;p&gt;I was debugging a config issue on my server and chatting with OpenCode to help. Every time it needed to check system state - memory usage, disk space, running processes - it would chain together a long pipeline of terminal commands. &lt;code&gt;ps aux | grep ... | awk ...&lt;/code&gt;, &lt;code&gt;df -h | grep ...&lt;/code&gt;, you know the drill.&lt;/p&gt;

&lt;p&gt;It would work, fail, try a different pipeline, fail again, retry. What should have been a one-line answer turned into ten minutes of trial and error.&lt;/p&gt;

&lt;p&gt;That's when it clicked: the agent doesn't need better shell scripting. It needs a tool that already knows what to ask and how to parse the answer.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;linux-mcp&lt;/strong&gt; - an MCP server that gives AI agents direct, structured access to Linux system data. 40+ tools covering CPU, memory, disk, network, processes, Docker, systemd, GPU, security, and more.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;Instead of the agent running &lt;code&gt;free -m | grep Mem | awk '{print $3/$2 * 100}'&lt;/code&gt;, it calls &lt;code&gt;get_memory_info&lt;/code&gt; and gets this back:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"total_mb"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;16384&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"used_mb"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;12288&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"percent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;75.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"swap_total_mb"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4096&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"swap_used_mb"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No parsing, no retries, no "oops, wrong flag."&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;What it returns&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_system_snapshot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Everything in one call&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_cpu_info&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Usage, model, frequency, cores&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_memory_info&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;RAM and swap stats&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_disk_info&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Per-partition usage, inodes, mount options&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_network_connections&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;TCP/UDP connections with process info&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_docker_container_stats&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Live CPU/memory/network per container&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_gpu_info&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;NVIDIA/AMD/Intel - usage, temp, power&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_failed_logins&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Brute force detection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_man_page&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Any man page, any command&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_listening_ports&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ports and their processes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Full list: 40+ tools + MCP resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"linux-mcp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"local"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"/path/to/linux-mcp"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Build from source
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/Mohabdo21/linux-mcp.git
&lt;span class="nb"&gt;cd &lt;/span&gt;linux-mcp
make build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pre-built binary
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-LO&lt;/span&gt; https://github.com/Mohabdo21/linux-mcp/releases/latest/download/linux-mcp
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x linux-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Static binary available (no libc dependency).&lt;/p&gt;

&lt;h2&gt;
  
  
  Design
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Written in Go using the official MCP Go SDK&lt;/li&gt;
&lt;li&gt;STDIO transport - zero networking config&lt;/li&gt;
&lt;li&gt;Per-tool configurable timeouts&lt;/li&gt;
&lt;li&gt;SIGHUP config reload - no restart needed&lt;/li&gt;
&lt;li&gt;Docker tools optional - only activate if Docker is installed&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Mohabdo21/linux-mcp" rel="noopener noreferrer"&gt;Mohabdo21/linux-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP Registry:&lt;/strong&gt; &lt;code&gt;io.github.Mohabdo21/linux-mcp&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;License:&lt;/strong&gt; MIT&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>linux</category>
      <category>mcp</category>
      <category>devops</category>
      <category>go</category>
    </item>
  </channel>
</rss>
