<?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: nitrofire</title>
    <description>The latest articles on DEV Community by nitrofire (@nitrorcr).</description>
    <link>https://dev.to/nitrorcr</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3836767%2F25d51d31-a860-41a1-a48b-eb091c7302d0.jpeg</url>
      <title>DEV Community: nitrofire</title>
      <link>https://dev.to/nitrorcr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nitrorcr"/>
    <language>en</language>
    <item>
      <title>Building a Skill/MCP to Access Any Open-Source Repo's Code and Docs</title>
      <dc:creator>nitrofire</dc:creator>
      <pubDate>Sun, 10 May 2026 10:02:07 +0000</pubDate>
      <link>https://dev.to/nitrorcr/building-a-skillmcp-to-access-any-open-source-repos-code-and-docs-2cjk</link>
      <guid>https://dev.to/nitrorcr/building-a-skillmcp-to-access-any-open-source-repos-code-and-docs-2cjk</guid>
      <description>&lt;p&gt;I wanted to build a Skill/MCP that allows AI to access the source code and documentation of all open-source repositories to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ask AI questions about the underlying implementation of open-source projects, similar to Deepwiki, but using my own AI agent.&lt;/li&gt;
&lt;li&gt;Let AI reference the latest library documentation and source code while writing code, eliminating hallucinated or deprecated APIs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's dive into how it is built!&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Source
&lt;/h2&gt;

&lt;p&gt;There are two main options for retrieving source code from public GitHub repositories:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using the GitHub API.&lt;/li&gt;
&lt;li&gt;Cloning the repositories locally with &lt;code&gt;git clone&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I chose the latter because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Searching code via the GitHub Search API is relatively slow and has strict rate limits.&lt;/li&gt;
&lt;li&gt;It's difficult to implement directory tree listings efficiently using the GitHub API.&lt;/li&gt;
&lt;li&gt;While the initial &lt;code&gt;git clone&lt;/code&gt; takes some time, subsequent requests respond blazingly fast.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reducing Data Volume
&lt;/h2&gt;

&lt;p&gt;We don't want to clone entire repositories, as that would be too slow and consume too much storage. Instead, we can use git partial clone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &lt;span class="nt"&gt;--depth&lt;/span&gt; 1 &lt;span class="nt"&gt;--filter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;blob:limit&lt;span class="o"&gt;=&lt;/span&gt;100k &lt;span class="nt"&gt;--no-checkout&lt;/span&gt; https://github.com/user/repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--depth 1&lt;/code&gt;: Shallow clone, fetching only the latest commit.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--filter=blob:limit=100k&lt;/code&gt;: Filters out files larger than 100kb, which reduces the download size by up to 90%.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--no-checkout&lt;/code&gt;: Skips checking out the working directory. All data stays in the .git folder, further saving space.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because there is no working tree, all read operations are performed directly via &lt;code&gt;git&lt;/code&gt; commands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;List files: &lt;code&gt;git ls-tree -r HEAD --name-only&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Read a file: &lt;code&gt;git cat-file -p HEAD:src/main.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Search code: &lt;code&gt;git grep "function login" HEAD&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Associating Documentation
&lt;/h2&gt;

&lt;p&gt;Now we can read the source code. However, we also want the AI to read the documentation. If the docs are in the same repository, it's easy. But often, the documentation lives in an entirely separate repository.&lt;/p&gt;

&lt;p&gt;I used a simple approach to identify these doc repos: list all repositories under the same GitHub organization, filter the names containing &lt;code&gt;doc&lt;/code&gt;, and then have an LLM determine if there's a matching documentation repository based on the repo name and description. A cheap and fast model is more than enough for this task. AI makes this incredibly simple!&lt;/p&gt;

&lt;p&gt;This links the documentation repository so we can automatically provide it alongside the main repo whenever the AI accesses it.&lt;/p&gt;

&lt;p&gt;At this point, the core tool is basically complete. I won't go into detail here on how to wrap it into a Skill or MCP server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;I've deployed this tool on my server and provided ready-to-use Skill and MCP endpoints.&lt;/p&gt;

&lt;p&gt;For coding agents like OpenCode, Codex, Cursor, and Copilot, just run the following command to add the Skill:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx skills add https://github.com/NitroRCr/gread &lt;span class="nt"&gt;--skill&lt;/span&gt; gread
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For AI chat applications and other MCP clients, you can use the MCP endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://api.gread.dev/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JSON configuration reference:&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;"mcpServers"&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;"gread"&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;"streamableHttp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.gread.dev/mcp"&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;p&gt;Learn more:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://gread.dev/" rel="noopener noreferrer"&gt;gread.dev&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Open-source repo: &lt;a href="https://github.com/NitroRCr/gread" rel="noopener noreferrer"&gt;NitroRCr/gread&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gread.dev/#comparison" rel="noopener noreferrer"&gt;Comparison with existing tools&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
