HubSpot MCP Server
HubSpot MCP 服务器
概述
模型上下文协议 (MCP) 服务器实现,提供与 HubSpot CRM 的集成。该服务器使 AI 模型能够通过标准化接口与 HubSpot 数据和操作进行交互。
有关模型上下文协议及其工作原理的更多信息,请参阅Anthropic 的 MCP 文档。
Related MCP server: HubSpot MCP Server
成分
资源
服务器公开以下资源:
hubspot://hubspot_contacts:提供访问 HubSpot 联系人的动态资源hubspot://hubspot_companies:提供访问 HubSpot 公司的动态资源hubspot://hubspot_recent_engagements:提供过去 3 天 HubSpot 互动情况的动态资源
所有资源都会自动更新,因为各自的对象在 HubSpot 中被修改。
示例提示
通过从 LinkedIn 个人资料网页复制来创建 Hubspot 联系人:
Create HubSpot contacts and companies from following: John Doe Software Engineer at Tech Corp San Francisco Bay Area • 500+ connections Experience Tech Corp Software Engineer Jan 2020 - Present · 4 yrs San Francisco, California Previous Company Inc. Senior Developer 2018 - 2020 · 2 yrs Education University of California, Berkeley Computer Science, BS 2014 - 2018获取贵公司的最新活动:
What's happening latestly with my pipeline?
工具
该服务器提供了几种用于管理 HubSpot 对象的工具:
联系人管理工具
hubspot_get_contacts从 HubSpot 检索联系人
无需输入
返回:联系人对象数组
hubspot_create_contact在 HubSpot 中创建新联系人(创建前检查重复项)
输入:
firstname(字符串):联系人的名字lastname(字符串):联系人的姓氏email(字符串,可选):联系人的电子邮件地址properties(dict,可选):附加联系人属性例如:
{"phone": "123456789", "company": "HubSpot"}
行为:
检查是否存在具有相同名字和姓氏的现有联系人
如果属性中提供了
company,还会检查是否与同一家公司匹配如果找到匹配项,则返回现有联系人详细信息
仅当未找到匹配项时才创建新联系人
公司管理工具
hubspot_get_companies从 HubSpot 检索公司
无需输入
返回:公司对象数组
hubspot_create_company在 HubSpot 中创建新公司(创建前检查重复项)
输入:
name(字符串):公司名称properties(字典,可选):其他公司属性例如:
{"domain": "example.com", "industry": "Technology"}
行为:
检查是否存在同名的公司
如果找到匹配项,则返回现有公司详细信息
仅当未找到匹配项时才创建新公司
hubspot_get_company_activity获取特定公司的活动历史记录
输入:
company_id(字符串):HubSpot 公司 ID
返回:活动对象数组
参与工具
hubspot_get_recent_engagements获取过去 3 天内所有公司和联系人的 HubSpot 互动情况
无需输入
返回:具有完整元数据的参与对象数组
多用户支持
此 MCP 服务器旨在支持多个 HubSpot 用户,每个用户都有各自的访问令牌。服务器不使用全局环境变量来存储访问令牌。
相反,每个对 MCP 服务器的请求都应通过以下方式之一包含用户的特定访问令牌:
在请求标头中:
X-HubSpot-Access-Token: your-token-here在请求正文中作为
accessToken:{"accessToken": "your-token-here"}在请求正文中作为
hubspotAccessToken:{"hubspotAccessToken": "your-token-here"}
这种设计允许您将用户令牌存储在您自己的后端(例如,Supabase)并将它们与每个请求一起传递。
多用户集成示例
// Example of how to use this MCP server in a multi-user setup
async function makeHubSpotRequest(userId, action, params) {
// Retrieve the user's HubSpot token from your database
const userToken = await getUserHubSpotToken(userId);
// Make request to MCP server with the user's token
const response = await fetch('https://your-mcp-server.vercel.app/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-HubSpot-Access-Token': userToken
},
body: JSON.stringify({
action,
...params
})
});
return await response.json();
}设置
先决条件
您需要为每个用户获取一个 HubSpot 访问令牌。您可以通过以下方式获取:
在您的 HubSpot 帐户中创建私人应用程序:按照HubSpot 私人应用程序指南操作
转到您的 HubSpot 帐户设置
导航至“集成”>“私有应用”
点击“创建私人应用”
填写基本信息:
命名您的应用
添加描述
上传徽标(可选)
定义所需范围:
oauth(必需)
可选范围:
crm.dealsplits.read_write
crm.objects.companies.read
crm.objects.companies.write
crm.objects.contacts.读取
crm.objects.contacts.write
crm.objects.deals.读取
查看并创建应用程序
复制生成的访问令牌
注意:请确保您的访问令牌安全,切勿将其提交到版本控制中。
Docker 安装
您可以在本地构建镜像,也可以从 Docker Hub 拉取。该镜像是为 Linux 平台构建的。
支持的平台
Linux/amd64
Linux/arm64
Linux/arm/v7
选项 1:从 Docker Hub 拉取
docker pull buryhuang/mcp-hubspot:latest选项 2:本地构建
docker build -t mcp-hubspot .运行容器:
docker run \
buryhuang/mcp-hubspot:latest跨平台发布
要为多个平台发布 Docker 镜像,可以使用docker buildx命令。请按以下步骤操作:
创建一个新的构建器实例(如果还没有):
docker buildx create --use为多个平台构建并推送图像:
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t buryhuang/mcp-hubspot:latest --push .验证该图像是否适用于指定的平台:
docker buildx imagetools inspect buryhuang/mcp-hubspot:latest
与 Claude Desktop 一起使用
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 mcp-hubspot:
npx -y @smithery/cli@latest install mcp-hubspot --client claudeDocker 使用
{
"mcpServers": {
"hubspot": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"buryhuang/mcp-hubspot:latest"
]
}
}
}发展
设置开发环境:
pip install -e .执照
该项目已获得 MIT 许可。
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SheffieldP/hubspot_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server