mcp-http-diary-server
Enables writing and reading diary entries via MCP, with optional mood tags, using Supabase for storage and supporting streamable HTTP for public access.
README
📓 MCP HTTP Diary Server
Streamable HTTP MCP Server — 双人日志本,支持公网访问。
项目结构
mcp-http-diary-server/
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
├── Dockerfile
├── README.md
└── src/
└── index.ts # MCP HTTP Server 主入口
快速开始
1. 安装
cd mcp-http-diary-server
npm install
2. 配置
cp .env.example .env
编辑 .env:
SUPABASE_URL=https://orzivgfntudnsbjkvutg.supabase.co
SUPABASE_KEY=你的supabase_anon_key
PORT=3000
HOST=0.0.0.0
3. 编译运行
npm run build
npm start
服务启动后访问 http://localhost:3000/ 确认健康状态。
部署到公网
服务本身只绑定端口,你需要将其暴露到公网才能让手机 Orangechat 访问。
方式一:部署到云服务器
将项目上传到一台有公网 IP 的 VPS(任意云服务商),运行后即可通过 http://你的IP:3000 访问。
方式二:Cloudflare Tunnel(推荐,免费)
# 安装 cloudflared
# 创建隧道指向 localhost:3000
cloudflared tunnel --url http://localhost:3000
会得到一个 https://xxx.trycloudflare.com 的临时公网地址。
方式三:ngrok
ngrok http 3000
会得到一个 https://xxx.ngrok.io 的公网地址。
方式四:Railway / Render / Fly.io 等 PaaS
直接关联 GitHub 仓库部署,设置环境变量即可。项目已包含 Dockerfile。
接入 Orangechat
在 Orangechat 的 Streamable HTTP MCP 配置中填写:
https://你的公网域名/mcp
例如:
https://mcp-diary.onrender.com/mcphttps://xxx.trycloudflare.com/mcphttp://你的VPS公网IP:3000/mcp
注意: 上面的 .env.example 里的 Supabase URL 是示例,请务必换成你自己正确的 Supabase 项目地址。
API 端点
| 端点 | 方法 | 说明 |
|---|---|---|
/ |
GET | 健康检查 |
/health |
GET | 健康检查 |
/mcp |
POST | MCP JSON-RPC 协议入口 |
/ |
POST | 同上(兼容) |
可用工具
write_diary(content, mood)
保存一篇日志。
content(必填):日志正文mood(可选):心情标签
get_diaries(limit)
获取最近日志。
limit(可选,默认 10,最大 100):获取数量
MCP 协议支持
- ✅ initialize
- ✅ ping
- ✅ tools/list
- ✅ tools/call
- ✅ notifications/
环境变量
| 变量 | 必填 | 说明 | 默认值 |
|---|---|---|---|
SUPABASE_URL |
✅ | Supabase 项目 URL | - |
SUPABASE_KEY |
✅ | Supabase anon key | - |
PORT |
否 | HTTP 监听端口 | 3000 |
HOST |
否 | 监听地址 | 0.0.0.0 |
CORS_ORIGIN |
否 | CORS 来源 | * |
技术栈
- Express.js + TypeScript
- Supabase JS Client
- MCP JSON-RPC 协议
- Zod 参数校验
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.