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

@ty_krystal/sei-ai

v0.1.2

Published

SEI MCP server and developer CLI for query, save, query-sql, and api-docs workflows

Readme

sei-ai

独立的 SEI MCP 服务,使用 @modelcontextprotocol/sdk 运行。 支持 stdiostreamable-http 和开发者 CLI 启动,默认只开放受控的低代码查询、保存和字段元数据工具,querySql 默认关闭。 构建改为使用 Vite 进行 Node 侧打包,产物输出到 dist/

安装

npm install -g sei-ai

命令

pnpm -F sei-ai-mcp dev -- --config ./apps/sei-ai-mcp/config.example.json
pnpm -F sei-ai-mcp run start:stdio
pnpm -F sei-ai-mcp run start:http
pnpm -F sei-ai-mcp run build
pnpm -F sei-ai-mcp run test

打包后 CLI:

sei-ai help
sei-ai stdio --config ./config.example.json
sei-ai streamable-http --host 0.0.0.0 --port 3000 --path /mcp --config ./config.example.json
sei-ai cli api-docs --format markdown
sei-ai cli query-sql "SELECT _UID,_NAME FROM _SYS_USER"
sei-ai cli call POST /api/sei/data/removeAllCache --json '{}'

开发者 CLI

CLI 是新增的开发者命令面,不会改变现有 MCP server 的启动方式、tool 列表或 Host 集成配置。

首版支持:

  • call
  • query
  • save
  • query-sql
  • api-docs

命令示例:

sei-ai cli query --json '{"head":{"module":"sys_user"},"option":{"fields":"_UID,_NAME"}}'
sei-ai cli save --json '{"head":{"module":"sys_user"},"data":[{"action":"edit","rows":[{"keyVal":"admin","row":{"_NAME":"管理员"}}]}]}'
sei-ai cli query-sql "SELECT _UID,_NAME FROM _SYS_USER" --page 1 --size 20
sei-ai cli api-docs --keyword login --format json

常用认证参数:

  • --base-url
  • --ai-key
  • --role
  • --account
  • --account-project
  • --account-checkcode
  • --token
  • --timeout

载荷输入支持:

  • --json '<payload>'
  • --file ./payload.json
  • --stdin

当前仍未覆盖:

  • init-base-data
  • 字典相关命令
  • DDL/DML
  • 文件上传下载

HTTP 模式:

pnpm -F sei-ai-mcp dev -- --transport streamable-http --host 0.0.0.0 --port 3000 --path /mcp --config ./apps/sei-ai-mcp/config.example.json

Docker Compose:

docker compose -f apps/sei-ai-mcp/docker-compose.yml up -d --build

容器默认暴露 http://127.0.0.1:3719/mcp,并通过 host.docker.internal 访问宿主机上的 SEI 后端。 如果后端也在 compose 中运行,把 SEI_BASE_URL 改成对应服务名即可。

配置

支持的配置项:

  • baseUrl
  • auth.mode: ai-logintoken
  • auth.token
  • auth.aiKey
  • auth.account
  • auth.role
  • tools.query
  • tools.save
  • tools.schema
  • tools.querySql
  • targets.modules
  • targets.tables
  • targets.sources
  • targets.views

敏感值可通过环境变量注入:

  • SEI_BASE_URL
  • SEI_AI_LOGIN_KEY
  • SEI_AI_LOGIN_ACCOUNT
  • SEI_AI_LOGIN_ROLE
  • SEI_TOKEN
  • SEI_MCP_TRANSPORT
  • SEI_MCP_HOST
  • SEI_MCP_PORT
  • SEI_MCP_PATH
  • SEI_MCP_HTTP_JSON_RESPONSE

权限模型

  • 未配置目标时默认拒绝。
  • 查询字段必须命中白名单。
  • 保存字段必须命中白名单。
  • querySql 默认关闭,只允许单条 SELECT/WITH
  • stdio 日志只写 stderr,不污染 MCP 协议输出。

注意:

  • 上面的权限模型只约束 MCP tool 面。
  • 开发者 CLI 直接调用 SEI HTTP 接口,不走 MCP 白名单过滤,因此它是调试/开发入口,不是给模型暴露的 tool 面。

工具

  • sei_query
  • sei_save
  • sei_schema
  • sei_query_sql(默认关闭)

MCP Host

可直接作为 stdio MCP server 启动,再由上层 Host 注册。

stdio Host 配置示例:

{
  "mcpServers": {
    "sei-ai-mcp": {
      "command": "sei-ai",
      "args": [
        "stdio",
        "--config",
        "/abs/path/config.dev.json"
      ]
    }
  }
}

HTTP 模式可直接挂载到容器端口,Host 地址示例:

{
  "mcpServers": {
    "sei-ai-mcp": {
      "url": "http://127.0.0.1:3719/mcp"
    }
  }
}

Spring AI Java 接入

如果 apps/backend 通过 Spring AI MCP client 接入,直接使用 streamable-http

spring:
  ai:
    mcp:
      client:
        enabled: true
        type: SYNC
        request-timeout: 30s
        toolcallback:
          enabled: true
        streamable-http:
          connections:
            sei-ai-mcp:
              url: http://127.0.0.1:3719
              endpoint: /mcp

如果后端默认直接访问宿主机暴露端口,可这样配置:

SEI_AI_MCP_HTTP_URL=http://127.0.0.1:3719
SEI_AI_MCP_HTTP_ENDPOINT=/mcp

如果是宿主机或外部服务直连容器暴露端口,则访问地址为:

http://127.0.0.1:3719/mcp

npm version patch --no-git-tag-version pnpm run build npm publish --access public --cache /tmp/sei-ai-npm-cache