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

tuniu-tmc-cli

v1.0.0

Published

Tuniu enterprise travel MCP CLI

Readme

tuniu-tmc-cli

途牛企业商旅 MCP 命令行工具。该包只包含 B 端商旅酒店、火车票和国内机票能力,与个人旅行包 tuniu-cli、命令 tuniu、普通 TUNIU_API_KEY 和个人 OAuth 配置相互独立。

安装

npm install -g tuniu-tmc-cli@latest
tuniu-tmc --version

登录

tuniu-tmc auth login
tuniu-tmc auth status

CLI 默认使用浏览器完成企业商旅 OAuth 授权,并将 Token 以 0600 权限独立保存在 ~/.tuniu-tmc-cli/auth.json。CLI 不需要也不会保存 OAuth client secret。

无法使用浏览器授权时,可以继续使用员工 API Key 作为兼容方式:

export TUNIU_TTMS_API_KEY=sk-your_ttms_api_key

OAuth 凭证存在时优先使用 OAuth;没有 OAuth 凭证时才读取 API Key。不要把 Token 或 Key 写入代码、Git、日志或 npm 配置。退出当前环境的 OAuth 登录可执行:

tuniu-tmc auth logout

该命令只删除本机保存的 OAuth 凭证,不代表服务端 Token 已被吊销。如需立即终止已签发 Token,请使用企业账号安全中心提供的授权管理能力。

使用

# 默认 PRD
tuniu-tmc list hotel
tuniu-tmc schema hotel
tuniu-tmc call hotel hotelSearch -a '{"cityName":"南京"}'
tuniu-tmc list train
tuniu-tmc schema train
tuniu-tmc call train trainSearch -a '{"fromStation":"南京南","toStation":"上海虹桥","trainDate":"2026-10-10"}'
tuniu-tmc list flight
tuniu-tmc schema flight
tuniu-tmc call flight flightSearch -a '{"departureCityName":"南京","arrivalCityName":"上海","departureDate":"2026-10-10"}'

# 仅调试 PRE 时指定
tuniu-tmc -p development list hotel
tuniu-tmc -p development list train
tuniu-tmc -p development list flight

CLI 的标准输出固定为 JSON,方便 Agent 和脚本稳定解析。--timeout 只接受大于 0 的秒数。

生产和预发网关分别为:

  • PRD:https://openapi.tuniu.cn/mcp/ttms/hotel
  • PRE:https://openapi-p.tuniu.cn/mcp/ttms/hotel
  • PRD 火车票:https://openapi.tuniu.cn/mcp/ttms/train
  • PRE 火车票:https://openapi-p.tuniu.cn/mcp/ttms/train
  • PRD 国内机票:https://openapi.tuniu.cn/mcp/ttms/flight
  • PRE 国内机票:https://openapi-p.tuniu.cn/mcp/ttms/flight

与 tuniu-cli 共存

npm install -g tuniu-cli tuniu-tmc-cli
  • tuniu ...:个人旅行 C 端能力;
  • tuniu-tmc ...:企业商旅 B 端能力。

两个包没有命令名冲突,也不会互相读取 Token 或 API Key。

发布

在本目录执行:

npm login
npm publish --access public

发布前应先检查 npm pack --dry-run 的文件列表,确认 dist/、bin/、skill/、agent-manifest.json、README.md 和 LICENSE 均包含在包中。