{"id":31718677,"url":"https://github.com/speakeasy-api/hubspot-typescript","last_synced_at":"2026-01-20T16:39:53.147Z","repository":{"id":283524611,"uuid":"952068382","full_name":"speakeasy-api/hubspot-typescript","owner":"speakeasy-api","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-01T00:20:50.000Z","size":135,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-01T02:37:09.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/speakeasy-api.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-20T17:21:15.000Z","updated_at":"2025-04-03T20:08:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b3ef8c2-3ed2-4a3c-953e-817df35bb890","html_url":"https://github.com/speakeasy-api/hubspot-typescript","commit_stats":null,"previous_names":["speakeasy-api/hubspot-typescript"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/speakeasy-api/hubspot-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-api%2Fhubspot-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-api%2Fhubspot-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-api%2Fhubspot-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-api%2Fhubspot-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/speakeasy-api","download_url":"https://codeload.github.com/speakeasy-api/hubspot-typescript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-api%2Fhubspot-typescript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000731,"owners_count":26082906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-09T02:54:49.026Z","updated_at":"2025-10-09T02:54:52.792Z","avatar_url":"https://github.com/speakeasy-api.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mcp-hubspot\n\nDeveloper-friendly \u0026 type-safe Typescript SDK specifically catered to leverage *mcp-hubspot* API.\n\n\u003cdiv align=\"left\"\u003e\n    \u003ca href=\"https://www.speakeasy.com/?utm_source=mcp-hubspot\u0026utm_campaign=typescript\"\u003e\u003cimg src=\"https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge\u0026logoColor=FBE331\u0026logo=speakeasy\u0026labelColor=545454\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg\" style=\"width: 100px; height: 28px;\" /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n\u003e [!IMPORTANT]\n\u003e This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your [workspace](https://app.speakeasy.com/org/speakeasy-self/speakeasy-public). Delete this section before \u003e publishing to a package manager.\n\n\u003c!-- Start Summary [summary] --\u003e\n## Summary\n\n\n\u003c!-- End Summary [summary] --\u003e\n\n\u003c!-- Start Table of Contents [toc] --\u003e\n## Table of Contents\n\u003c!-- $toc-max-depth=2 --\u003e\n* [mcp-hubspot](#mcp-hubspot)\n  * [SDK Installation](#sdk-installation)\n  * [Requirements](#requirements)\n  * [SDK Example Usage](#sdk-example-usage)\n  * [Authentication](#authentication)\n  * [Available Resources and Operations](#available-resources-and-operations)\n  * [Standalone functions](#standalone-functions)\n  * [Retries](#retries)\n  * [Error Handling](#error-handling)\n  * [Server Selection](#server-selection)\n  * [Custom HTTP Client](#custom-http-client)\n  * [Debugging](#debugging)\n* [Development](#development)\n  * [Maturity](#maturity)\n  * [Contributions](#contributions)\n\n\u003c!-- End Table of Contents [toc] --\u003e\n\n\u003c!-- Start SDK Installation [installation] --\u003e\n## SDK Installation\n\nThe SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.\n\n### NPM\n\n```bash\nnpm add mcp-hubspot\n```\n\n### PNPM\n\n```bash\npnpm add mcp-hubspot\n```\n\n### Bun\n\n```bash\nbun add mcp-hubspot\n```\n\n### Yarn\n\n```bash\nyarn add mcp-hubspot zod\n\n# Note that Yarn does not install peer dependencies automatically. You will need\n# to install zod as shown above.\n```\n\n\u003e [!NOTE]\n\u003e This package is published with CommonJS and ES Modules (ESM) support.\n\n\n### Model Context Protocol (MCP) Server\n\nThis SDK is also an installable MCP server where the various SDK methods are\nexposed as tools that can be invoked by AI applications.\n\n\u003e Node.js v20 or greater is required to run the MCP server from npm.\n\n\u003cdetails\u003e\n\u003csummary\u003eClaude installation steps\u003c/summary\u003e\n\nAdd the following server definition to your `claude_desktop_config.json` file:\n\n```json\n{\n  \"mcpServers\": {\n    \"Hubspot\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\", \"--package\", \"mcp-hubspot\",\n        \"--\",\n        \"mcp\", \"start\",\n        \"--hubspot-token\", \"...\"\n      ]\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eCursor installation steps\u003c/summary\u003e\n\nCreate a `.cursor/mcp.json` file in your project root with the following content:\n\n```json\n{\n  \"mcpServers\": {\n    \"Hubspot\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\", \"--package\", \"mcp-hubspot\",\n        \"--\",\n        \"mcp\", \"start\",\n        \"--hubspot-token\", \"...\"\n      ]\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\nYou can also run MCP servers as a standalone binary with no additional dependencies. You must pull these binaries from available Github releases:\n\n```bash\ncurl -L -o mcp-server \\\n    https://github.com/{org}/{repo}/releases/download/{tag}/mcp-server-bun-darwin-arm64 \u0026\u0026 \\\nchmod +x mcp-server\n```\n\nIf the repo is a private repo you must add your Github PAT to download a release `-H \"Authorization: Bearer {GITHUB_PAT}\"`.\n\n\n```json\n{\n  \"mcpServers\": {\n    \"Todos\": {\n      \"command\": \"./DOWNLOAD/PATH/mcp-server\",\n      \"args\": [\n        \"start\"\n      ]\n    }\n  }\n}\n```\n\nFor a full list of server arguments, run:\n\n```sh\nnpx -y --package mcp-hubspot -- mcp start --help\n```\n\u003c!-- End SDK Installation [installation] --\u003e\n\n\u003c!-- Start Requirements [requirements] --\u003e\n## Requirements\n\nFor supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).\n\u003c!-- End Requirements [requirements] --\u003e\n\n\u003c!-- Start SDK Example Usage [usage] --\u003e\n## SDK Example Usage\n\n### Example\n\n```typescript\nimport { Hubspot } from \"mcp-hubspot\";\n\nconst hubspot = new Hubspot({\n  hubspotToken: process.env[\"HUBSPOT_HUBSPOT_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n  const result = await hubspot.basic.getProperties({\n    objectType: \"deals\",\n  });\n\n  // Handle the result\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End SDK Example Usage [usage] --\u003e\n\n\u003c!-- Start Authentication [security] --\u003e\n## Authentication\n\n### Per-Client Security Schemes\n\nThis SDK supports the following security scheme globally:\n\n| Name           | Type | Scheme      | Environment Variable    |\n| -------------- | ---- | ----------- | ----------------------- |\n| `hubspotToken` | http | HTTP Bearer | `HUBSPOT_HUBSPOT_TOKEN` |\n\nTo authenticate with the API the `hubspotToken` parameter must be set when initializing the SDK client instance. For example:\n```typescript\nimport { Hubspot } from \"mcp-hubspot\";\n\nconst hubspot = new Hubspot({\n  hubspotToken: process.env[\"HUBSPOT_HUBSPOT_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n  const result = await hubspot.basic.getProperties({\n    objectType: \"deals\",\n  });\n\n  // Handle the result\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Authentication [security] --\u003e\n\n\u003c!-- Start Available Resources and Operations [operations] --\u003e\n## Available Resources and Operations\n\n\u003cdetails open\u003e\n\u003csummary\u003eAvailable methods\u003c/summary\u003e\n\n### [basic](docs/sdks/basic/README.md)\n\n* [getProperties](docs/sdks/basic/README.md#getproperties) - Get the list of all groups that are available on any hubspot object.\n* [getCompany](docs/sdks/basic/README.md#getcompany) - Retrieve a company\n* [updateCompany](docs/sdks/basic/README.md#updatecompany) - Update a company\n* [getContact](docs/sdks/basic/README.md#getcontact) - Retrieve a contact\n* [updateContact](docs/sdks/basic/README.md#updatecontact) - Update a contact\n* [createContact](docs/sdks/basic/README.md#createcontact) - Create a contact\n* [getDeal](docs/sdks/basic/README.md#getdeal) - Read\n* [updateDeal](docs/sdks/basic/README.md#updatedeal) - Update\n* [createDeal](docs/sdks/basic/README.md#createdeal) - Create\n\n\n### [search](docs/sdks/search/README.md)\n\n* [searchCompanies](docs/sdks/search/README.md#searchcompanies) - Search for companies\n* [searchContacts](docs/sdks/search/README.md#searchcontacts) - Search for contacts\n* [searchDeals](docs/sdks/search/README.md#searchdeals)\n\n\u003c/details\u003e\n\u003c!-- End Available Resources and Operations [operations] --\u003e\n\n\u003c!-- Start Standalone functions [standalone-funcs] --\u003e\n## Standalone functions\n\nAll the methods listed above are available as standalone functions. These\nfunctions are ideal for use in applications running in the browser, serverless\nruntimes or other environments where application bundle size is a primary\nconcern. When using a bundler to build your application, all unused\nfunctionality will be either excluded from the final bundle or tree-shaken away.\n\nTo read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAvailable standalone functions\u003c/summary\u003e\n\n- [`basicCreateContact`](docs/sdks/basic/README.md#createcontact) - Create a contact\n- [`basicCreateDeal`](docs/sdks/basic/README.md#createdeal) - Create\n- [`basicGetCompany`](docs/sdks/basic/README.md#getcompany) - Retrieve a company\n- [`basicGetContact`](docs/sdks/basic/README.md#getcontact) - Retrieve a contact\n- [`basicGetDeal`](docs/sdks/basic/README.md#getdeal) - Read\n- [`basicGetProperties`](docs/sdks/basic/README.md#getproperties) - Get the list of all groups that are available on any hubspot object.\n- [`basicUpdateCompany`](docs/sdks/basic/README.md#updatecompany) - Update a company\n- [`basicUpdateContact`](docs/sdks/basic/README.md#updatecontact) - Update a contact\n- [`basicUpdateDeal`](docs/sdks/basic/README.md#updatedeal) - Update\n- [`searchSearchCompanies`](docs/sdks/search/README.md#searchcompanies) - Search for companies\n- [`searchSearchContacts`](docs/sdks/search/README.md#searchcontacts) - Search for contacts\n- [`searchSearchDeals`](docs/sdks/search/README.md#searchdeals)\n\n\u003c/details\u003e\n\u003c!-- End Standalone functions [standalone-funcs] --\u003e\n\n\u003c!-- Start Retries [retries] --\u003e\n## Retries\n\nSome of the endpoints in this SDK support retries.  If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API.  However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.\n\nTo change the default retry strategy for a single API call, simply provide a retryConfig object to the call:\n```typescript\nimport { Hubspot } from \"mcp-hubspot\";\n\nconst hubspot = new Hubspot({\n  hubspotToken: process.env[\"HUBSPOT_HUBSPOT_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n  const result = await hubspot.basic.getProperties({\n    objectType: \"deals\",\n  }, {\n    retries: {\n      strategy: \"backoff\",\n      backoff: {\n        initialInterval: 1,\n        maxInterval: 50,\n        exponent: 1.1,\n        maxElapsedTime: 100,\n      },\n      retryConnectionErrors: false,\n    },\n  });\n\n  // Handle the result\n  console.log(result);\n}\n\nrun();\n\n```\n\nIf you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:\n```typescript\nimport { Hubspot } from \"mcp-hubspot\";\n\nconst hubspot = new Hubspot({\n  retryConfig: {\n    strategy: \"backoff\",\n    backoff: {\n      initialInterval: 1,\n      maxInterval: 50,\n      exponent: 1.1,\n      maxElapsedTime: 100,\n    },\n    retryConnectionErrors: false,\n  },\n  hubspotToken: process.env[\"HUBSPOT_HUBSPOT_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n  const result = await hubspot.basic.getProperties({\n    objectType: \"deals\",\n  });\n\n  // Handle the result\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Retries [retries] --\u003e\n\n\u003c!-- Start Error Handling [errors] --\u003e\n## Error Handling\n\nIf the request fails due to, for example 4XX or 5XX status codes, it will throw a `APIError`.\n\n| Error Type      | Status Code | Content Type |\n| --------------- | ----------- | ------------ |\n| errors.APIError | 4XX, 5XX    | \\*/\\*        |\n\n```typescript\nimport { Hubspot } from \"mcp-hubspot\";\nimport { SDKValidationError } from \"mcp-hubspot/models/errors\";\n\nconst hubspot = new Hubspot({\n  hubspotToken: process.env[\"HUBSPOT_HUBSPOT_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n  let result;\n  try {\n    result = await hubspot.basic.getProperties({\n      objectType: \"deals\",\n    });\n\n    // Handle the result\n    console.log(result);\n  } catch (err) {\n    switch (true) {\n      // The server response does not match the expected SDK schema\n      case (err instanceof SDKValidationError):\n        {\n          // Pretty-print will provide a human-readable multi-line error message\n          console.error(err.pretty());\n          // Raw value may also be inspected\n          console.error(err.rawValue);\n          return;\n        }\n        apierror.js;\n      // Server returned an error status code or an unknown content type\n      case (err instanceof APIError): {\n        console.error(err.statusCode);\n        console.error(err.rawResponse.body);\n        return;\n      }\n      default: {\n        // Other errors such as network errors, see HTTPClientErrors for more details\n        throw err;\n      }\n    }\n  }\n}\n\nrun();\n\n```\n\nValidation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted multi-line string since validation errors can list many issues and the plain error string may be difficult read when debugging.\n\nIn some rare cases, the SDK can fail to get a response from the server or even make the request due to unexpected circumstances such as network conditions. These types of errors are captured in the `models/errors/httpclienterrors.ts` module:\n\n| HTTP Client Error                                    | Description                                          |\n| ---------------------------------------------------- | ---------------------------------------------------- |\n| RequestAbortedError                                  | HTTP request was aborted by the client               |\n| RequestTimeoutError                                  | HTTP request timed out due to an AbortSignal signal  |\n| ConnectionError                                      | HTTP client was unable to make a request to a server |\n| InvalidRequestError                                  | Any input used to create a request is invalid        |\n| UnexpectedClientError                                | Unrecognised or unexpected error                     |\n\u003c!-- End Error Handling [errors] --\u003e\n\n\u003c!-- Start Server Selection [server] --\u003e\n## Server Selection\n\n### Override Server URL Per-Client\n\nThe default server can be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:\n```typescript\nimport { Hubspot } from \"mcp-hubspot\";\n\nconst hubspot = new Hubspot({\n  serverURL: \"https://api.hubapi.com\",\n  hubspotToken: process.env[\"HUBSPOT_HUBSPOT_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n  const result = await hubspot.basic.getProperties({\n    objectType: \"deals\",\n  });\n\n  // Handle the result\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Server Selection [server] --\u003e\n\n\u003c!-- Start Custom HTTP Client [http-client] --\u003e\n## Custom HTTP Client\n\nThe TypeScript SDK makes API calls using an `HTTPClient` that wraps the native\n[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This\nclient is a thin wrapper around `fetch` and provides the ability to attach hooks\naround the request lifecycle that can be used to modify the request or handle\nerrors and response.\n\nThe `HTTPClient` constructor takes an optional `fetcher` argument that can be\nused to integrate a third-party HTTP client or when writing tests to mock out\nthe HTTP client and feed in fixtures.\n\nThe following example shows how to use the `\"beforeRequest\"` hook to to add a\ncustom header and a timeout to requests and how to use the `\"requestError\"` hook\nto log errors:\n\n```typescript\nimport { Hubspot } from \"mcp-hubspot\";\nimport { HTTPClient } from \"mcp-hubspot/lib/http\";\n\nconst httpClient = new HTTPClient({\n  // fetcher takes a function that has the same signature as native `fetch`.\n  fetcher: (request) =\u003e {\n    return fetch(request);\n  }\n});\n\nhttpClient.addHook(\"beforeRequest\", (request) =\u003e {\n  const nextRequest = new Request(request, {\n    signal: request.signal || AbortSignal.timeout(5000)\n  });\n\n  nextRequest.headers.set(\"x-custom-header\", \"custom value\");\n\n  return nextRequest;\n});\n\nhttpClient.addHook(\"requestError\", (error, request) =\u003e {\n  console.group(\"Request Error\");\n  console.log(\"Reason:\", `${error}`);\n  console.log(\"Endpoint:\", `${request.method} ${request.url}`);\n  console.groupEnd();\n});\n\nconst sdk = new Hubspot({ httpClient });\n```\n\u003c!-- End Custom HTTP Client [http-client] --\u003e\n\n\u003c!-- Start Debugging [debug] --\u003e\n## Debugging\n\nYou can setup your SDK to emit debug logs for SDK requests and responses.\n\nYou can pass a logger that matches `console`'s interface as an SDK option.\n\n\u003e [!WARNING]\n\u003e Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.\n\n```typescript\nimport { Hubspot } from \"mcp-hubspot\";\n\nconst sdk = new Hubspot({ debugLogger: console });\n```\n\nYou can also enable a default debug logger by setting an environment variable `HUBSPOT_DEBUG` to true.\n\u003c!-- End Debugging [debug] --\u003e\n\n\u003c!-- Placeholder for Future Speakeasy SDK Sections --\u003e\n\n# Development\n\n## Maturity\n\nThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage\nto a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally\nlooking for the latest version.\n\n## Contributions\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. \nWe look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. \n\n### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=mcp-hubspot\u0026utm_campaign=typescript)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeakeasy-api%2Fhubspot-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspeakeasy-api%2Fhubspot-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeakeasy-api%2Fhubspot-typescript/lists"}