Open WebUI MCP服务器

一个连接Claude Code和Claude Desktop到Open WebUI实例的服务器,用于管理聊天、RAG知识库、文件、功能和提示。

  • by marccyberleda
  • JavaScript
  • 本地部署
  • 2 星标
  • 更新于
在 GitHub 查看 marccyberleda/openwebui-mcp-server

使用说明

打开WebUI MCP服务器

将Claude Code和Claude Desktop连接到您的Open WebUI实例。 直接从Claude管理聊天、RAG知识库、文件、函数和提示。


这有什么作用

Open WebUI是一个强大的自托管AI界面,但直到现在,你还无法与它交互 从 克劳德。此MCP服务器弥合了这一差距。

连接后,Claude可以搜索您的聊天记录,根据您描述的文件构建RAG知识库,创建自定义管道函数,并管理提示——所有这些都无需离开您的对话。

它是为谁准备的: Claude Code用户、Claude Desktop用户、AI开发人员和Open WebUI高级用户,他们希望Claude帮助管理他们的AI基础设施。


快速开始

克劳德代码(3个命令)

# 1. Get your API key from Open WebUI: Settings → Account → API Keys

# 2. Add the MCP server
claude mcp add openwebui \
  -e OPENWEBUI_URL=http://localhost:3000 \
  -e OPENWEBUI_API_KEY=sk-your-key-here \
  -- npx -y openwebui-mcp-server

# 3. Verify it's connected
# In Claude Code, run: /mcp

克劳德桌面

将此粘贴到您的 claude_desktop_config.json:

{
  "mcpServers": {
    "openwebui": {
      "command": "npx",
      "args": ["-y", "openwebui-mcp-server"],
      "env": {
        "OPENWEBUI_URL": "http://localhost:3000",
        "OPENWEBUI_API_KEY": "your-api-key-here"
      }
    }
  }
}

配置文件位置:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • 窗户: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

可用工具(共23个)

聊天

工具 说明
openwebui_list_chats 列出最近的对话,分页
openwebui_search_chats 按关键字搜索聊天记录
openwebui_get_chat 与所有消息进行全面聊天
openwebui_delete_chat 删除聊天(需要确认)
openwebui_get_chat_tags 列出聊天中使用的所有标签

知识库(RAG)

工具 说明
openwebui_list_knowledge 列出所有知识库集合
openwebui_get_knowledge 获取收藏详细信息和文件列表
openwebui_create_knowledge 创建新收藏
openwebui_update_knowledge 更新名称或描述
openwebui_add_file_to_knowledge 将上传的文件添加到收藏中
openwebui_remove_file_from_knowledge 从集合中删除文件

文件

工具 说明
openwebui_list_files 列出所有上传的文件
openwebui_upload_file 上传文件(base64内容)
openwebui_get_file_info 获取文件元数据
openwebui_delete_file 删除文件(需要确认)

功能(管道、过滤器、动作)

工具 说明
openwebui_list_functions 按类型列出所有函数
openwebui_get_function 使用源代码获取函数
openwebui_create_function 创建一个新的Python函数
openwebui_update_function 更新功能代码或元数据
openwebui_delete_function 删除功能(需要确认)

模型

工具 说明
openwebui_list_models 列出所有可用型号

提示

工具 说明
openwebui_list_prompts 列出所有已保存的提示
openwebui_create_prompt 创建新的已保存提示
openwebui_update_prompt 更新提示标题或内容
openwebui_delete_prompt 删除提示(需要确认)

系统

工具 说明
openwebui_get_status 检查运行状况、版本和配置

配置

变量 必填 描述
OPENWEBUI_URL 是 基本URL(例如。 http://localhost:3000)
OPENWEBUI_API_KEY 是 来自设置的承载令牌→ 账户→ API密钥
DEBUG 否 设置为 openwebui-mcp 将HTTP请求记录到stderr

例子

建立RAG知识库

"Create a knowledge base called 'Security Runbooks' for incident response docs"
→ openwebui_create_knowledge(name: "Security Runbooks", ...)
  Knowledge base created. ID: abc-123

"Upload this runbook and add it to Security Runbooks"
→ openwebui_upload_file(filename: "incident-response.md", ...)
→ openwebui_add_file_to_knowledge(knowledge_id: "abc-123", file_id: "xyz-456")
  File added. Now available for RAG retrieval.

搜索和查看对话

"Search my chats for any discussion about Kubernetes networking"
→ openwebui_search_chats(query: "kubernetes networking")
  Found 3 chats: [list of results]

"Show me the full conversation from last week about DNS issues"
→ openwebui_get_chat(id: "...")
  [Full conversation displayed]

创建可重用的提示

"Create a prompt /standup that generates a standup update from {{input}}"
→ openwebui_create_prompt(
    command: "/standup",
    title: "Daily Standup",
    content: "Generate a concise standup update from these notes: {{input}}"
  )
  Prompt created. Type /standup in any Open WebUI chat to use it.

安装自定义管道功能

"Create a pipe function that translates all responses to French"
→ openwebui_create_function(
    id: "french_translator",
    name: "French Translator",
    type: "filter",
    content: "# Python code..."
  )
  Function created. Enable it in Settings → Functions.

需求

  • Node.js >= 18.0.0
  • 打开WebUI >=0.3.0(任何自托管安装)
  • API密钥 从打开WebUI设置→ 账户→ API密钥

贡献

看 贡献.md 作为指导方针。

欢迎问题和PR,尤其是在较新的Open WebUI版本中添加的新API端点。


许可证

麻省理工学院——见 许可证


建造于 马克 --网络安全和自动化基础设施 CyberLeda