Skip to main content
Glama

MCP-RAG Server

by felixscherz

mcp-rag

通过 MCP 将 RAG 应用程序连接到 open-webui

1. MCP PoC 基本框架 / Hello World

pip install mcp[cli]
  • 查找有关 sse 片段的文档
  • 使用 uvicorn 运行服务器
  • 不起作用 -> 查找SseServerTranpsort类中的文档,该文档与 MCP 网站不同
  • 更改路线 -> 安装 starlette_app,然后就可以工作了
  • starlette 给出 307 临时重定向,用 curl 测试后发现,这是由于缺少尾部斜杠造成的
  • 在 github repo 上查找,那里的路由以服务器代码的尾部斜杠结尾,特别是sse = SseServerTransport("/messages/")部分,我猜它告诉客户端要调用什么
  • 添加一些提示并在客户端检查

写作

  • 我想尝试一下模型上下文协议 (MCP),因为我一直在尝试使用 RAG 原型来与 open-webui 配合使用。MCP 看起来与 LSP 类似。由于服务器和客户端不在同一台机器上,所以我们必须使用 SSE 传输。
  • MCP 官方文档中附带了一些代码片段,我不得不根据 mcp python 库提供的文档字符串对它们进行了一些修改。我花了一段时间才让一切正常,最初处理了 307 临时重定向错误,因为服务器发送了错误的端点。
  • 测试一下!构建一个可以与服务器交互的小型 REPL

目标

  1. 了解 MCP 是什么
  2. 实现简单的服务器和客户端
  3. 尝试函数调用/工具使用

2. 实现基本的知识库

  • 我想建立一个简单的知识库,我们可以将其粘贴到 MCP 服务器中并通过客户端调用来检索一些上下文。

3. MCP 客户端 + Open-WebUI

-
security - not tested
F
license - not found
-
quality - not tested

使用模型上下文协议 (MCP) 将 RAG 应用程序连接到 open-webui,通过服务器发送事件 (SSE) 实现服务器到客户端通信,以便在远程环境中检索上下文和使用工具。

  1. MCP PoC 基本框架 / Hello World
    1. 写作
    2. 目标
  2. 实现基本的知识库
    1. MCP 客户端 + Open-WebUI

      Related MCP Servers

      • -
        security
        A
        license
        -
        quality
        This MCP server implementation allows users to manage and expose actions as tools from their Integration App workspace through the Model Context Protocol.
        Last updated -
        10
        21
        TypeScript
        ISC License
      • -
        security
        F
        license
        -
        quality
        A Model Context Protocol server that integrates with Cursor IDE, providing real-time communication, modern web dashboards, and extensible tools via SSE and WebSocket connections.
        Last updated -
        690
        1
        Python
      • -
        security
        A
        license
        -
        quality
        An MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.
        Last updated -
        2
        Python
        MIT License
      • -
        security
        F
        license
        -
        quality
        A Model Context Protocol server implementation that enables connection between OpenAI APIs and MCP clients for coding assistance with features like CLI interaction, web API integration, and tool-based architecture.
        Last updated -
        28
        Python
        • Linux
        • Apple

      View all related MCP servers

      MCP directory API

      We provide all the information about MCP servers via our MCP API.

      curl -X GET 'https://glama.ai/api/mcp/v1/servers/felixscherz/mcp-rag'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server