S

ShaderToy-MCP(着色器玩具多客户端协议服务器)

@wilsonchenghy/ShaderToy-MCP
0 Stars 31 次浏览 wilsonchenghy 更新于 2026-08-23

用于ShaderToy的MCP服务器,ShaderToy是一个人们分享GLSL着色器的网站。这个MCP服务器使得大型语言模型(LLMs)能够创建它们通常无法创建的复杂着色器。

该服务暂未提供标准配置,请参考 README 手动接入

服务介绍

ShaderToy-MCP

ShaderToy 的 MCP 服务器,ShaderToy 是一个用于创建、运行和分享 GLSL 着色器的网站(https://www.shadertoy.com/)。它通过 Model Context Protocol (MCP) 将像 Claude 这样的大语言模型与 ShaderToy 相连接,使得 LLM 可以查询并读取整个网页内容,从而能够生成通常情况下无法实现的复杂着色器。

它生成的复杂着色器示例:

IMG_9029


海洋 (https://www.shadertoy.com/view/tXs3Wf)


山脉 (https://www.shadertoy.com/view/W3l3Df)


矩阵数字雨 (https://www.shadertoy.com/view/33l3Df)

功能

  • 获取 ShaderToy 上任何着色器的信息
  • 通过搜索提示在 ShaderToy 上查找可用的着色器
  • 通过学习 ShaderToy 上现有的着色器来生成复杂的着色器

MCP 工具

  • get_shader_info()
  • search_shader()

安装

在 Mac 上,请安装 uv 如下:

brew install uv

在 Windows 上

powershell -c "irm https://astral.sh/uv/install.ps1 | iex" 

然后

set Path=C:\Users\nntra\.local\bin;%Path%

其他安装说明请参见其网站:安装 uv

Claude 桌面集成

使用 git clone https://github.com/wilsonchenghy/ShaderToy-MCP.git 克隆项目

转到 Claude > 设置 > 开发者 > 编辑配置 > claude_desktop_config.json 并添加以下内容:

{
    "mcpServers": {
        "ShaderToy_MCP": {
          "command": "uv",
          "args": [
            "run",
            "--with",
            "mcp[cli]",
            "mcp",
            "run",
            "<path_to_project>/ShaderToy-MCP/src/ShaderToy-MCP/server.py"
          ],
          "env": {
            "SHADERTOY_APP_KEY": "your_actual_api_key"  // Replace with your API key
          }
        }
    }
}

一旦在 Claude 中设置了配置文件,您将看到 MCP 的锤子图标。使用示例命令测试是否正确利用了 MCP 工具。

示例命令

生成 {对象} 的着色器代码,如果它是基于 ShaderToy 上某人的作品,请注明原作者,并确保代码遵循 ShaderToy 格式:void mainImage( out vec4 fragColor, in vec2 fragCoord ) {}