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

@aalis/plugin-mcp-server

v0.9.3

Published

MCP 服务端:把 Aalis 的工具以 MCP 协议对外暴露

Readme

plugin-mcp-server

把 Aalis 注册的 tools 通过 MCP (Model Context Protocol) 协议反向暴露给外部 client(Claude Desktop / Cursor / 其他 MCP-aware app)。

传输方式

HTTP + SSE。Aalis 是常驻进程,stdio 已被日志占用,因此不走 Anthropic 默认的 stdio transport。

  • SSE endpoint: http://<bind>:<port>/sse
  • POST messages: http://<bind>:<port>/messages

SSE 同时只支持一个活跃连接(协议标准),新连接会挤掉旧连接。

安全约束

  • 默认 bind: 127.0.0.1(仅本机访问)—— 不要随便暴露到公网
  • 默认 allowDangerous: falsesafetyLevel='dangerous' 工具一律拒绝
    • ListToolsCallTool 两端都过滤,防止 client 越界
  • toolGroups 白名单:仅暴露指定分组(空数组 = 全部允许,但仍受 dangerous 开关约束)
  • 工具执行仍走 Aalis 的 ToolService.execute,因此 authority guard / permissions resolver 全部生效

配置示例

plugins:
  "@aalis/plugin-mcp-server":
    enabled: true
    port: 39870
    bind: 127.0.0.1
    toolGroups:
      - websearch
      - memory
    allowDangerous: false

Claude Desktop 客户端配置(仅供参考;MCP client 配置因 host app 而异):

{
  "mcpServers": {
    "aalis": {
      "type": "sse",
      "url": "http://127.0.0.1:39870/sse"
    }
  }
}

依赖

  • @modelcontextprotocol/sdk ^1.0.4
  • inject.required: tools

工具调用上下文

由于 MCP 协议不传递 session/user 概念,每次调用注入合成 ToolCallContext

{ sessionId: 'mcp-server', userId: 'mcp-client', platform: 'mcp' }

如果你的工具依赖 sessionId 做权限隔离,需自行处理 platform === 'mcp' 分支。