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

@jasion66/ai-mcp-server

v1.2.0

Published

Hybrid MCP server for DY AI Integration - supports both backend and standalone modes

Readme

DY AI MCP Server

混合模式 MCP 服务器,支持桥接模式和独立模式。

特性

  • 混合模式: 支持桥接和独立两种运行模式
  • 桥接模式: 通过后端服务调用(默认)
  • 独立模式: 直接调用 AI API
  • 多 AI 提供商: Qwen、Gemini、Seedream、Seedance
  • 完整功能: 对话、图像生成、视频生成

快速开始

安装

npm install -g @jasion66/ai-mcp-server

或使用 npx(推荐):

npx -y @jasion66/ai-mcp-server@latest

配置

模式 1: 桥接模式(默认,推荐)

连接到后端服务,适合企业用户。

{
  "mcpServers": {
    "DY AI": {
      "command": "npx",
      "args": ["-y", "@jasion66/ai-mcp-server@latest"]
    }
  }
}

说明:

  • AI_SERVICE_URL 是必需的:在桥接模式下,您必须通过环境变量 AI_SERVICE_URL 提供您的后端服务地址。
  • 无需配置 AI 提供商的 API Key。
  • 集中管理和审计。
  • 可添加业务逻辑。

模式 2: 独立模式

直接调用 AI API,适合个人用户。

{
  "mcpServers": {
    "DY AI": {
      "command": "npx",
      "args": ["-y", "@jasion66/ai-mcp-server@latest"],
      "env": {
        "USE_BACKEND": "false"
      }
    }
  }
}

注意:在独立模式下,您必须提供自己的 API 密钥。

通过 env 配置 API 密钥:

{
  "mcpServers": {
    "DY AI": {
      "command": "npx",
      "args": ["-y", "@jasion66/ai-mcp-server@latest"],
      "env": {
        "USE_BACKEND": "false",
        "GEMINI_API_KEY": "your-gemini-api-key",
        "QWEN_API_KEY": "your-qwen-api-key",
        "SEEDREAM_API_KEY": "your-seedream-api-key",
        "SEEDANCE_API_KEY": "your-seedance-api-key"
      }
    }
  }
}

模式 3: 自定义后端

使用自己的后端服务。

{
  "mcpServers": {
    "DY AI": {
      "command": "npx",
      "args": ["-y", "@jasion66/ai-mcp-server@latest"],
      "env": {
        "USE_BACKEND": "true",
        "AI_SERVICE_URL": "https://your-backend.com"
      }
    }
  }
}

可用工具

1. ai_chat

与 AI 进行对话。

{
  "message": "你好",
  "provider": "gemini" // 可选: qwen, gemini, seedream, seedance
}

2. ai_generate_image

生成图像(文生图或图生图)。

{
  "prompt": "一只可爱的猫",
  "imageUrl": "https://..." // 可选,图生图时使用
}

3. ai_generate_video

生成视频(文生视频或图生视频)。

{
  "prompt": "海浪拍打沙滩",
  "imageUrl": "https://...", // 可选
  "videoDuration": 5 // 可选,默认 5 秒
}

4. ai_query_task_status

查询任务状态。

{
  "taskId": "task-id"
}

5. ai_list_providers

列出可用的 AI 提供商。

开发

本地开发

# 克隆项目
git clone xxx
cd xxx

# 安装依赖
npm install

# 开发模式
npm run dev

# 构建
npm run build

测试

# 独立模式测试
USE_BACKEND=false npm run dev

# 桥接模式测试
USE_BACKEND=true AI_SERVICE_URL=http://localhost:8080 npm run dev

环境变量

| 变量 | 说明 | 默认值 | |------|------|--------| | USE_BACKEND | 是否使用后端模式 | false | | AI_SERVICE_URL | 后端服务地址 | 桥接模式必需 | | GEMINI_API_KEY | Gemini API Key | 独立模式必需 | | QWEN_API_KEY | Qwen API Key | 独立模式必需 | | SEEDREAM_API_KEY | Seedream API Key | 独立模式必需 | | SEEDANCE_API_KEY | Seedance API Key | 独立模式必需 |

模式对比

| 特性 | 桥接模式 | 独立模式 | |------|---------|---------| | 配置 | 简单 | 简单 | | 部署 | 需要后端 | 无需后端 | | 延迟 | 稍高 | 较低 | | 成本 | 有后端成本 | 无额外成本 | | 安全性 | 高 | 中 | | 业务逻辑 | 可扩展 | 受限 |