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

apifm-admin-mcp

v26.5.7

Published

MCP server for safely operating APIFM admin APIs through the apifm-admin SDK.

Readme

apifm-admin-mcp

apifm-admin-mcp 是一个通过 apifm-admin SDK 调用 APIFM 后台接口的 MCP Server,可用于 Kiro、Cursor、Claude Code、Codex、Windsurf、Trae、Qoder 等支持 MCP 的 Agent。

安全原则

密码、商户秘钥、X-Token、Basic Authentication 等敏感信息不要粘贴到聊天窗口。

本 MCP 通过 apifm_admin_start_auth 返回一个本地 127.0.0.1 授权页面。用户在浏览器里填写敏感信息,凭证只保存在当前 MCP 进程内存中,不会作为工具参数发送给大模型,也不会写入配置文件。

如果尚未授权就调用后台 API,apifm_admin_callapifm_admin_find_and_call 会直接返回可见的 authUrl,Agent 应立即把这个 URL 展示给用户打开。

安装

npm install -g apifm-admin-mcp

本包依赖 apifm-admin,但不会把 SDK 源码打包进 MCP。apifm-admin 后续升级新增的方法,会在运行时动态发现。

MCP 配置

使用 npx

{
  "mcpServers": {
    "apifm-admin": {
      "command": "npx",
      "args": ["apifm-admin-mcp"]
    }
  }
}

全局安装后:

{
  "mcpServers": {
    "apifm-admin": {
      "command": "apifm-admin-mcp"
    }
  }
}

授权方式

授权页面分为“登录现有账号”和“注册新账号”,支持简体中文、繁体中文、英文切换,默认显示简体中文。

登录现有账号:

  • 手机号登录:调用 loginAdminMobile,也就是“手机号码登录”方法。接口返回对象里的 token 会保存为后续请求头 X-Token
  • 邮箱登录:调用 loginAdminEmail,也就是“邮箱登录获取 X-TOKEN”方法。接口返回对象里的 token 会保存为后续请求头 X-Token
  • 直接填写 X-Token:不调用登录接口,直接保存填写的 X-Token,后续请求头写入 X-Token
  • Basic Authentication:填写商户号和商户秘钥,MCP 会保存 Basic base64(商户号:商户秘钥),后续请求只写入 Authorization: Basic ...

注册新账号:

  • 邮箱注册:调用邮箱注册保存接口,成功后尝试邮箱登录获取 X-Token。
  • 手机号注册:调用手机号注册保存接口,成功后尝试手机号登录获取 X-Token。

图形验证码

手机号登录和邮箱登录页面会显示图形验证码图片:

https://common.apifm.com/code?k=<随机数>

k 由页面自动生成,并通过隐藏字段提交。点击验证码图片会重新生成 k 并刷新图片。图形验证码输入框可留空,只有后端要求时再填写。

工具

  • apifm_admin_start_auth:启动本地授权页面。
  • apifm_admin_accounts:查看当前 MCP 进程内已授权账号,不返回密钥。
  • apifm_admin_switch_account:切换当前使用的账号别名。
  • apifm_admin_remove_account:删除当前 MCP 进程内保存的账号凭证。
  • apifm_admin_find_and_call:按自然语言搜索 SDK 方法并调用,真实接口返回在 apiResult
  • apifm_admin_call:按指定 SDK 方法名调用后台 API,真实接口返回在 apiResult
  • apifm_admin_search_methods:只搜索 SDK 方法和参数说明,不调用 API。
  • apifm_admin_method_info:只查看某个 SDK 方法说明,不调用 API。

使用流程

  1. 用户让 Agent 读取或操作后台数据。
  2. Agent 调用 apifm_admin_find_and_callapifm_admin_call
  3. 如果还没有授权,工具返回 authUrl,并在可见文本中直接显示 URL。
  4. 用户打开 authUrl,选择手机号登录、邮箱登录、X-Token 或 Basic Authentication。
  5. 授权成功后,Agent 重新调用刚才的 API。
  6. Agent 使用 apiResult 中的真实接口返回回答用户。

本地检查

npm run check