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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@yuki-js/larkmcp

v0.2.0

Published

Lark MCP integration tools and utilities.

Readme

LarkMCP

License: ISC npm version

A powerful Model Context Protocol (MCP) server that exposes Lark OpenAPI documentation and API endpoints as structured, machine-consumable resources and tools.
Designed for seamless integration with LLMs, automation agents, and advanced developer workflows.

Feishu(飞书)対応

  • 環境変数 LARK_ORIGINfeishu に設定することで、Lark(グローバル)だけでなく Feishu(中国版)API・ドキュメントにも対応できます。
  • OAuth 認証・API リクエスト・ドキュメント取得時に自動的に open.feishu.cn ドメインや中国語リソースを利用します。
  • 例: Feishu で起動する場合
    LARK_ORIGIN=feishu node index.js
  • デフォルト(Lark グローバル)は LARK_ORIGIN を省略または lark にしてください。

Usage

You can run the MCP server directly via npx (after publishing to npm):

npx @yuki-js/larkmcp

Features

  • MCP Server: Provides Lark documentation and API access via the Model Context Protocol.
  • Lark Docs as Resources: Full index of Lark OpenAPI documentation available as a CSV resource.
  • Fetch Lark Docs: Retrieve any Lark documentation page as structured JSON, ready for LLM consumption.
  • User OAuth & API Proxy: Authenticate via OAuth and proxy requests to Lark OpenAPI endpoints.
  • Extensible: Easily add new tools or resources for your own LLM/MCP workflows.
  • Modern Node.js: Built with ES modules, async/await, and strong typing via Zod.

Architecture

+-------------------+      MCP Protocol      +-----------------------------+
|   LLM / Client    | <------------------->  |  Lark OpenAPI Docs MCP      |
+-------------------+                        +-----------------------------+
                                                  |   |   |   |
                                                  |   |   |   |
                                                  v   v   v   v
                                         [Lark Docs] [Lark API] [OAuth]
  • MCP Server: Handles all requests via the Model Context Protocol (stdio transport).
  • Tools: Expose Lark doc fetch, user login, and API proxy as callable MCP tools.
  • Resources: Serve a full CSV index of Lark documentation.

Getting Started

Prerequisites

  • Node.js v22+ recommended
  • npm

Installation

git clone https://github.com/yuki-js/larkmcp.git
cd larkmcp
npm install @yuki-js/larkmcp

Running the MCP Server

node index.js

The server will start and listen for MCP stdio connections.


Usage

You can connect to this MCP server from any MCP-compatible client, LLM, or automation agent.

Example: Fetching Lark Documentation

1. List all available Lark docs

Access the resource:

Resource URI: file://a-full-list-of-available-lark-document.csv/
Description: CSV file listing all available Lark documentation pages.

2. Fetch a specific Lark doc as JSON

Call the fetch_lark_doc tool:

{
  "tool": "fetch_lark_doc",
  "arguments": {
    "url": "https://open.larksuite.com/document/server-docs/docs/docs/docx-v1/document/list"
  }
}

3. Authenticate and Call Lark API

  • Use the login_user tool to start OAuth and obtain a user access token.
  • Use the test_lark_api tool to call any Lark OpenAPI endpoint.

Example:

{
  "tool": "login_user",
  "arguments": { "step": "start" }
}

Then poll for completion:

{
  "tool": "login_user",
  "arguments": { "step": "poll" }
}

Once authenticated, call the API:

{
  "tool": "test_lark_api",
  "arguments": {
    "endpoint": "/open-apis/contact/v3/user/me",
    "method": "GET"
  }
}

MCP Tools & Resources

Tools

fetch_lark_doc

  • Description: Fetches a Lark documentation page as raw JSON.
  • Arguments:
    • url (string): Human-facing Lark doc URL or path.
  • Returns: JSON with doc content and metadata.

login_user

  • Description: Initiates OAuth login flow for Lark API.
  • Arguments:
    • step ("start" | "poll"): Start OAuth or poll for completion.
  • Returns: OAuth URL (start) or access token (poll).

test_lark_api

  • Description: Calls any Lark OpenAPI endpoint with the authenticated user.
  • Arguments:
    • endpoint (string): Lark API endpoint path.
    • method (string, optional): HTTP method (default: GET).
    • body (object, optional): Request body for POST/PUT.
  • Returns: API response (status, headers, body).

Resources

a-full-list-of-available-lark-document

  • URI: file://a-full-list-of-available-lark-document.csv/
  • Description: CSV file listing all available Lark documentation pages.

Developer Experience

Recommended VSCode Extensions

推奨拡張は .vscode/extensions.json でも自動提案されます。

Code Linting & Formatting

  • 静的解析:
    npm run lint
  • コード整形:
    npm run format

.eslintrc.json でESLintルールをカスタマイズできます。

Prettierの設定はプロジェクトで強制していません。各自の好みに合わせて.prettierrcを編集・利用してください(デフォルトは空設定です)。


Development

Project Structure

.
├── index.js
├── package.json
├── server/
│   ├── mcpServer.js
│   ├── resources/
│   │   └── larkDocIndex.js
│   └── tools/
│       ├── fetchLarkDoc.js
│       ├── loginUser.js
│       └── testLarkApi.js
├── data/
│   └── a-full-list-of-available-lark-document.csv
└── utils/

Adding New Tools/Resources

  • Implement your tool/resource in server/tools/ or server/resources/.
  • Register it in server/mcpServer.js.

Contributing

Pull requests and issues are welcome!
Please open an issue to discuss your ideas or report bugs.


License

This project is licensed under the ISC License.


Acknowledgements