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

@kevinli1108/lookin-mcp

v1.1.0

Published

MCP server for iOS UI debugging - inspect view hierarchy, diagnose layout issues via AI

Readme

Lookin MCP

通过 AI 助手调试 iOS App 的 UI 视图层级。

AI 助手 ◄──MCP──► lookin-mcp (Node.js) ◄──USB/WiFi──► iOS App (LookinMCPBridge)

快速开始(3 步)

Step 1: iOS 项目集成

ios-bridge/ 目录下的两个文件拖入你的 Xcode 项目:

ios-bridge/LookinMCPBridge.h
ios-bridge/LookinMCPBridge.m

零代码接入 — 自动在 DEBUG 模式下启动,Release 不会包含。

Step 2: 配置 MCP 服务

Continue(推荐) — 在 ~/.continue/config.yaml 中添加:

mcpServers:
  - name: lookin-mcp
    command: npx
    args:
      - -y
      - lookin-mcp

Cursor — 在 .cursor/mcp.json 中添加:

{
  "mcpServers": {
    "lookin-mcp": {
      "command": "npx",
      "args": ["-y", "lookin-mcp"]
    }
  }
}

VSCode Copilot — 在 .vscode/mcp.json 中添加:

{
  "servers": {
    "lookin-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "lookin-mcp"]
    }
  }
}

Step 3: 开始使用

  1. Xcode 运行 App(模拟器或 USB 真机)
  2. 在 AI 助手中直接对话:

"获取当前页面的视图层级" "找到所有 UILabel 并告诉我文本内容" "诊断一下地址 0x... 的视图为什么不显示"

就这么简单。 USB 真机会自动连接,无需手动配置。


环境变量(可选)

| 变量 | 默认值 | 说明 | |------|--------|------| | LOOKIN_HOST | 127.0.0.1 | iOS 设备 IP(WiFi 直连时使用) | | LOOKIN_PORT | 56780 | HTTP Server 端口 | | LOOKIN_USB | true | 自动 USB 转发(设为 false 关闭) |

WiFi 直连示例:

mcpServers:
  - name: lookin-mcp
    command: npx
    args: ["-y", "lookin-mcp"]
    env:
      LOOKIN_HOST: "192.168.1.100"
      LOOKIN_USB: "false"

提供的工具(10 个)

| 工具 | 说明 | |------|------| | get_view_hierarchy | 获取完整视图层级树 | | inspect_view | 查看视图详细属性 | | find_views | 按类名搜索视图 | | get_constraints | 获取 Auto Layout 约束 | | diagnose_view | 自动诊断视图问题 | | get_vc_hierarchy | 获取 ViewController 层级 | | check_connection | 检查连接状态 | | start_usb_proxy | 启动 USB 端口转发 | | stop_usb_proxy | 停止 USB 端口转发 | | list_usb_devices | 列出 USB 连接的设备 |

前置依赖

  • Node.js >= 18
  • 真机 USB 调试需要 iproxybrew install libimobiledevice

工作原理

  1. iOS 端的 LookinMCPBridge 在 DEBUG 模式下启动一个轻量 HTTP Server(端口 56780)
  2. MCP Server 通过 HTTP 请求获取视图数据,转换为 AI 友好的文本格式
  3. 真机通过 iproxy 将 USB 连接映射为本地端口,无需 WiFi

License

MIT