Vercel MCP存储器
    ](https://github.com/evgenygurin/vercel-mcp-memory/issues) ](https://github.com/evgenygurin/vercel-mcp-memory/stargazers)
部署在Vercel上的自定义模型上下文协议(MCP)内存服务器,其语义搜索由OpenAI嵌入和PostgreSQL pgvector提供支持。
✨ 特性
- 🧠 语义搜索 -通过意义而不仅仅是关键字来寻找记忆
- 🔐 安全API -用于生产的可选API密钥身份验证
- ☁️ 云托管 -部署在Vercel边缘功能上(零基础设施)
- 🔄 跨设备同步 -使用Claude从任何设备访问您的内存
- 🚀 OpenAI嵌入 -使用文本嵌入3-small模型
- 🗄️ PostgreSQL+pgvector -高效的向量相似度搜索
- ✅ 输入验证 -用于稳健数据验证的Zod模式
- 📝 结构化日志记录 -生产就绪错误跟踪
- 🌍 多语言 -支持俄语、英语等
- 🤖 Claude代码集成 -通过GitHub Actions实现自动公关审核和人工智能助手
🏗️ 建筑
Claude Desktop → HTTPS/JSON-RPC → Vercel Edge Function → Postgres (pgvector)
↓
OpenAI Embeddings API📋 先决条件
- Node.js 20.x
- Vercel帐户(免费版有效)
- OpenAI API密钥(用于嵌入,约10美元/1M代币)
- 带pgvector扩展的PostgreSQL数据库(Vercel Postgres或Neon)
🚀 快速开始
1.安装依赖项
cd vercel-mcp-memory
npm install2.设置Vercel Postgres
# Install Vercel CLI
npm i -g vercel
# Login to Vercel
vercel login
# Link project
vercel link
# Create Postgres database (via Vercel Dashboard)
# 1. Go to https://vercel.com/dashboard
# 2. Navigate to Storage → Create Database → Postgres
# 3. Name: mcp-memory-db
# 4. Region: Select closest to you3.配置环境变量
创建 .env.local 文件:
# Required: OpenAI API key for embeddings
OPENAI_API_KEY=sk-...
# Required: PostgreSQL connection (auto-configured by Vercel)
POSTGRES_URL=postgresql://...
# Optional: API keys for authentication (comma-separated)
# Leave empty for development without auth
MCP_API_KEYS=your-secret-key-1,your-secret-key-2生成安全的API密钥:
# Generate a secure API key
openssl rand -base64 324.运行数据库迁移
应用扩展名为pgvector的SQL模式:
# Option 1: Via Vercel Dashboard
# 1. Go to Storage → mcp-memory-db → SQL Editor
# 2. Copy contents of migrations/001_init.sql
# 3. Execute
# Option 2: Via psql (if you have local connection)
psql $POSTGRES_URL
## 📖 资源
- [Vercel文档](https://vercel.com/docs)
- [MCP规范](https://modelcontextprotocol.io)
- [OpenAI嵌入](https://platform.openai.com/docs/guides/embeddings)
- [pg向量](https://github.com/pgvector/pgvector)
## 🤖 Claude代码集成
该存储库通过GitHub Actions使用Claude Code进行自动代码审查和人工智能协助。
### 自动PR审核
每个pull请求都会自动收到Claude的全面代码审查,重点是:
- 代码质量和最佳实践
- 潜在的漏洞和安全问题
- 性能考虑
- 测试覆盖率
### 交互式人工智能助手
提及 `@claude` 在任何问题或公关评论中寻求帮助:
@claude Please review the security implications of these auth changes. @claude Help me fix the TypeScript errors in lib/db.ts. @claude Update CLAUDE.md to reflect the new architecture.
有关详细的设置和故障排除,请参阅 .
## 📝 许可证
麻省理工学院
## 🤝 贡献
快速步骤:
1. 分叉存储库
1. 创建要素分支
1. 进行更改
1. 如果适用,添加测试
1. 提交拉取请求
有关问题或支持,请参阅 [支持.md](SUPPORT.md).
## 🙏 致谢
内置:
- [维塞尔](https://vercel.com) -托管和Postgres
- [Next.js](https://nextjs.org) -React框架
- [OpenAI](https://openai.com) -嵌入API
- [MCP-SDK](https://github.com/modelcontextprotocol/sdk) -协议实施
- [pg向量](https://github.com/pgvector/pgvector) -向量相似性搜索
______________________________________________________________________
由以下材料制成❤️ 使用Vercel、Next.js和Claude Code