用于在云平台和自定义服务器上部署Graphiti(一种用于AI代理的时间知识图框架)的自动化安装脚本。
Graphiti Cloud Installer 提供一键部署脚本,自动设置支持MCP(模型上下文协议)的Graphiti:
安装程序处理所有依赖项,配置Docker容器,设置图形数据库(FalkorDB或Neo4j),并公开一个公共MCP端点,以便与AI客户端(如Claude Desktop、Cursor和VS Code)集成。
在您的云服务器上安装Graphiti后,您需要配置您的AI客户端以连接到MCP端点。
默认情况下,您的Graphiti服务器使用HTTP(而不是HTTPS):
http://YOUR_SERVER_IP:8000/mcp要启用HTTPS:
graphiti.yourdomain.com)安全性考虑:
💡 提示:对于大多数用例,基于IP的HTTP就足够了。您可以在稍后通过重新运行安装并提供一个域名来添加HTTPS。
以下是流行AI客户端的确切配置。除非您在安装时配置了一个域名,否则使用HTTP URL。
配置文件位置:
~/Library/Application Support/Claude/claude_desktop_config.json~/.config/Claude/claude_desktop_config.json配置格式(HTTP - 默认):
{
"mcpServers": {
"graphiti": {
"command": "npx",
"args": [
"mcp-remote",
"http://YOUR_SERVER_IP:8000/mcp/",
"--allow-http"
]
}
}
}
对于HTTPS(如果您配置了一个域名):
{
"mcpServers": {
"graphiti": {
"command": "npx",
"args": [
"mcp-remote",
"https://your-domain.com/mcp/"
]
}
}
}
📝 替换
YOUR_SERVER_IP为安装结束时显示的IP地址(例如,34.123.45.67)⚠️ 重要:HTTP连接需要
--allow-http标志。使用HTTPS时移除它。💡 什么是mcp-remote? 它是一个桥接工具,转换于Claude Desktop使用的stdio协议和Graphiti服务器使用的HTTP/SSE协议之间。
配置文件位置:
~/Library/Application Support/Cursor/User/settings.json~/.config/Cursor/User/settings.json配置格式:
{
"mcp.servers": {
"graphiti": {
"url": "http://YOUR_SERVER_IP:8000",
"name": "Graphiti 知识图谱",
"enabled": true
}
}
}
如何配置:
Cmd/Ctrl + ,)mcp.servers配置配置文件位置:
~/Library/Application Support/Code/User/settings.json~/.config/Code/User/settings.json配置格式:
{
"github.copilot.advanced": {
"mcp": {
"enabled": true,
"servers": {
"graphiti": {
"url": "http://YOUR_SERVER_IP:8000",
"description": "Graphiti 时间知识图谱"
}
}
}
}
}
如何配置:
Cmd/Ctrl + ,)Cmd/Ctrl + Shift + P → “重新加载窗口”)配置文件位置:
~/.kiro/settings/mcp.json~/.kiro/settings/mcp.json配置格式:
{
"mcpServers": {
"graphiti": {
"command": "node",
"args": [
"/path/to/mcp-client.js",
"http://YOUR_SERVER_IP:8000"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
替代方案:直接HTTP连接:
{
"mcpServers": {
"graphiti": {
"url": "http://YOUR_SERVER_IP:8000/mcp",
"transport": "http",
"disabled": false
}
}
}
如何配置:
Cmd/Ctrl + Shift + P)对于自定义集成或基于OpenAI API的客户端:
HTTP端点:
http://YOUR_SERVER_IP:8000/mcp
健康检查:
curl http://YOUR_SERVER_IP:8000/health
示例cURL请求:
curl -X POST http://YOUR_SERVER_IP:8000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/list",
"id":
}'
只有在安装期间提供了域名时才可用HTTPS。
安装期间,您会看到此提示:
输入用于SSL的域名(留空以使用基于IP的访问):
如果您留空 → 使用HTTP URL(上面的示例) 如果您输入了一个域名 → 使用HTTPS URL(下面的示例)
HTTPS配置示例:
{
"mcpServers": {
"graphiti": {
"url": "https://your-domain.com/mcp",
"transport": "http"
}
}
}
HTTPS要求:
HTTPS会发生什么:
配置后,测试连接:
检查健康端点:
# 对于HTTP(默认)
curl http://YOUR_SERVER_IP:8000/health
# 对于HTTPS(如果已配置域名)
curl https://your-domain.com/health
预期响应:{"status": "healthy"}
测试MCP端点:
# 对于HTTP(默认)
curl http://YOUR_SERVER_IP:8000/mcp
# 对于HTTPS(如果已配置域名)
curl https://your-domain.com/mcp
询问您的AI客户端:
💡 注意:用实际的服务器IP地址替换
YOUR_SERVER_IP(安装结束时提供),或者如果您配置了HTTPS,则使用您的域名。
连接被拒绝:
docker ps"SSL/TLS错误"或"证书错误":
https://但没有配置域名http://YOUR_SERVER_IP:8000代替身份验证错误:
.env文件中配置docker logs graphiti-mcpMCP未出现在客户端中:
"我如何以后添加HTTPS?"
所有安装都需要:
验证gcloud安装:
gcloud --version
验证aws CLI安装:
aws --version
验证az CLI安装:
az --version
验证SSH客户端:
ssh -V
您需要来自以下LLM提供商的至少一个API密钥:
API密钥的最佳安全实践:
克隆仓库
git clone https://github.com/Niels-8/graphiti-cloud-installer.git
cd graphiti-cloud-installer
确保gcloud CLI已认证
gcloud auth login
gcloud config set project YOUR_PROJECT_ID
运行安装脚本
chmod +x install-gcp.sh
./install-gcp.sh
跟随交互式提示
my-project-123)us-central1,europe-west1)falkordb(默认)或neo4j等待安装完成(通常5-10分钟)
保存您的MCP端点URL
✓ 安装完成!
MCP端点:https://34.123.45.67/mcp/
健康检查:https://34.123.45.67/health
配置您的AI客户端(参见MCP客户端配置)
克隆仓库
git clone https://github.com/your-repo/graphiti-cloud-installer.git
cd graphiti-cloud-installer
确保AWS CLI已配置
aws configure
# 输入您的AWS访问密钥ID、秘密访问密钥和默认区域
运行安装脚本
chmod +x install-aws.sh
./install-aws.sh
跟随交互式提示
us-east-1,eu-west-1)falkordb(默认)或neo4j