|
| 1 | +# HubSpot TypeScript MCP Server |
| 2 | + |
| 3 | +It is generated with [Stainless](https://www.stainless.com/). |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +### Direct invocation |
| 8 | + |
| 9 | +You can run the MCP Server directly via `npx`: |
| 10 | + |
| 11 | +```sh |
| 12 | +export HUBSPOT_ACCESS_TOKEN="My Access Token" |
| 13 | +export HUBSPOT_DEVELOPER_API_KEY="My Developer API Key" |
| 14 | +npx -y @hubspot/sdk-mcp@latest |
| 15 | +``` |
| 16 | + |
| 17 | +### Via MCP Client |
| 18 | + |
| 19 | +There is a partial list of existing clients at [modelcontextprotocol.io](https://modelcontextprotocol.io/clients). If you already |
| 20 | +have a client, consult their documentation to install the MCP server. |
| 21 | + |
| 22 | +For clients with a configuration JSON, it might look something like this: |
| 23 | + |
| 24 | +```json |
| 25 | +{ |
| 26 | + "mcpServers": { |
| 27 | + "hubspot_sdk_api": { |
| 28 | + "command": "npx", |
| 29 | + "args": ["-y", "@hubspot/sdk-mcp"], |
| 30 | + "env": { |
| 31 | + "HUBSPOT_ACCESS_TOKEN": "My Access Token", |
| 32 | + "HUBSPOT_DEVELOPER_API_KEY": "My Developer API Key" |
| 33 | + } |
| 34 | + } |
| 35 | + } |
| 36 | +} |
| 37 | +``` |
| 38 | + |
| 39 | +### Cursor |
| 40 | + |
| 41 | +If you use Cursor, you can install the MCP server by using the button below. You will need to set your environment variables |
| 42 | +in Cursor's `mcp.json`, which can be found in Cursor Settings > Tools & MCP > New MCP Server. |
| 43 | + |
| 44 | +[](https://cursor.com/en-US/install-mcp?name=%40hubspot%2Fsdk-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBodWJzcG90L3Nkay1tY3AiXSwiZW52Ijp7IkhVQlNQT1RfQUNDRVNTX1RPS0VOIjoiTXkgQWNjZXNzIFRva2VuIiwiSFVCU1BPVF9ERVZFTE9QRVJfQVBJX0tFWSI6Ik15IERldmVsb3BlciBBUEkgS2V5In19) |
| 45 | + |
| 46 | +### VS Code |
| 47 | + |
| 48 | +If you use MCP, you can install the MCP server by clicking the link below. You will need to set your environment variables |
| 49 | +in VS Code's `mcp.json`, which can be found via Command Palette > MCP: Open User Configuration. |
| 50 | + |
| 51 | +[Open VS Code](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40hubspot%2Fsdk-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40hubspot%2Fsdk-mcp%22%5D%2C%22env%22%3A%7B%22HUBSPOT_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%2C%22HUBSPOT_DEVELOPER_API_KEY%22%3A%22My%20Developer%20API%20Key%22%7D%7D) |
| 52 | + |
| 53 | +### Claude Code |
| 54 | + |
| 55 | +If you use Claude Code, you can install the MCP server by running the command below in your terminal. You will need to set your |
| 56 | +environment variables in Claude Code's `.claude.json`, which can be found in your home directory. |
| 57 | + |
| 58 | +``` |
| 59 | +claude mcp add hubspot_sdk_mcp_api --env HUBSPOT_ACCESS_TOKEN="My Access Token" HUBSPOT_DEVELOPER_API_KEY="My Developer API Key" -- npx -y @hubspot/sdk-mcp |
| 60 | +``` |
| 61 | + |
| 62 | +## Code Mode |
| 63 | + |
| 64 | +This MCP server is built on the "Code Mode" tool scheme. In this MCP Server, |
| 65 | +your agent will write code against the TypeScript SDK, which will then be executed in an |
| 66 | +isolated sandbox. To accomplish this, the server will expose two tools to your agent: |
| 67 | + |
| 68 | +- The first tool is a docs search tool, which can be used to generically query for |
| 69 | + documentation about your API/SDK. |
| 70 | + |
| 71 | +- The second tool is a code tool, where the agent can write code against the TypeScript SDK. |
| 72 | + The code will be executed in a sandbox environment without web or filesystem access. Then, |
| 73 | + anything the code returns or prints will be returned to the agent as the result of the |
| 74 | + tool call. |
| 75 | + |
| 76 | +Using this scheme, agents are capable of performing very complex tasks deterministically |
| 77 | +and repeatably. |
| 78 | + |
| 79 | +## Running remotely |
| 80 | + |
| 81 | +Launching the client with `--transport=http` launches the server as a remote server using Streamable HTTP transport. The `--port` setting can choose the port it will run on, and the `--socket` setting allows it to run on a Unix socket. |
| 82 | + |
| 83 | +Authorization can be provided via the `Authorization` header using the Bearer scheme. |
| 84 | + |
| 85 | +A configuration JSON for this server might look like this, assuming the server is hosted at `http://localhost:3000`: |
| 86 | + |
| 87 | +```json |
| 88 | +{ |
| 89 | + "mcpServers": { |
| 90 | + "hubspot_sdk_api": { |
| 91 | + "url": "http://localhost:3000", |
| 92 | + "headers": { |
| 93 | + "Authorization": "Bearer <auth value>" |
| 94 | + } |
| 95 | + } |
| 96 | + } |
| 97 | +} |
| 98 | +``` |
0 commit comments