sakenowa-mcp-vercel

sakenowa-mcp-vercel

Enables querying Japanese sake data (prefectures, sakes, flavors, rankings) via MCP protocol, deployed as a Vercel serverless function.

Category
访问服务器

README

sakenowa-mcp-vercel

Vercel deploy wrapper for @yawaragi/sakenowa-mcp. Exposes the MCP streamable-HTTP endpoint as a Next.js Pages-API function, so the OSS MCP server (which natively wants a long-lived http.Server.listen()) can run on Vercel's serverless model.

The endpoint is at /api/mcp. Point any MCP client (the Vercel AI SDK's @ai-sdk/mcp, Claude Desktop, etc.) at https://<your-deploy>/mcp (with the /api path prefix configured in the wrapper, see below — MCP_HTTP_PATH style env var coming in a follow-up).

How it works

@yawaragi/sakenowa-mcp@0.1.0 ships a streamable-HTTP transport that is already stateless per request — a fresh Server + StreamableHTTPServerTransport is constructed inside every invocation, then closed when the response stream ends. The published createMcpHttpServer(...) wrapper just plugs that per-request handler into Node's http.createServer.

This project does the same thing, but plugs the per-request handler into a Next.js Pages-API function instead. Result: each Vercel function invocation does the equivalent of one stock sakenowa-mcp request, with no state shared between invocations except the pg connection pool (which Vercel keeps warm across requests on the same function container).

The handler lives at pages/api/mcp.ts and mirrors sakenowa-mcp's internal handleRequest (@yawaragi/sakenowa-mcp/dist/http.js) closely.

Deploy

  1. Connect this repo to a Vercel project in the Vercel dashboard. Set the project name to sakenowa-mcp (or whatever — the deploy URL is what matters downstream).

  2. Set the project region to fra1 (Frankfurt, EU) for DPA continuity with the Supabase mirror. Already pinned in vercel.json.

  3. Set the environment variable DATABASE_URL to the Sakenowa-mirrored Postgres connection string. Use the EU pooler URL (aws-1-eu-central-1.pooler.supabase.com:5432), NOT the direct DB URL — serverless concurrency would otherwise blow through max_connections. See .env.example.

  4. Deploy. Vercel auto-deploys on push.

  5. Smoke-test the deployment:

    curl -s -X POST https://<your-deploy>.vercel.app/api/mcp \
      -H "Content-Type: application/json" \
      -H "Accept: application/json, text/event-stream" \
      -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | jq
    

    Expected: a JSON-RPC response advertising the six tools (list_prefectures, search_sakes_by_name, find_similar_sakes, get_sake_details, find_sakes_by_flavor, get_top_ranked).

  6. Point the yawaragi app at the deploy — set MCP_SAKENOWA_URL=https://<your-deploy>.vercel.app/api/mcp on the yawaragi Vercel project (Production + Preview).

Auth

@yawaragi/sakenowa-mcp v0.1.0 ships with no built-in authentication — the OSS asset's contract is "anyone with DATABASE_URL can query, anyone with the HTTP endpoint can query." The data is public-domain Sakenowa data, and no PII / user-state ever passes through the server.

If you want to restrict access, layer auth in front: Vercel rewrite with a bearer token, Cloudflare Tunnel with mTLS, etc. Not built into this wrapper.

Caveats

  • enableJsonResponse: true — the wrapper requests plain application/json responses, not the SSE-streamed variant. All six tools are short synchronous reads; streaming would only matter if a future tool added long-running work.
  • Cold-start cost: ~200–500ms to construct the pg pool + first MCP Server. Subsequent warm invocations are near-instant.
  • Subpath imports (@yawaragi/sakenowa-mcp/dist/server.js): brittle because v0.1.0 has no public exports field. A patch-level follow-up against sakenowa-mcp to add exports mapping is tracked separately; once that ships, switch to named subpath imports here.
  • Pool sizing: default Pool has max: 10. Vercel can spawn many parallel function containers; the Supabase pooler handles that fine, but if you switch to a direct DB URL you'd need to tune.

Local dev

pnpm install
DATABASE_URL=postgresql://... pnpm dev   # binds on :3030 by default

# In another terminal
curl -s -X POST http://localhost:3030/api/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选