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

mcp-codesign

v1.0.3

Published

Model Context Protocol integration for Codesign

Downloads

11

Readme

MCP Codesign

Model Context Protocol integration for Codesign,提供浏览器插件与 MCP 服务器之间的通信能力。

架构

项目包含两个主要组件:

  1. WebSocket 中转服务 - 用于在浏览器插件和多个 MCP 服务器实例之间中转消息
  2. MCP 服务器 - 提供 MCP 工具功能,通过 WebSocket 客户端连接到中转服务

这种架构避免了多个 MCP 服务器实例在同一台机器上运行时的端口冲突问题。

安装

# 使用 pnpm 安装依赖
pnpm install

构建

pnpm run build

运行

需要先启动 WebSocket 中转服务,然后再启动 MCP 服务器:

1. 启动 WebSocket 中转服务

# 默认端口:浏览器插件 3690,MCP服务器 3691
pnpm run start:bridge

# 或者指定自定义端口
WS_PORT=8080 HTTP_PORT=8081 pnpm run start:bridge

2. 启动 MCP 服务器

# 默认连接到 ws://localhost:3691
pnpm run start

# 或者指定自定义中转服务地址
WS_BRIDGE_URL=ws://localhost:8081 pnpm run start

环境变量

  • WS_PORT - 浏览器插件连接的端口(默认:3690)
  • HTTP_PORT - MCP 服务器连接的端口(默认:3691)
  • WS_BRIDGE_URL - MCP 服务器连接的 WebSocket 中转服务地址(默认:ws://localhost:3691)

功能

该工具主要用于处理图片 URL,支持根据指定的宽度、高度和缩放比例生成优化后的图片链接。适用于需要在不同设备上展示不同尺寸图片的场景。

配置说明

在 MCP 配置文件中添加以下配置:

{
  "mcpServers": {
    "codesign": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-codesign@latest"
      ],
      "env": {}
    }
  }
}

使用示例

该工具提供 get_upload_url 方法,接受以下参数:

  • originUrl: 原始图片 URL
  • width: 目标宽度
  • height: 目标高度
  • scale: 缩放比例

返回经过优化处理的图片 URL,支持高分辨率设备的二倍图处理。

开发

# 安装依赖
pnpm install

# 开发模式
pnpm dev

# 构建
pnpm build

# 发布
pnpm release

许可证

ISC