Back to MCP directory
publicPublicdnsLocal runtime

supabase-nextjs-mcp-server

基于Supabase和NextJS的MCP服务器,实现简单的笔记系统

article

README

🚀 使用 Supabase 的 Next.js MCP 服务器

这是一个实现了模型上下文协议(Model Context Protocol,MCP)的服务器。该服务器基于 TypeScript 构建,通过一个简单的 Next.js 笔记系统,展示了核心的 MCP 概念。

🚀 快速开始

初始化配置

需要设置 NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEY 环境变量。

安装依赖项

npm install

构建服务器

npm run build

开发模式下自动重建

npm run watch

✨ 主要特性

资源管理

  • 可列出和访问通过 note:// URI 标识的笔记资源。
  • 每个笔记包含标题、内容和元数据信息。
  • 使用纯文本 MIME 类型提供简单的内容访问。

工具功能

  • create_note:创建新的文本笔记。
    • 接受标题和内容作为必填参数。
    • 在服务器状态中存储新笔记。

提示生成

  • summarize_notes:生成所有存储笔记的摘要。
    • 包含所有笔记内容作为嵌入资源。
    • 返回适合大语言模型(LLM)处理的结构化提示。

📦 安装指南

在 Claude Desktop 中使用

要在 Claude Desktop 中使用,需添加以下服务器配置:

  • MacOS~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows%APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "supabase-nextjs-server": {
      "command": "/path/to/supabase-nextjs-server/build/index.js"
    }
  }
}

使用 Smithery 安装

通过 Smithery 自动安装:

npx -y @smithery/cli install @tengfone/supabase-nextjs-mcp-server --client claude

调试工具

由于 MCP 服务器通过标准输入输出进行通信,调试可能较为复杂。我们推荐使用 MCP Inspector 进行调试:

npm run inspector

Inspector 会提供一个访问浏览器调试工具的 URL 地址。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client