<?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: Codepeel AI</title>
    <description>The latest articles on DEV Community by Codepeel AI (@codepeel_ai_f72084daf2b2b).</description>
    <link>https://dev.to/codepeel_ai_f72084daf2b2b</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%2F4264798%2F391ab48a-712e-400b-a996-9c9df84607bf.png</url>
      <title>DEV Community: Codepeel AI</title>
      <link>https://dev.to/codepeel_ai_f72084daf2b2b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codepeel_ai_f72084daf2b2b"/>
    <language>en</language>
    <item>
      <title>Running Automated Code Reviews Inside Claude Code and Cursor via Stdio MCP</title>
      <dc:creator>Codepeel AI</dc:creator>
      <pubDate>Wed, 25 Nov 2026 15:59:55 +0000</pubDate>
      <link>https://dev.to/codepeel_ai_f72084daf2b2b/running-automated-code-reviews-inside-claude-code-and-cursor-via-stdio-mcp-27ff</link>
      <guid>https://dev.to/codepeel_ai_f72084daf2b2b/running-automated-code-reviews-inside-claude-code-and-cursor-via-stdio-mcp-27ff</guid>
      <description>&lt;p&gt;Waiting for a GitHub Actions runner or PR webhook after you push slows down your feedback loop. When you work alone, catching a security bug or regression before &lt;code&gt;git commit&lt;/code&gt; saves you a round-trip.&lt;/p&gt;

&lt;p&gt;You can wire &lt;a href="https://www.codepeel.com" rel="noopener noreferrer"&gt;CodePeel&lt;/a&gt; directly into Claude Code, Cursor, Cline, or Roo using its local &lt;a href="https://modelcontextprotocol.io" rel="noopener noreferrer"&gt;Model Context Protocol&lt;/a&gt; server (&lt;code&gt;@codepeelai/codepeel&lt;/code&gt;). The server runs over standard I/O (&lt;code&gt;stdio&lt;/code&gt;) as a child process via &lt;code&gt;npx&lt;/code&gt;, so it opens zero network ports on your machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Registering the Server in One Command
&lt;/h2&gt;

&lt;p&gt;You need Node.js 18+ and a &lt;code&gt;cpk_&lt;/code&gt; API token from your &lt;a href="https://www.codepeel.com/app/settings?tab=api-tokens" rel="noopener noreferrer"&gt;CodePeel MCP settings&lt;/a&gt; (or you can use browser PKCE OAuth, covered below).&lt;/p&gt;

&lt;p&gt;On macOS or Linux:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add codepeel --env &lt;span class="nv"&gt;CODEPEEL_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;cpk_your_token_here -- npx -y @codepeelai/codepeel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Windows PowerShell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;claude&lt;/span&gt; &lt;span class="n"&gt;mcp&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt; &lt;span class="n"&gt;codepeel&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt; &lt;span class="no"&gt;CODEPEEL_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;cpk_your_token_here&lt;/span&gt; &lt;span class="s2"&gt;"--"&lt;/span&gt; &lt;span class="n"&gt;npx&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="nd"&gt;@codepeelai&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;codepeel&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That writes a standard &lt;code&gt;mcpServers&lt;/code&gt; block you can also drop into Cursor or Cline:&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="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"codepeel"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"@codepeelai/codepeel"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;"CODEPEEL_TOKEN"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"cpk_your_token_here"&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart Claude Code and run &lt;code&gt;/mcp&lt;/code&gt; to verify the connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two Auth Paths: Static Tokens vs. Loopback PKCE
&lt;/h2&gt;

&lt;p&gt;If you run automated scripts or CI checks, pass &lt;code&gt;CODEPEEL_TOKEN&lt;/code&gt; in the &lt;code&gt;env&lt;/code&gt; block. Invalid or expired tokens fail fast with an explicit error message.&lt;/p&gt;

&lt;p&gt;If you omit &lt;code&gt;CODEPEEL_TOKEN&lt;/code&gt;, the server runs an interactive OAuth 2.0 PKCE flow on the first tool call:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It generates a PKCE verifier and &lt;code&gt;S256&lt;/code&gt; challenge.&lt;/li&gt;
&lt;li&gt;It binds an ephemeral HTTP listener to &lt;code&gt;127.0.0.1:&amp;lt;PORT&amp;gt;&lt;/code&gt; and opens your browser.&lt;/li&gt;
&lt;li&gt;After GitHub approval, the callback exchanges the authorization code and caches the token locally.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Binding to &lt;code&gt;127.0.0.1&lt;/code&gt; avoids opening external firewall ports or setting up reverse proxies.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Tools Your Agent Gets
&lt;/h2&gt;

&lt;p&gt;Once connected, the agent gets four live review tools:&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;Required Input&lt;/th&gt;
&lt;th&gt;What It Does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;review_code&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;diff&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Scans a unified diff for bugs, OWASP flaws, and regressions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;fix_code&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;file&lt;/code&gt;, &lt;code&gt;issue&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Generates a concrete patch for a flagged issue&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ask_codepeel&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;question&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Answers architecture questions using diff context&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;check_credits&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;(none)&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Checks remaining monthly allowance without spending credits&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In practice, your agent stages a change, runs &lt;code&gt;git diff --cached&lt;/code&gt;, sends the diff to &lt;code&gt;review_code&lt;/code&gt;, and reads the structured findings. You can also query past PR reviews across repos without spending credits using &lt;code&gt;search_reviews&lt;/code&gt;, &lt;code&gt;get_review&lt;/code&gt;, &lt;code&gt;search_findings&lt;/code&gt;, and &lt;code&gt;get_review_analytics&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Source and Docs
&lt;/h2&gt;

&lt;p&gt;The MCP server source is open at &lt;a href="https://github.com/codepeel/mcp-server" rel="noopener noreferrer"&gt;codepeel/mcp-server&lt;/a&gt;. You can read the full setup guide on the &lt;a href="https://www.codepeel.com/blog/mcp-server-claude-code" rel="noopener noreferrer"&gt;CodePeel blog&lt;/a&gt; or test it on private repos with 30 free reviews/month at &lt;a href="https://www.codepeel.com" rel="noopener noreferrer"&gt;codepeel.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>claudecode</category>
      <category>devtools</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Why Line-Splicing Breaks Automated PR Fixes (And How Git Trees Fix It)</title>
      <dc:creator>Codepeel AI</dc:creator>
      <pubDate>Wed, 25 Nov 2026 15:27:55 +0000</pubDate>
      <link>https://dev.to/codepeel_ai_f72084daf2b2b/why-line-splicing-breaks-automated-pr-fixes-and-how-we-assemble-fix-prs-via-githubs-git-trees-api-58em</link>
      <guid>https://dev.to/codepeel_ai_f72084daf2b2b/why-line-splicing-breaks-automated-pr-fixes-and-how-we-assemble-fix-prs-via-githubs-git-trees-api-58em</guid>
      <description>&lt;p&gt;When you build a GitHub bot that opens fix pull requests instead of leaving inline comments, naive line-based patching breaks on multi-finding files. You apply the first hunk, and the line numbers shift underneath every remaining patch. Coordinates collide, syntax breaks, and Git rejects the hunk.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://www.codepeel.com" rel="noopener noreferrer"&gt;CodePeel&lt;/a&gt;, we avoided line-splicing by combining three parts: a strict fixability filter, full-buffer file rewrites, and GitHub's Git Data API. The worker constructs signed commits in memory without cloning the repository to disk.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Filter Out Vague Advice Before Writing Code
&lt;/h2&gt;

&lt;p&gt;Architectural comments like "split this class" or "add unit tests" need domain context from the author. Asking a model to guess those changes produces noisy diffs you end up closing.&lt;/p&gt;

&lt;p&gt;Our triage step drops any finding unless it includes three fields:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A concrete &lt;code&gt;problemCode&lt;/code&gt; and &lt;code&gt;fixCode&lt;/code&gt; pair.&lt;/li&gt;
&lt;li&gt;A line number inside the modified diff.&lt;/li&gt;
&lt;li&gt;A file path that exists in the repository tree.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Review Findings
      |
      v
Fixability Filter ---&amp;gt; Drops architectural notes and vague nits
      |
      v
Group by File Path (avoids colliding single-file patches)
      |
      v
Full-Buffer Rewrite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Rewrite the Whole File Buffer Instead of Splicing Lines
&lt;/h2&gt;

&lt;p&gt;Patching one hunk at a time fails when two bugs sit in the same file. Changing line count in the first patch invalidates the line offsets for the second.&lt;/p&gt;

&lt;p&gt;We rewrite the entire file buffer in one pass:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The worker fetches the file content at the PR head commit from the GitHub Contents API.&lt;/li&gt;
&lt;li&gt;We send the full file text alongside every fixable finding for that path.&lt;/li&gt;
&lt;li&gt;The generator returns one updated file with all patches applied together.&lt;/li&gt;
&lt;li&gt;We diff that output against the original buffer. If nothing changed, we skip the file so we avoid opening empty commits.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3. Build Commits via GitHub's Git Trees API
&lt;/h2&gt;

&lt;p&gt;Cloning a repo for every webhook slows down the worker and eats disk space. Instead, we build the commit tree directly through &lt;a href="https://docs.github.com/en/rest/git" rel="noopener noreferrer"&gt;GitHub's Git Data API&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Fetch PR Head        ---&amp;gt; Read branch name and Head SHA
         |
2. Read Tree SHA        ---&amp;gt; GET /repos/.../git/commits/{head_sha}
         |
3. Create Tree Object   ---&amp;gt; POST /repos/.../git/trees (base_tree = Head Tree)
         |
4. Create Commit        ---&amp;gt; POST /repos/.../commits (parent = Head SHA)
         |
5. Create Fix Branch    ---&amp;gt; POST /repos/.../git/refs/heads/codepeel/fix-pr-...
         |
6. Open Fix PR          ---&amp;gt; POST /repos/.../pulls (base = Feature Branch)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Setting &lt;code&gt;base_tree&lt;/code&gt; to the PR head tree means we only upload blobs for modified files. Unchanged files keep their existing tree pointers. We target your active feature branch as the base rather than &lt;code&gt;main&lt;/code&gt;, so your CI checks and test suite still gate the merge.&lt;/p&gt;

&lt;p&gt;Here is a typical SQL parameterization patch generated by this flow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;--- a/src/db/users.ts&lt;/span&gt;
&lt;span class="gi"&gt;+++ b/src/db/users.ts&lt;/span&gt;
&lt;span class="gu"&gt;@@ -39,7 +39,7 @@&lt;/span&gt;
   async findByEmail(email: string) {
&lt;span class="gd"&gt;-    const result = await db.query(`SELECT * FROM users WHERE email = '${email}'`);&lt;/span&gt;
&lt;span class="gi"&gt;+    const result = await db.query('SELECT * FROM users WHERE email = $1', [email]);&lt;/span&gt;
     return result.rows[0];
   }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Known Limits of Single-File Rewrites
&lt;/h2&gt;

&lt;p&gt;We keep two boundaries explicit in production:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No cross-file signature changes:&lt;/strong&gt; Because we rewrite files independently, refactors that change a shared function signature across multiple files stay out of auto-fix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Parallel webhook execution:&lt;/strong&gt; Fix generation runs alongside standard review comments. If a fix pass times out, your inline PR comments still post on time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you ship solo and want a reviewer that opens fix PRs on private repos, you can try &lt;a href="https://www.codepeel.com" rel="noopener noreferrer"&gt;CodePeel&lt;/a&gt; (30 reviews/month free on private repos, plus a &lt;a href="https://www.codepeel.com/trial" rel="noopener noreferrer"&gt;7-day Pro trial&lt;/a&gt;). You can also read the full architecture breakdown on the &lt;a href="https://www.codepeel.com/blog/auto-fix-pr-generation" rel="noopener noreferrer"&gt;CodePeel engineering blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>github</category>
      <category>devtools</category>
      <category>architecture</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
