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

@lessie/mcp-server

v0.1.4

Published

将 [Lessie](https://lessie.com) 接入 Claude Desktop,通过自然语言操作你的 Lessie 账号。

Downloads

176

Readme

Lessie MCP

Lessie 接入 Claude Desktop,通过自然语言操作你的 Lessie 账号。

架构

本地 MCP Server 同时充当代理网关:通过 stdio 与 Claude Desktop 通信, 连接远程 MCP Server,将其工具合并暴露给 AI Agent。

Claude Desktop
     │ stdio
     ▼
┌──────────────────────────────┐
│  本地 MCP Server             │
│                              │
│  本地工具(authorize)        │
│          +                   │      Streamable HTTP / SSE
│  远程工具代理 ───────────────│──────►  远程 MCP Server
│                              │       Authorization: Bearer <token>
└──────────────────────────────┘
    OAuth 2.1 Authorization Code + PKCE

鉴权机制

采用 OAuth 2.1 Authorization Code + PKCE 流程,实现了 MCP SDK 的 OAuthClientProvider 接口(src/auth.ts)。

首次连接时:

  1. MCP Client 向远程服务器发送请求,收到 401
  2. SDK 发现 OAuth 元数据(/.well-known/oauth-authorization-server
  3. SDK 动态注册客户端(POST /register,RFC 7591)
  4. 自动打开浏览器,引导用户到 SaaS 登录页面
  5. 用户登录并授权后,浏览器重定向到本地 http://127.0.0.1:19836/callback
  6. SDK 用授权码交换 access_token(POST /token
  7. 令牌持久化到 ~/.lessie/oauth.json

后续连接时:

  • 自动读取本地缓存的令牌,无需再次登录
  • 令牌过期时 SDK 自动触发 re-auth

模块结构

src/
├── config.ts   环境变量与静态配置(REMOTE_MCP_URL)
├── auth.ts     OAuth 鉴权:OAuthClientProvider(Authorization Code + PKCE + 持久化)
├── remote.ts   远程 MCP 代理客户端:连接、授权重试、工具发现、工具转发
├── tools.ts    本地工具注册:工具元数据 + handler
└── index.ts    入口:创建 Server、注册路由(合并本地/远程工具)、启动

依赖方向(单向,无循环):

config ← auth ← tools
  ↑        ↑
  └─ remote ┘
       ↑
     index(汇总所有模块)

前置条件

安装

打开 Claude Desktop 配置文件:

| 系统 | 路径 | | ------- | ----------------------------------------------------------- | | macOS | ~/Library/Application Support/Claude/claude_desktop_config.json | | Windows | %APPDATA%\Claude\claude_desktop_config.json |

添加以下配置:

{
  "mcpServers": {
    "lessie": {
      "command": "npx",
      "args": ["-y", "@lessie/mcp-server"],
      "env": {
        "LESSIE_REMOTE_MCP_URL": "https://your-remote-mcp-server.com/mcp"
      }
    }
  }
}

保存后完全退出并重新打开 Claude Desktop。首次使用时会自动打开浏览器引导登录。

环境变量

| 变量 | 必填 | 说明 | | ---------------------- | ---- | -------------------- | | LESSIE_REMOTE_MCP_URL| 否 | 远程 MCP Server 地址 |

验证

在对话中发送:

查看我的 Lessie 账号信息

常见问题

工具列表中没有 lessie? 检查配置文件 JSON 格式是否正确,然后完全退出并重启 Claude Desktop。

连接远程服务器失败? 确认 LESSIE_REMOTE_MCP_URL 地址正确,且远程服务器已实现 OAuth 2.1 端点。

如何重新登录? 删除 ~/.lessie/oauth.json 后重启 Claude Desktop,会重新打开浏览器授权。