<?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>Forem: Aryan Patel</title>
    <description>The latest articles on Forem by Aryan Patel (@patelaryan66).</description>
    <link>https://forem.com/patelaryan66</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%2F3923919%2Fa9aad6c8-1612-4b11-a305-a3ac390387fb.jpeg</url>
      <title>Forem: Aryan Patel</title>
      <link>https://forem.com/patelaryan66</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/patelaryan66"/>
    <language>en</language>
    <item>
      <title>Why GitHub Apps Are Better Than Personal Access Tokens for Automation</title>
      <dc:creator>Aryan Patel</dc:creator>
      <pubDate>Mon, 11 May 2026 07:49:11 +0000</pubDate>
      <link>https://forem.com/patelaryan66/why-github-apps-are-better-than-personal-access-tokens-for-automation-1lg9</link>
      <guid>https://forem.com/patelaryan66/why-github-apps-are-better-than-personal-access-tokens-for-automation-1lg9</guid>
      <description>&lt;h2&gt;
  
  
  Why GitHub Apps Are Better Than Personal Access Tokens for Automation
&lt;/h2&gt;

&lt;p&gt;Modern engineering organizations rely heavily on automation. CI/CD pipelines, compliance tooling, deployment systems, audit bots, and internal developer platforms all need access to GitHub repositories and APIs.&lt;/p&gt;

&lt;p&gt;Historically, most of these integrations were built using Personal Access Tokens (PATs). While PATs are easy to create, they introduce serious security, operational, and scalability concerns.&lt;/p&gt;

&lt;p&gt;A better alternative is GitHub Apps.&lt;/p&gt;

&lt;p&gt;This article explains why GitHub Apps are a superior approach for enterprise automation, how they differ from PATs, and how teams can migrate existing workflows safely.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Problem with Personal Access Tokens
&lt;/h3&gt;

&lt;p&gt;A Personal Access Token is tied directly to a user account.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The token inherits the user's permissions&lt;/li&gt;
&lt;li&gt;Actions appear as if performed by that user&lt;/li&gt;
&lt;li&gt;Access survives beyond the original use case unless manually revoked&lt;/li&gt;
&lt;li&gt;Rotating credentials often becomes painful&lt;/li&gt;
&lt;li&gt;Offboarding employees can unintentionally break automation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A typical example looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ghp_xxxxxxxxx

curl &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: token &lt;/span&gt;&lt;span class="nv"&gt;$GITHUB_TOKEN&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  https://api.github.com/repos/org/repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works — but it creates several long-term risks.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Automation Depends on Humans
&lt;/h4&gt;

&lt;p&gt;PATs belong to users.&lt;/p&gt;

&lt;p&gt;If:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the employee leaves,&lt;/li&gt;
&lt;li&gt;their account is suspended,&lt;/li&gt;
&lt;li&gt;MFA policies change,&lt;/li&gt;
&lt;li&gt;the token expires,&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;then automation suddenly breaks.&lt;/p&gt;

&lt;p&gt;Many organizations discover hidden dependencies on personal tokens only during incidents.&lt;/p&gt;




&lt;h4&gt;
  
  
  2. Poor Auditability
&lt;/h4&gt;

&lt;p&gt;When a PAT performs an action:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;commits,&lt;/li&gt;
&lt;li&gt;issue comments,&lt;/li&gt;
&lt;li&gt;workflow dispatches,&lt;/li&gt;
&lt;li&gt;repository changes,&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;the activity appears under the user's identity.&lt;/p&gt;

&lt;p&gt;This makes it difficult to distinguish:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;human actions,&lt;/li&gt;
&lt;li&gt;automated actions,&lt;/li&gt;
&lt;li&gt;service-owned operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For compliance and audit programs, this becomes a major visibility issue.&lt;/p&gt;




&lt;h4&gt;
  
  
  3. Difficult Rotation at Scale
&lt;/h4&gt;

&lt;p&gt;Rotating PATs usually involves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;manually generating new tokens,&lt;/li&gt;
&lt;li&gt;updating Jenkins secrets,&lt;/li&gt;
&lt;li&gt;redeploying pipelines,&lt;/li&gt;
&lt;li&gt;coordinating downtime.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In large environments, this becomes operational debt.&lt;/p&gt;




&lt;h3&gt;
  
  
  What Are GitHub Apps?
&lt;/h3&gt;

&lt;p&gt;GitHub Apps are first-class integrations designed specifically for automation and platform tooling.&lt;/p&gt;

&lt;p&gt;Instead of acting as a user, a GitHub App acts as its own identity.&lt;/p&gt;

&lt;p&gt;A GitHub App can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;install only on selected repositories,&lt;/li&gt;
&lt;li&gt;generate short-lived access tokens,&lt;/li&gt;
&lt;li&gt;authenticate independently of human accounts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This model is significantly more secure and maintainable.&lt;/p&gt;




&lt;h3&gt;
  
  
  Key Advantages of GitHub Apps
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Short-Lived Tokens
&lt;/h4&gt;

&lt;p&gt;GitHub Apps generate temporary installation tokens that expire automatically (typically after 1 hour).&lt;/p&gt;

&lt;p&gt;This dramatically reduces credential risk.&lt;/p&gt;

&lt;p&gt;Even if a token leaks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the blast radius is smaller,&lt;/li&gt;
&lt;li&gt;the token expires quickly,&lt;/li&gt;
&lt;li&gt;long-term compromise is harder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PATs, by contrast, are frequently long-lived.&lt;/p&gt;




&lt;h4&gt;
  
  
  2. Decoupled from Human Accounts
&lt;/h4&gt;

&lt;p&gt;GitHub Apps continue functioning regardless of employee lifecycle events.&lt;/p&gt;

&lt;p&gt;This is especially important for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Jenkins automation&lt;/li&gt;
&lt;li&gt;internal platform tooling&lt;/li&gt;
&lt;li&gt;compliance systems&lt;/li&gt;
&lt;li&gt;deployment orchestration&lt;/li&gt;
&lt;li&gt;audit evidence collection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The automation becomes organization-owned rather than employee-owned.&lt;/p&gt;




&lt;h4&gt;
  
  
  3. Better Audit Trails
&lt;/h4&gt;

&lt;p&gt;Actions performed by the app are clearly attributed to the app itself.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-compliance-app[bot]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This improves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;compliance reporting,&lt;/li&gt;
&lt;li&gt;incident investigations,&lt;/li&gt;
&lt;li&gt;operational clarity.&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  4. Repository-Level Installation Control
&lt;/h4&gt;

&lt;p&gt;Apps can be installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;organization-wide,&lt;/li&gt;
&lt;li&gt;or only on specific repositories.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is extremely useful in enterprises where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;different business units own different repos,&lt;/li&gt;
&lt;li&gt;access boundaries matter,&lt;/li&gt;
&lt;li&gt;security teams require separation of duties.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Jenkins Native Support for GitHub Apps
&lt;/h3&gt;

&lt;p&gt;One reason teams historically relied on PATs was simplicity — Jenkins integrations traditionally expected a username and token.&lt;/p&gt;

&lt;p&gt;However, Jenkins now provides native support for GitHub App authentication through the GitHub Branch Source plugin.&lt;/p&gt;

&lt;p&gt;This means Jenkins can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;authenticate directly using a GitHub App,&lt;/li&gt;
&lt;li&gt;generate installation tokens automatically,&lt;/li&gt;
&lt;li&gt;avoid storing long-lived PATs entirely.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The integration supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;multibranch pipelines,&lt;/li&gt;
&lt;li&gt;organization folders,&lt;/li&gt;
&lt;li&gt;repository scanning,&lt;/li&gt;
&lt;li&gt;webhook-based builds.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of storing a PAT in Jenkins credentials, administrators can configure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the GitHub App ID,&lt;/li&gt;
&lt;li&gt;installation ID,&lt;/li&gt;
&lt;li&gt;private key.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Jenkins then handles token generation internally.&lt;/p&gt;

&lt;p&gt;This significantly improves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;credential hygiene,&lt;/li&gt;
&lt;li&gt;auditability,&lt;/li&gt;
&lt;li&gt;operational resilience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For teams already using Jenkins heavily, this lowers the barrier to adopting GitHub Apps because the support is built directly into the platform rather than requiring custom scripts or wrappers.&lt;/p&gt;

&lt;p&gt;Reference:&lt;br&gt;
&lt;a href="https://www.jenkins.io/blog/2020/04/16/github-app-authentication/" rel="noopener noreferrer"&gt;https://www.jenkins.io/blog/2020/04/16/github-app-authentication/&lt;/a&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  Real-World Example: Jenkins Automation
&lt;/h3&gt;

&lt;p&gt;Consider a Jenkins pipeline that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;scans repositories,&lt;/li&gt;
&lt;li&gt;opens pull requests,&lt;/li&gt;
&lt;li&gt;updates configuration files,&lt;/li&gt;
&lt;li&gt;uploads audit evidence.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using a PAT:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Jenkins -&amp;gt; PAT -&amp;gt; GitHub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tied to an employee,&lt;/li&gt;
&lt;li&gt;hard to rotate,&lt;/li&gt;
&lt;li&gt;difficult auditing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using a GitHub App:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Jenkins -&amp;gt; GitHub App Private Key -&amp;gt; Installation Token -&amp;gt; GitHub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ephemeral credentials,&lt;/li&gt;
&lt;li&gt;organization-owned identity,&lt;/li&gt;
&lt;li&gt;cleaner compliance posture.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This becomes especially valuable in enterprise CI/CD environments.&lt;/p&gt;




&lt;h3&gt;
  
  
  How GitHub App Authentication Works
&lt;/h3&gt;

&lt;p&gt;The authentication flow is slightly more complex than PATs but much safer.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 1: App Signs a JWT
&lt;/h4&gt;

&lt;p&gt;The app uses its private key to generate a JWT.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 2: Exchange JWT for Installation Token
&lt;/h4&gt;

&lt;p&gt;The JWT is exchanged for an installation access token.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 3: Use Installation Token
&lt;/h4&gt;

&lt;p&gt;The temporary token is used for GitHub API operations.&lt;/p&gt;




&lt;h3&gt;
  
  
  Example Using PyGithub
&lt;/h3&gt;

&lt;p&gt;Using PyGithub:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;github&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;GithubIntegration&lt;/span&gt;

&lt;span class="n"&gt;integration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;GithubIntegration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;app_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;APP_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;private_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;PRIVATE_KEY&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;access_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;integration&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_access_token&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;INSTALLATION_ID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;access_token&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This token can then be used exactly like a PAT — except it is short-lived.&lt;/p&gt;




&lt;h3&gt;
  
  
  Common Concerns
&lt;/h3&gt;

&lt;h4&gt;
  
  
  “GitHub Apps Are More Complex”
&lt;/h4&gt;

&lt;p&gt;This is true initially.&lt;/p&gt;

&lt;p&gt;However:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;most complexity is one-time setup,&lt;/li&gt;
&lt;li&gt;SDKs simplify token generation,&lt;/li&gt;
&lt;li&gt;operational maintenance becomes easier long-term.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The security benefits usually outweigh the learning curve.&lt;/p&gt;




&lt;h4&gt;
  
  
  “Our Existing Scripts Already Work”
&lt;/h4&gt;

&lt;p&gt;PAT-based systems often work until:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an employee leaves,&lt;/li&gt;
&lt;li&gt;security audits happen,&lt;/li&gt;
&lt;li&gt;token leaks occur,&lt;/li&gt;
&lt;li&gt;permissions become unmanageable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Migration is usually easier before scale increases further.&lt;/p&gt;




&lt;h3&gt;
  
  
  Recommended Use Cases for GitHub Apps
&lt;/h3&gt;

&lt;p&gt;GitHub Apps are especially effective for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CI/CD pipelines&lt;/li&gt;
&lt;li&gt;compliance automation&lt;/li&gt;
&lt;li&gt;repository governance&lt;/li&gt;
&lt;li&gt;automated pull requests&lt;/li&gt;
&lt;li&gt;issue management bots&lt;/li&gt;
&lt;li&gt;deployment orchestration&lt;/li&gt;
&lt;li&gt;audit tooling&lt;/li&gt;
&lt;li&gt;internal developer platforms&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  When PATs Still Make Sense
&lt;/h3&gt;

&lt;p&gt;PATs are still reasonable for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;temporary experimentation,&lt;/li&gt;
&lt;li&gt;local developer scripts,&lt;/li&gt;
&lt;li&gt;short-lived debugging,&lt;/li&gt;
&lt;li&gt;personal tooling,&lt;/li&gt;
&lt;li&gt;situations where a token must remain valid for longer than 1 hour without refresh handling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But for production-grade organizational automation, GitHub Apps are generally the better architectural choice.&lt;/p&gt;




&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;As engineering organizations mature, automation infrastructure becomes part of the security boundary.&lt;/p&gt;

&lt;p&gt;Using Personal Access Tokens for enterprise automation creates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;identity coupling,&lt;/li&gt;
&lt;li&gt;operational fragility,&lt;/li&gt;
&lt;li&gt;audit challenges.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;GitHub Apps provide a cleaner model built specifically for scalable automation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ephemeral credentials,&lt;/li&gt;
&lt;li&gt;organization-owned identities,&lt;/li&gt;
&lt;li&gt;better compliance posture.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With native GitHub App support now available in Jenkins, the operational overhead of adoption has also decreased significantly.&lt;/p&gt;

&lt;p&gt;For teams investing heavily in CI/CD, compliance automation, or internal platform engineering, moving from PATs to GitHub Apps is often a foundational improvement rather than just a security enhancement.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>devops</category>
      <category>github</category>
      <category>security</category>
    </item>
    <item>
      <title>Using Jenkins MCP to speed up DevOps workflows</title>
      <dc:creator>Aryan Patel</dc:creator>
      <pubDate>Mon, 11 May 2026 06:48:38 +0000</pubDate>
      <link>https://forem.com/patelaryan66/using-jenkins-mcp-to-speed-up-devops-workflows-3epg</link>
      <guid>https://forem.com/patelaryan66/using-jenkins-mcp-to-speed-up-devops-workflows-3epg</guid>
      <description>&lt;p&gt;Lately, I've been trying to find ways to speed up handling incident response in my squad.&lt;/p&gt;

&lt;p&gt;This has led me to explore &lt;a href="https://agentskills.io" rel="noopener noreferrer"&gt;Skills&lt;/a&gt; and &lt;a href="https://modelcontextprotocol.io/introduction" rel="noopener noreferrer"&gt;MCP&lt;/a&gt; in coding agents. We use &lt;a href="https://bob.ibm.com" rel="noopener noreferrer"&gt;IBM Bob&lt;/a&gt;, though everything in this article will hold for other popular agents out there.&lt;/p&gt;

&lt;p&gt;We use Jenkins to run all our automations. Setting up a Jenkins MCP server for Bob seemed like a natural next step. &lt;/p&gt;

&lt;p&gt;The MCP server lets us query job information in natural language, eliminating the need to navigate the Jenkins UI. It also opens up avenues of creating agent skills that can use the MCP tools to automate repeatable workflows&lt;/p&gt;

&lt;h3&gt;
  
  
  Pre-requisites
&lt;/h3&gt;

&lt;p&gt;To get started with Jenkins MCP, you'll need the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Jenkins server&lt;/li&gt;
&lt;li&gt;Jenkins API token&lt;/li&gt;
&lt;li&gt;Coding agent of choice&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Steps
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Installing the Jenkins MCP server plugin
&lt;/h4&gt;

&lt;p&gt;Follow the steps mentioned in &lt;a href="https://plugins.jenkins.io/mcp-server" rel="noopener noreferrer"&gt;https://plugins.jenkins.io/mcp-server&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once installed, the plugin should appear under the list of installed plugins in the UI. No other setting needs to be configured.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs9gjhoiyvex0d8rfgp5f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs9gjhoiyvex0d8rfgp5f.png" alt="Screenshot showing the MCP plugin in Jenkins UI" width="800" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Configuring MCP settings in Agent
&lt;/h4&gt;

&lt;p&gt;Open the Global MCP settings of your coding agent. For Bob, this file is located at &lt;code&gt;&amp;lt;user&amp;gt;/.bob/settings/mcp_settings.json&lt;/code&gt;. We need to add the following entry to the file:&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="nl"&gt;"jenkins"&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;"streamable-http"&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://&amp;lt;server-url&amp;gt;/mcp-server/mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"headers"&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;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Basic &amp;lt;base64 encoded username:password&amp;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;"disabled"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&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;h4&gt;
  
  
  (Optional) Configuring allowed tools
&lt;/h4&gt;

&lt;p&gt;You can optionally enable or disable tools supported by the MCP server in your Agent. List of tools can be found at &lt;a href="https://plugins.jenkins.io/mcp-server/#plugin-content-available-tools" rel="noopener noreferrer"&gt;https://plugins.jenkins.io/mcp-server/#plugin-content-available-tools&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To achieve this, either update &lt;code&gt;mcp_settings.json&lt;/code&gt; file with the following:&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="nl"&gt;"disabledTools"&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="s2"&gt;"triggerBuild"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"updateBuild"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"replayBuild"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"rebuildBuild"&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;or simply toggle the settings in your agent's MCP UI. For Bob, it's available at &lt;code&gt;Settings &amp;gt; MCP &amp;gt; jenkins&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgd5z8p28nsp8hx5eul6d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgd5z8p28nsp8hx5eul6d.png" alt="Bob UI showing MCP tools" width="800" height="477"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  MCP in action
&lt;/h4&gt;

&lt;p&gt;Here's an example Bob session using MCP tools to debug a Jenkins job failure:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0z3vow73kslbmrpkngv5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0z3vow73kslbmrpkngv5.png" alt="Prompt to debug a job failure, 1/2" width="800" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feleoevuxgm2eoz8laplm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feleoevuxgm2eoz8laplm.png" alt="Prompt to debug a job failure, 2/2" width="800" height="313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Caveats and Final Thoughts
&lt;/h3&gt;

&lt;p&gt;MCP servers can rapidly consume tokens if not used efficiently. While I'll explore optimization techniques in a future article, there's a broader principle worth noting: don't use AI agents for tasks that can be automated. Instead, leverage the coding agent to create scripts that handle repetitive work. Beyond token efficiency, there's a broader principle to consider: it's tempting to use LLMs as a catch-all solution, but this often leads to suboptimal results. These are powerful tools, and learning to use them effectively is a skill worth developing.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>sre</category>
      <category>devops</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
