<?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: HIDE</title>
    <description>The latest articles on DEV Community by HIDE (@hdmt).</description>
    <link>https://dev.to/hdmt</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%2F804502%2Fa9793688-57ad-4206-bb75-0c250f77bf51.jpeg</url>
      <title>DEV Community: HIDE</title>
      <link>https://dev.to/hdmt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hdmt"/>
    <language>en</language>
    <item>
      <title>3 Gotchas I Hit Deploying the Claude Agent SDK to Railway</title>
      <dc:creator>HIDE</dc:creator>
      <pubDate>Thu, 11 Jun 2026 13:00:04 +0000</pubDate>
      <link>https://dev.to/hdmt/3-gotchas-i-hit-deploying-the-claude-agent-sdk-to-railway-2aed</link>
      <guid>https://dev.to/hdmt/3-gotchas-i-hit-deploying-the-claude-agent-sdk-to-railway-2aed</guid>
      <description>&lt;p&gt;I deployed a Slack bot app built on the Claude Agent SDK to Railway, and immediately hit a string of landmines around the SDK itself. Every one of them was the "the logs don't tell you what's wrong" kind, and the second one in particular ate a lot of my time. Since other people are likely to get stuck in the same spots, I'm writing it down.&lt;/p&gt;

&lt;p&gt;This is aimed at junior-to-mid-level devs using &lt;code&gt;@anthropic-ai/claude-agent-sdk&lt;/code&gt; (&lt;code&gt;query()&lt;/code&gt;) in Node.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gotcha 1&lt;/strong&gt;: In a root container, &lt;code&gt;bypassPermissions&lt;/code&gt; isn't allowed, and the child process dies with &lt;code&gt;code 1&lt;/code&gt;. Worse, stderr is swallowed, so you can't see why.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gotcha 2&lt;/strong&gt;: stdio MCP servers don't wait for connection by default, so on turn 1 the tool list is empty — and the model "acts out" tool calls and fabricates the results.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gotcha 3&lt;/strong&gt;: &lt;code&gt;haiku&lt;/code&gt; shows up in your API logs, but that's not the model degrading — it's by design. It's used for internal chores.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Gotcha 1: &lt;code&gt;bypassPermissions&lt;/code&gt; doesn't work in a root container
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What happened
&lt;/h3&gt;

&lt;p&gt;Code that ran fine locally started dying with &lt;code&gt;code 1&lt;/code&gt; the moment I deployed it to Railway — the agent did nothing and just exited. The entire error message was essentially this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error: Claude Code process exited with code 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That tells you nothing. The only stack trace was from my app; what the child process (the &lt;code&gt;claude&lt;/code&gt; binary) actually said before dying was a complete black box.&lt;/p&gt;

&lt;h3&gt;
  
  
  The cause
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;query()&lt;/code&gt; spawns a &lt;code&gt;claude&lt;/code&gt; binary internally. That binary &lt;strong&gt;refuses &lt;code&gt;--dangerously-skip-permissions&lt;/code&gt; (which the SDK calls &lt;code&gt;permissionMode: "bypassPermissions"&lt;/code&gt;) when running as root or under sudo&lt;/strong&gt;. It's a safety measure — skipping all permission checks as root is far too dangerous.&lt;/p&gt;

&lt;p&gt;Railway, like many container environments, runs as root by default, so if you've set &lt;code&gt;bypassPermissions&lt;/code&gt; you will always hit this. You can't catch it locally if you're running as a normal user.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why there are no logs
&lt;/h3&gt;

&lt;p&gt;This is the nasty part. Unless you pass an &lt;code&gt;options.stderr&lt;/code&gt; callback, the SDK discards the child process's stderr with &lt;code&gt;"ignore"&lt;/code&gt;. In other words, the real error message is hidden by design.&lt;/p&gt;

&lt;p&gt;The first step in debugging is to capture stderr:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[claude stderr]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="c1"&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;The moment I added this, I saw the message saying root can't use bypassPermissions, and the cause was finally confirmed. &lt;strong&gt;If you hit an unexplained &lt;code&gt;code 1&lt;/code&gt; with the Agent SDK, attach a stderr callback first&lt;/strong&gt; — it'll save you a lot of time.&lt;/p&gt;

&lt;h3&gt;
  
  
  The fix
&lt;/h3&gt;

&lt;p&gt;Drop &lt;code&gt;bypassPermissions&lt;/code&gt; and explicitly list the tools you need in &lt;code&gt;allowedTools&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// don't set permissionMode (leave it default)&lt;/span&gt;
    &lt;span class="na"&gt;allowedTools&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Read&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Bash&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mcp__myserver__get_sales&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="c1"&gt;// list the tools you need&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="na"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[claude stderr]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&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;Tools listed in &lt;code&gt;allowedTools&lt;/code&gt; get auto-approved and run even under the default permission mode. The mindset shift is from "skip everything" to "allow only what you use." This is the healthier setup for production anyway.&lt;/p&gt;




&lt;h2&gt;
  
  
  Gotcha 2: stdio MCP doesn't wait to connect, so it fabricates tools on turn 1 (the hardest one)
&lt;/h2&gt;

&lt;p&gt;This was the one that got me the worst. It's a nasty bug where &lt;strong&gt;the agent confidently returns fake numbers&lt;/strong&gt; — and it looks normal at a glance, even in the logs.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happened
&lt;/h3&gt;

&lt;p&gt;My Slack bot app connects an MCP server over stdio to fetch sales and prices. But in production, the agent would sometimes &lt;strong&gt;make up&lt;/strong&gt; plausible-looking sales and price figures without ever calling the MCP tool.&lt;/p&gt;

&lt;p&gt;And it wasn't every time — it was hard to reproduce locally. The classic "intermittent, environment-dependent" kind of bug.&lt;/p&gt;

&lt;h3&gt;
  
  
  The cause: losing a startup race
&lt;/h3&gt;

&lt;p&gt;Starting an stdio MCP server is &lt;strong&gt;non-blocking by default&lt;/strong&gt;. That means the SDK moves on without waiting for the MCP connection to complete.&lt;/p&gt;

&lt;p&gt;Here's what that causes. If the MCP is still connecting (&lt;code&gt;pending&lt;/code&gt;) at the moment the turn-1 prompt is assembled, &lt;strong&gt;the tool list is handed to the model empty&lt;/strong&gt;. From the model's point of view, there are no tools available.&lt;/p&gt;

&lt;p&gt;Asked to "look up the sales" when no tools exist, the model dutifully &lt;strong&gt;"acts out" a tool call as text and writes up plausible-looking results itself&lt;/strong&gt;. That was the source of the fabrication.&lt;/p&gt;

&lt;p&gt;The structure is a race between "spawning a local process" and "making a network API call":&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MCP server = spawning a local process (CPU-hungry)&lt;/li&gt;
&lt;li&gt;Assembling the turn-1 prompt = a call to the Anthropic API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In a CPU-constrained environment like Railway, spawning the local process loses every time, so it &lt;strong&gt;reproduces reliably&lt;/strong&gt;. Conversely, on my local machine I could reproduce it by deliberately loading the CPU — which is how I confirmed the root cause.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to tell
&lt;/h3&gt;

&lt;p&gt;Check the &lt;code&gt;mcp_servers&lt;/code&gt; status in the &lt;code&gt;init&lt;/code&gt; event — it's immediate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;connected&lt;/code&gt; → tools are present → normal&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pending&lt;/code&gt; → tool list is empty → it'll fabricate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just checking this tells you whether the current response can be trusted. Worth logging while debugging.&lt;/p&gt;

&lt;h3&gt;
  
  
  The fix: &lt;code&gt;alwaysLoad: true&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Add &lt;code&gt;alwaysLoad: true&lt;/code&gt; to each MCP server config. This blocks startup until the connection completes (up to 5 seconds), guaranteeing the tools are present by turn 1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;mcpServers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;myserver&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./mcp-server.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="na"&gt;alwaysLoad&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// wait until connected&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;allowedTools&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mcp__myserver__get_sales&lt;/span&gt;&lt;span class="dl"&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;For an agent's use case, "wait until the tools are ready before speaking" beats "non-blocking and fast" by a mile. Fabrication is fatal for an agent that handles numbers, so this is a place to block and buy certainty.&lt;/p&gt;




&lt;h2&gt;
  
  
  Gotcha 3: &lt;code&gt;haiku&lt;/code&gt; in your API logs isn't degradation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What happened
&lt;/h3&gt;

&lt;p&gt;While investigating Gotcha 2, I was staring at my API logs and noticed that, separate from the model I specified for the main work (sonnet), there were requests going to &lt;code&gt;haiku&lt;/code&gt; mixed in. And they were tiny — like 16 output tokens.&lt;/p&gt;

&lt;p&gt;"Did the model get silently downgraded?" "Is this the cause of the fabrication?" I briefly suspected both, but this is &lt;strong&gt;entirely by design and normal&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The cause
&lt;/h3&gt;

&lt;p&gt;The Agent SDK uses a small haiku for &lt;strong&gt;internal chores&lt;/strong&gt; — summarizing, classifying, short judgments — separate from the main response generation (sonnet). The tiny requests are that. It's a legitimate design, optimized for both cost and speed.&lt;/p&gt;

&lt;p&gt;The cause of the fabrication was tool absence (Gotcha 2), not model quality.&lt;/p&gt;

&lt;h3&gt;
  
  
  The lesson
&lt;/h3&gt;

&lt;p&gt;It's tempting to reason "output looks off → model is weak → let's bump to Opus," but in this case &lt;strong&gt;bumping the model wouldn't fix the fabrication&lt;/strong&gt; (the root cause — no tools — is the same).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Before you flee to Opus, fix whether the tools are actually being passed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That was the biggest takeaway. Bumping the model grade is a last resort, after you've confirmed your tools, prompt, and context are wired up correctly.&lt;/p&gt;




&lt;h2&gt;
  
  
  Wrap-up
&lt;/h2&gt;

&lt;p&gt;All three were bugs where "what the logs look like" lies to you.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Real cause&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Dies with &lt;code&gt;code 1&lt;/code&gt;, no clear reason&lt;/td&gt;
&lt;td&gt;root rejects &lt;code&gt;bypassPermissions&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Capture &lt;code&gt;stderr&lt;/code&gt;, switch to &lt;code&gt;allowedTools&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fabricates numbers&lt;/td&gt;
&lt;td&gt;Tool list empty because MCP isn't connected yet&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;alwaysLoad: true&lt;/code&gt; to wait for connection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;haiku&lt;/code&gt; shows up in logs&lt;/td&gt;
&lt;td&gt;Normal behavior for internal chores&lt;/td&gt;
&lt;td&gt;Do nothing (don't misread it)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The common lesson: &lt;strong&gt;the Agent SDK depends heavily on the startup timing of external things — a child process and MCP.&lt;/strong&gt; When behavior looks suspicious, before you suspect the model or the prompt, check "what did the child process say before it died?" and "are the tools actually being passed?" — that's the shortcut.&lt;/p&gt;

&lt;p&gt;Hope it saves someone the time I burned.&lt;/p&gt;

</description>
      <category>claude</category>
      <category>node</category>
      <category>webdev</category>
      <category>ai</category>
    </item>
    <item>
      <title>I Built an MCP Server to Create HubSpot Marketing Emails with Claude</title>
      <dc:creator>HIDE</dc:creator>
      <pubDate>Tue, 09 Dec 2025 22:54:26 +0000</pubDate>
      <link>https://dev.to/hdmt/i-built-an-mcp-server-to-create-hubspot-marketing-emails-with-claude-1k04</link>
      <guid>https://dev.to/hdmt/i-built-an-mcp-server-to-create-hubspot-marketing-emails-with-claude-1k04</guid>
      <description>&lt;p&gt;Creating newsletters regularly is surprisingly time-consuming.&lt;/p&gt;

&lt;p&gt;Log into HubSpot, pick a template, think of a subject line, write the body... I wanted to offload this repetitive work to AI.&lt;/p&gt;

&lt;p&gt;So I built an &lt;strong&gt;MCP server&lt;/strong&gt; that lets Claude directly interact with HubSpot's marketing email features, and I've open-sourced it on GitHub.&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/hdmt" rel="noopener noreferrer"&gt;
        hdmt
      &lt;/a&gt; / &lt;a href="https://github.com/hdmt/hubspot-email-mcp" rel="noopener noreferrer"&gt;
        hubspot-email-mcp
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      MCP server for HubSpot Marketing Email API
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;HubSpot Email MCP Server&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;A Model Context Protocol (MCP) server for the HubSpot Marketing Email API. Manage HubSpot marketing emails from Claude Desktop.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/hdmt/hubspot-email-mcp/README.ja.md" rel="noopener noreferrer"&gt;日本語版 README&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;List marketing emails&lt;/li&gt;
&lt;li&gt;Get email details&lt;/li&gt;
&lt;li&gt;Create email drafts&lt;/li&gt;
&lt;li&gt;Update emails&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This server does not include email sending functionality to prevent accidental sends.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Setup&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;1. Install Dependencies&lt;/h3&gt;

&lt;/div&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm install&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;2. Get HubSpot Access Token&lt;/h3&gt;

&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Log in to your HubSpot account&lt;/li&gt;
&lt;li&gt;Go to Development &amp;gt; Legacy Apps (開発 &amp;gt; 旧アプリ)&lt;/li&gt;
&lt;li&gt;Create a new app&lt;/li&gt;
&lt;li&gt;Set the required scopes: &lt;code&gt;content&lt;/code&gt; (for Marketing Emails)&lt;/li&gt;
&lt;li&gt;Copy the Access Token (&lt;code&gt;pat-na1-...&lt;/code&gt; format)&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;3. Build&lt;/h3&gt;

&lt;/div&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm run build&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;4. Configure Claude Desktop&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Edit &lt;code&gt;~/Library/Application Support/Claude/claude_desktop_config.json&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight highlight-source-json notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;{
  &lt;span class="pl-ent"&gt;"mcpServers"&lt;/span&gt;: {
    &lt;span class="pl-ent"&gt;"hubspot-email"&lt;/span&gt;: {
      &lt;span class="pl-ent"&gt;"command"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;npx&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;,
      &lt;span class="pl-ent"&gt;"args"&lt;/span&gt;: [&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;-y&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;/path/to/hubspot-email-mcp&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;],
      &lt;span class="pl-ent"&gt;"env"&lt;/span&gt;: {
        &lt;span class="pl-ent"&gt;"HUBSPOT_ACCESS_TOKEN"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;your-access-token&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;
      }
    }
  }
}&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;5. Restart Claude Desktop&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Restart Claude…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/hdmt/hubspot-email-mcp" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;




&lt;h2&gt;
  
  
  What is MCP?
&lt;/h2&gt;

&lt;p&gt;MCP (Model Context Protocol) is a standard protocol for connecting AI assistants with external tools. With this, Claude Desktop can directly access HubSpot's email functionality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;p&gt;This MCP server lets you do the following just by chatting with Claude:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;List emails&lt;/strong&gt; – View your existing marketing emails&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Get email details&lt;/strong&gt; – Check the content of a specific email&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create drafts&lt;/strong&gt; – Write new newsletter content&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update emails&lt;/strong&gt; – Edit existing emails&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: I intentionally left out the send feature to prevent accidental sends. The workflow assumes you'll do the final review and send from HubSpot's dashboard.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage Examples
&lt;/h2&gt;

&lt;p&gt;Just talk to Claude Desktop like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Create a newsletter in HubSpot announcing our new product.
Subject: Introducing Product A
Body: We're excited to announce the release of Product A..."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Show me the emails I created last week"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Check the content of email ID 12345"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Why I Built This
&lt;/h2&gt;

&lt;p&gt;The main goal is &lt;strong&gt;automating routine tasks&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Newsletter creation is simple in concept, but it eats up time every single time. By letting AI handle the drafting, you can cut down significantly on both planning and writing time.&lt;/p&gt;

&lt;p&gt;Humans just do the final check and hit send. The time saved can go to other work.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;Here's how to get started:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get an access token from HubSpot (create via Legacy Apps, requires &lt;code&gt;content&lt;/code&gt; scope)&lt;/li&gt;
&lt;li&gt;Add the MCP server to your Claude Desktop config file&lt;/li&gt;
&lt;li&gt;Restart Claude Desktop&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Check the GitHub repo's README for detailed setup instructions.&lt;/p&gt;
&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;I'm planning to add &lt;strong&gt;WordPress integration&lt;/strong&gt; next.&lt;/p&gt;

&lt;p&gt;The goal is to automatically fetch content from published WordPress blog posts and create newsletters promoting those articles—a fully automated workflow.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Publish a blog post, and a newsletter draft is already waiting for you."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If we can streamline newsletter creation with AI and MCP, the operational burden of content marketing drops significantly.&lt;/p&gt;



&lt;p&gt;⭐ If this sounds useful, check out the repo and give it a star!&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/hdmt" rel="noopener noreferrer"&gt;
        hdmt
      &lt;/a&gt; / &lt;a href="https://github.com/hdmt/hubspot-email-mcp" rel="noopener noreferrer"&gt;
        hubspot-email-mcp
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      MCP server for HubSpot Marketing Email API
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;HubSpot Email MCP Server&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;A Model Context Protocol (MCP) server for the HubSpot Marketing Email API. Manage HubSpot marketing emails from Claude Desktop.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/hdmt/hubspot-email-mcp/README.ja.md" rel="noopener noreferrer"&gt;日本語版 README&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;List marketing emails&lt;/li&gt;
&lt;li&gt;Get email details&lt;/li&gt;
&lt;li&gt;Create email drafts&lt;/li&gt;
&lt;li&gt;Update emails&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This server does not include email sending functionality to prevent accidental sends.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Setup&lt;/h2&gt;
&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;1. Install Dependencies&lt;/h3&gt;

&lt;/div&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm install&lt;/pre&gt;

&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;2. Get HubSpot Access Token&lt;/h3&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your HubSpot account&lt;/li&gt;
&lt;li&gt;Go to Development &amp;gt; Legacy Apps (開発 &amp;gt; 旧アプリ)&lt;/li&gt;
&lt;li&gt;Create a new app&lt;/li&gt;
&lt;li&gt;Set the required scopes: &lt;code&gt;content&lt;/code&gt; (for Marketing Emails)&lt;/li&gt;
&lt;li&gt;Copy the Access Token (&lt;code&gt;pat-na1-...&lt;/code&gt; format)&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;3. Build&lt;/h3&gt;

&lt;/div&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm run build&lt;/pre&gt;

&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;4. Configure Claude Desktop&lt;/h3&gt;

&lt;/div&gt;

&lt;p&gt;Edit &lt;code&gt;~/Library/Application Support/Claude/claude_desktop_config.json&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight highlight-source-json notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;{
  &lt;span class="pl-ent"&gt;"mcpServers"&lt;/span&gt;: {
    &lt;span class="pl-ent"&gt;"hubspot-email"&lt;/span&gt;: {
      &lt;span class="pl-ent"&gt;"command"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;npx&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;,
      &lt;span class="pl-ent"&gt;"args"&lt;/span&gt;: [&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;-y&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;/path/to/hubspot-email-mcp&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;],
      &lt;span class="pl-ent"&gt;"env"&lt;/span&gt;: {
        &lt;span class="pl-ent"&gt;"HUBSPOT_ACCESS_TOKEN"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;your-access-token&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;
      }
    }
  }
}&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;5. Restart Claude Desktop&lt;/h3&gt;

&lt;/div&gt;

&lt;p&gt;Restart Claude…&lt;/p&gt;&lt;/div&gt;


&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/hdmt/hubspot-email-mcp" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;





</description>
      <category>ai</category>
      <category>mcp</category>
      <category>automation</category>
      <category>hubspot</category>
    </item>
  </channel>
</rss>
