npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

meican-mcp

v0.2.2

Published

Open-source MCP server for Meican (美餐) meal-ordering APIs

Readme

meican-mcp

MCP Badge

美餐(Meican)MCP Server。支持查询餐次、餐厅、菜单、订单,以及下单和取消订单。

可用工具

| 工具 | 用途 | |---|---| | meican_whoami | 查询组织信息和取餐地址。 | | meican_list_meal_tabs | 查询某天可用餐次。 | | meican_list_restaurants | 查询某个餐次下可用餐厅。 | | meican_show_menu | 查询某个餐厅在指定餐次下的菜单。 | | meican_list_orders | 查询某天已有订单和未支付项目摘要。 | | meican_show_order | 查询单个订单详情。 | | meican_place_order | 下单。调用前必须向用户确认。 | | meican_cancel_order | 取消订单。调用前必须向用户确认。 |

工具返回一个 MCP text content block,内容是 JSON 字符串:

{ "ok": true, "data": {} }

失败时:

{ "ok": false, "error": { "message": "...", "status": 400, "body": {}, "kind": "MeicanError" } }

token 过期时会自动刷新并保存,无需手动更新环境变量。

快速使用

{
  "mcpServers": {
    "meican": {
      "command": "npx",
      "args": ["-y", "meican-mcp"],
      "env": {
        "MEICAN_CLIENT_ID": "...",
        "MEICAN_CLIENT_SECRET": "...",
        "MEICAN_ACCESS_TOKEN": "...",
        "MEICAN_REFRESH_TOKEN": "...",
        "MEICAN_NAMESPACE": "..."
      }
    }
  }
}

MEICAN_ACCESS_TOKEN 对应美餐的 cookie sat,MEICAN_REFRESH_TOKEN 对应美餐的 cookie srt。

本地配置

推荐将登录信息放在本地配置文件中:

  • Linux/macOS:~/.config/meican-mcp/config.json
  • Windows:%APPDATA%\meican-mcp\config.json
{
  "clientId": "...",
  "clientSecret": "...",
  "accessToken": "...",
  "refreshToken": "...",
  "namespace": "..."
}

accessToken 对应美餐 cookie sat,refreshToken 对应 cookie srt。token 过期后, server 会自动刷新并更新这个文件。

本地配置优先于环境变量。需要修改配置文件位置时,可设置 MEICAN_CONFIG_FILE。

环境变量

| 变量 | 必填 | 说明 | |---|---:|---| | MEICAN_CLIENT_ID | 否 | 美餐 OAuth client id;也可配置 clientId。两处至少提供一处。 | | MEICAN_CLIENT_SECRET | 否 | 美餐 OAuth client secret;也可配置 clientSecret。两处至少提供一处。 | | MEICAN_ACCESS_TOKEN | 否 | 美餐 sat cookie;也可配置 accessToken 或在调用时传入。 | | MEICAN_REFRESH_TOKEN | 否 | 美餐 srt cookie;也可配置 refreshToken 或在调用时传入。 | | MEICAN_NAMESPACE | 否 | 默认组织/站点 namespace。也可以在工具调用参数里传。 | | MEICAN_API_BASE_URL | 否 | 默认 https://www.meican.com/forward/api。 | | MEICAN_CONFIG_FILE | 否 | 覆盖本地配置文件的完整路径。 |

HTTP 模式相关:

| 变量 | 必填 | 说明 | |---|---:|---| | MCP_API_KEY | 是 | HTTP /mcp 的 Bearer token,随便生成一个,不带 token 的不允许调用。 | | BIND_HOST | 否 | 默认 127.0.0.1。容器内通常用 0.0.0.0。 | | PORT | 否 | 默认 3000。 | | LOG_LEVEL | 否 | 默认 info。可选 debug、info、warn、error。 |

HTTP 模式

npm install
cp .env.example .env
# 编辑 .env
npm run build
npm start

健康检查:

curl http://127.0.0.1:3000/healthz

HTTP MCP 配置示例:

{
  "mcpServers": {
    "meican": {
      "url": "http://127.0.0.1:3000/mcp",
      "headers": {
        "Authorization": "Bearer ${MCP_API_KEY}"
      }
    }
  }
}