Skip to main content
Glama
HubSpot MCP Server

HubSpot MCP Server

by Vadosishe
README.md
# πŸš€ HubSpot MCP Server (Windows / macOS / Linux)

[English Version](#english-version) | [Русская вСрсия](#русская-вСрсия)

---

## English Version

A cross-platform **Model Context Protocol (MCP)** server written in **TypeScript / Node.js** (`@modelcontextprotocol/sdk`, `axios`, `zod`) that connects **HubSpot CRM** to **Claude Code, Claude Desktop, VS Code (Cline), Windsurf IDE, and Cursor** using natural language.

### Technical Architecture Highlights
- **MCP SDK + Zod Validation (`src/index.ts`):** Typed tool schemas for searching contacts, inspecting deals, reading associations, and safely creating/updating CRM entities.
- **Browser OAuth 2.0 Setup Wizard (`src/setup-mcp.ts`):** Built-in local OAuth 2.0 callback server, token refresh handling, and automatic client config registration across supported AI assistants without manual JSON editing.
- **HubSpot REST Client (`src/hubspot.ts`):** Wrapper around HubSpot CRM v3 endpoints with token management and structured error handling.

They can search contacts, view deal details, and create or update deals through their local AI assistants.

We designed this setup to be **completely frictionless and cross-platform**. Non-technical users do **not** need to install dependencies manually, edit complex JSON files, or write console commands. The installer does all the heavy lifting automatically!

### πŸ’» Onboarding Guide for Team Members (2 Easy Steps!)

#### Step 1. Unzip the Project Archive
1. Download the archive containing the server folder and extract it to any directory on your computer (e.g., `C:\hubspot-mcp-server\` on Windows or your Home folder on a Mac).

#### Step 2. Run the Setup Wizard

*   **πŸ–₯️ On Windows:**
    1. Double-click the **`setup.bat`** file inside the folder.
    2. A console window will pop up briefly, check for Node.js (installing it silently in the background if it's missing), and automatically launch the **Setup Wizard in your web browser**.
    3. In the browser setup form, paste the **Client ID** and **Client Secret** provided by your administrator.
    4. Click **"Save & Continue"**. This automatically registers the server globally in Claude Desktop, Cursor, Windsurf, and VS Code (Cline).
    5. You will be redirected to the HubSpot login page. Sign in under your **personal HubSpot user credentials** and click the orange **"Authorize" (Connect app)** button.
    6. Once you see the **"Setup Complete!"** success screen with a green checkmark showing which apps were configured, you can close the browser tab.

*   **🍎 On macOS (Mac):**
    1. Open your **Terminal** application.
    2. Navigate to the project folder and run:
       ```bash
       bash setup.sh
       ```
    3. The script will verify Node.js (installing it via Homebrew if needed) and launch the **Setup Wizard in your web browser**.
    4. Paste the **Client ID** and **Client Secret** provided by your administrator and click **"Save & Continue"**.
    5. Log in under your **personal HubSpot account** in the browser redirect and click **"Authorize"**.
    6. Once you see the **"Setup Complete!"** success page, you are done!

#### Step 3. Restart and Chat!

*   **In Claude Desktop:** Completely restart Claude. A new **plug/MCP icon** will appear in the bottom right of the chat bar. Click it to verify `hubspot` is active.
*   **In Cursor:** Completely restart Cursor. The HubSpot server is added globally automatically! Verify it in Settings (`Ctrl + Shift + J` or `Cmd + Shift + J` on Mac) > **Features > MCP**.
*   **In Windsurf IDE:** Completely restart Windsurf. The server is configured globally in Cascade! Look for the **MCP icon** in the Cascade panel sidebar.
*   **In VS Code (Cline):** Completely restart VS Code. Cline will automatically detect and load the HubSpot server tools.

**Example prompts to ask your AI:**
*   *"Find deals associated with company Acme Corp"*
*   *"Show my last 5 created contacts in HubSpot"*
*   *"Create a new deal named 'Software License' with amount 25000"*

---

## Русская вСрсия

Π­Ρ‚ΠΎΡ‚ сСрвСр позволяСт вашим ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅Ρ€Π°ΠΌ ΠΏΠΎ ΠΏΡ€ΠΎΠ΄Π°ΠΆΠ°ΠΌ (сСйлзам) ΠΏΠΎΠ΄ΠΊΠ»ΡŽΡ‡Π°Ρ‚ΡŒΡΡ ΠΊ **HubSpot** прямо Ρ‡Π΅Ρ€Π΅Π· **Cursor, Windsurf IDE, VS Code (Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½ΠΈΠ΅ Cline) ΠΈΠ»ΠΈ Claude Desktop** с ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ искусствСнного ΠΈΠ½Ρ‚Π΅Π»Π»Π΅ΠΊΡ‚Π°. Они смогут ΠΈΡΠΊΠ°Ρ‚ΡŒ ΠΊΠΎΠ½Ρ‚Π°ΠΊΡ‚Ρ‹, ΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Π΄Π΅Ρ‚Π°Π»ΠΈ, ΡΠΎΠ·Π΄Π°Π²Π°Ρ‚ΡŒ ΠΈ ΠΎΠ±Π½ΠΎΠ²Π»ΡΡ‚ΡŒ сдСлки простым чСловСчСским языком.

ΠœΡ‹ сдСлали этот ΠΏΡ€ΠΎΠ΄ΡƒΠΊΡ‚ **Π°Π±ΡΠΎΠ»ΡŽΡ‚Π½ΠΎ кроссплатформСнным** ΠΈ ΠΏΠΎΠ»Π½ΠΎΡΡ‚ΡŒΡŽ автоматичСским. Π‘Π΅ΠΉΠ»Π·Π°ΠΌ большС **Π½Π΅ Π½ΡƒΠΆΠ½ΠΎ ΠΏΠΈΡΠ°Ρ‚ΡŒ слоТныС ΠΊΠΎΠΌΠ°Π½Π΄Ρ‹, Π²Ρ€ΡƒΡ‡Π½ΡƒΡŽ Π½Π°ΡΡ‚Ρ€Π°ΠΈΠ²Π°Ρ‚ΡŒ JSON-Ρ„Π°ΠΉΠ»Ρ‹ ΠΈΠ»ΠΈ ΠΈΡΠΊΠ°Ρ‚ΡŒ скрытыС ΠΏΠ°ΠΏΠΊΠΈ**. Π‘ΠΊΡ€ΠΈΠΏΡ‚ сдСлаСт всё Π·Π° Π½ΠΈΡ…!

### πŸ’» Π˜Π½ΡΡ‚Ρ€ΡƒΠΊΡ†ΠΈΡ для ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅Ρ€ΠΎΠ² (ВсСго 2 шага!)

#### Π¨Π°Π³ 1. РаспакуйтС Π°Ρ€Ρ…ΠΈΠ²
Π‘ΠΊΠ°Ρ‡Π°ΠΉΡ‚Π΅ Π°Ρ€Ρ…ΠΈΠ² с ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠΎΠΉ ΠΈ распакуйтС Π΅Π³ΠΎ Π² Π»ΡŽΠ±ΡƒΡŽ ΡƒΠ΄ΠΎΠ±Π½ΡƒΡŽ ΠΏΠ°ΠΏΠΊΡƒ Π½Π° ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€Π΅ (Π½Π°ΠΏΡ€ΠΈΠΌΠ΅Ρ€, `C:\hubspot-mcp-server\` Π½Π° Windows ΠΈΠ»ΠΈ Π² домашнюю ΠΏΠ°ΠΏΠΊΡƒ Π½Π° Mac).

#### Π¨Π°Π³ 2. ЗапуститС Π°Π²Ρ‚ΠΎ-настройку

*   **πŸ–₯️ На Windows:**
    1. НайдитС Ρ„Π°ΠΉΠ» **`setup.bat`** Π²Π½ΡƒΡ‚Ρ€ΠΈ ΠΏΠ°ΠΏΠΊΠΈ ΠΈ запуститС Π΅Π³ΠΎ Π΄Π²ΠΎΠΉΠ½Ρ‹ΠΌ Ρ‰Π΅Π»Ρ‡ΠΊΠΎΠΌ ΠΌΡ‹ΡˆΠΈ.
    2. Π‘ΠΊΡ€ΠΈΠΏΡ‚ сам ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΈΡ‚ Node.js (Ссли Π΅Π³ΠΎ Π½Π΅Ρ‚ β€” установит Π² Ρ„ΠΎΠ½ΠΎΠ²ΠΎΠΌ Ρ€Π΅ΠΆΠΈΠΌΠ΅), **автоматичСски Π½Π°ΠΉΠ΄Π΅Ρ‚ ΠΈ настроит Claude Desktop, Cursor, Windsurf ΠΈ VS Code (Cline)**, послС Ρ‡Π΅Π³ΠΎ ΠΎΡ‚ΠΊΡ€ΠΎΠ΅Ρ‚ мастСр настройки Π² Π±Ρ€Π°ΡƒΠ·Π΅Ρ€Π΅.
    3. Π’ΡΡ‚Π°Π²ΡŒΡ‚Π΅ **Client ID** ΠΈ **Client Secret**, ΠΏΠΎΠ»ΡƒΡ‡Π΅Π½Π½Ρ‹Π΅ ΠΎΡ‚ администратора.
    4. НаТмитС **Β«Save & ContinueΒ»**.
    5. Π’ΠΎΠΉΠ΄ΠΈΡ‚Π΅ ΠΏΠΎΠ΄ своим **Π»ΠΈΡ‡Π½Ρ‹ΠΌ Π°ΠΊΠΊΠ°ΡƒΠ½Ρ‚ΠΎΠΌ HubSpot** ΠΈ Π½Π°ΠΆΠΌΠΈΡ‚Π΅ ΠΊΠ½ΠΎΠΏΠΊΡƒ **Β«ΠŸΠΎΠ΄ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡŒ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅Β»** (Authorize).
    6. Как Ρ‚ΠΎΠ»ΡŒΠΊΠΎ появится экран успСха с Π·Π΅Π»Π΅Π½ΠΎΠΉ Π³Π°Π»ΠΎΡ‡ΠΊΠΎΠΉ, Π·Π°ΠΊΡ€ΠΎΠΉΡ‚Π΅ Π±Ρ€Π°ΡƒΠ·Π΅Ρ€.

*   **🍎 На macOS (Mac):**
    1. ΠžΡ‚ΠΊΡ€ΠΎΠΉΡ‚Π΅ Π’Π΅Ρ€ΠΌΠΈΠ½Π°Π» ΠΈ ΠΏΠ΅Ρ€Π΅ΠΉΠ΄ΠΈΡ‚Π΅ Π² ΠΏΠ°ΠΏΠΊΡƒ с ΠΏΡ€ΠΎΠ΅ΠΊΡ‚ΠΎΠΌ.
    2. ЗапуститС ΠΊΠΎΠΌΠ°Π½Π΄Ρƒ:
       ```bash
       bash setup.sh
       ```
    3. Π‘ΠΊΡ€ΠΈΠΏΡ‚ ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΈΡ‚ Π½Π°Π»ΠΈΡ‡ΠΈΠ΅ Node.js (Ссли Π΅Π³ΠΎ Π½Π΅Ρ‚ β€” установит), **автоматичСски настроит всС Π½Π°ΠΉΠ΄Π΅Π½Π½Ρ‹Π΅ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹** ΠΈ ΠΎΡ‚ΠΊΡ€ΠΎΠ΅Ρ‚ мастСр настройки Π² Π±Ρ€Π°ΡƒΠ·Π΅Ρ€Π΅.
    4. Π’ΡΡ‚Π°Π²ΡŒΡ‚Π΅ **Client ID** ΠΈ **Client Secret**, ΠΏΠΎΠ»ΡƒΡ‡Π΅Π½Π½Ρ‹Π΅ ΠΎΡ‚ администратора, ΠΈ Π½Π°ΠΆΠΌΠΈΡ‚Π΅ **Β«Save & ContinueΒ»**.
    5. Π’ΠΎΠΉΠ΄ΠΈΡ‚Π΅ ΠΏΠΎΠ΄ своим **Π»ΠΈΡ‡Π½Ρ‹ΠΌ Π°ΠΊΠΊΠ°ΡƒΠ½Ρ‚ΠΎΠΌ HubSpot** ΠΈ Π½Π°ΠΆΠΌΠΈΡ‚Π΅ ΠΊΠ½ΠΎΠΏΠΊΡƒ **Β«ΠŸΠΎΠ΄ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡŒ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅Β»** (Authorize).
    6. Π“ΠΎΡ‚ΠΎΠ²ΠΎ!

#### Π¨Π°Π³ 3. ΠŸΠ΅Ρ€Π΅Π·Π°ΠΏΡƒΡΡ‚ΠΈΡ‚Π΅ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹ ΠΈ ΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ΡΡŒ!

*   **Π’ Claude Desktop:** ΠŸΠ΅Ρ€Π΅Π·Π°ΠΏΡƒΡΡ‚ΠΈΡ‚Π΅ Claude. Π’ Ρ‡Π°Ρ‚Π΅ появится **ΠΈΠΊΠΎΠ½ΠΊΠ° Ρ€ΠΎΠ·Π΅Ρ‚ΠΊΠΈ/Π²ΠΈΠ»ΠΊΠΈ (MCP)**.
*   **Π’ Cursor:** ΠŸΠ΅Ρ€Π΅Π·Π°ΠΏΡƒΡΡ‚ΠΈΡ‚Π΅ Cursor. Π‘Π΅Ρ€Π²Π΅Ρ€ ΠΏΠΎΠ΄ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡΡ автоматичСски Π½Π° глобальном ΡƒΡ€ΠΎΠ²Π½Π΅! ΠŸΡ€ΠΎΠ²Π΅Ρ€ΡŒΡ‚Π΅ Π² Cursor Settings > **Features > MCP**.
*   **Π’ Windsurf IDE:** ΠŸΠ΅Ρ€Π΅Π·Π°ΠΏΡƒΡΡ‚ΠΈΡ‚Π΅ Windsurf. Π‘Π΅Ρ€Π²Π΅Ρ€ ΠΏΠΎΠ΄ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡΡ автоматичСски Π² Π±ΠΎΠΊΠΎΠ²ΠΎΠΉ ΠΏΠ°Π½Π΅Π»ΠΈ Cascade (ΠΈΠΊΠΎΠ½ΠΊΠ° MCP).
*   **Π’ VS Code (Cline):** ΠŸΠ΅Ρ€Π΅Π·Π°ΠΏΡƒΡΡ‚ΠΈΡ‚Π΅ VS Code. Cline автоматичСски ΠΏΠΎΠ΄Π³Ρ€ΡƒΠ·ΠΈΡ‚ инструмСнты HubSpot.

---

## πŸ› οΈ Developer Setup & Admin Configuration (Bilingual)

### 1. Register App in HubSpot / РСгистрация Π² HubSpot
1. In HubSpot, go to **Settings** > **Integrations** > **Developer Apps** (or **MCP Auth Apps**).
   * *Π’ HubSpot ΠΏΠ΅Ρ€Π΅ΠΉΠ΄ΠΈΡ‚Π΅ Π² Настройки > Π˜Π½Ρ‚Π΅Π³Ρ€Π°Ρ†ΠΈΠΈ > Developer Apps (ΠΈΠ»ΠΈ MCP Auth Apps).*
2. Click **Create app** (or **Create MCP auth app**).
   * *НаТмитС Π‘ΠΎΠ·Π΄Π°Ρ‚ΡŒ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅.*
3. Set the Redirect URL to:
   * *Π£ΠΊΠ°ΠΆΠΈΡ‚Π΅ Redirect URL:*
     `http://localhost:6274/oauth/callback/debug`
4. Copy the **Client ID** and **Client Secret**. Give these to your sales reps!
   * *Π‘ΠΊΠΎΠΏΠΈΡ€ΡƒΠΉΡ‚Π΅ Client ID ΠΈ Client Secret ΠΈ ΠΏΠ΅Ρ€Π΅Π΄Π°ΠΉΡ‚Π΅ ΠΈΡ… сотрудникам.*

### 2. Compile Server / Π‘Π±ΠΎΡ€ΠΊΠ° сСрвСра
Before packing the folder into a ZIP archive for your team, make sure to compile the TypeScript code:
* *ΠŸΠ΅Ρ€Π΅Π΄ Ρ‚Π΅ΠΌ ΠΊΠ°ΠΊ Π·Π°ΠΏΠ°ΠΊΠΎΠ²Π°Ρ‚ΡŒ ΠΏΠ°ΠΏΠΊΡƒ Π² ZIP для ΠΊΠΎΠΌΠ°Π½Π΄Ρ‹, ΠΎΠ±ΡΠ·Π°Ρ‚Π΅Π»ΡŒΠ½ΠΎ скомпилируйтС TypeScript ΠΊΠΎΠ΄:*
```bash
npm install
npm run build
```
*(You can exclude the `node_modules` folder from the final ZIP to keep it lightweight (~1MB) β€” the setup scripts will automatically download dependencies for users).*
*(Π’Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΈΡΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡŒ ΠΏΠ°ΠΏΠΊΡƒ `node_modules` ΠΈΠ· ΠΈΡ‚ΠΎΠ³ΠΎΠ²ΠΎΠ³ΠΎ ZIP-Π°Ρ€Ρ…ΠΈΠ²Π°, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΡΠ΄Π΅Π»Π°Ρ‚ΡŒ Π΅Π³ΠΎ Π»Π΅Π³ΠΊΠΈΠΌ (ΠΎΠΊΠΎΠ»ΠΎ 1 ΠœΠ‘) β€” скрипты установки ΡΠΊΠ°Ρ‡Π°ΡŽΡ‚ всё сами).*