Skip to main content
Glama
phytul

Phloem MCP Server

by phytul

Phloem

Phloem 是一个企业级、自托管的基于 RAGFlow 的知识库平台。它通过类型化的 Node.js API 网关和 MCP 服务器封装引擎,实现无缝的 Agent 集成。

Phloem(韧皮部)——植物体内运输营养物质的维管组织。知识也应如此流动。

为什么选择 Phloem

  • 自托管 — 你的文档、你的基础设施、你的控制权。数据不会离开你的环境。

  • Agent 就绪 — 通过 REST API 或 MCP 服务器暴露知识库,使 AI Agent 获得基于检索增强的可靠答案。

  • 端到端类型化 — 一个 OpenAPI 契约驱动网关路由、客户端 SDK 和模拟层。减少集成意外。

  • 可替换后端 — 适配器层隔离 RAGFlow;无需触及业务代码即可替换或升级引擎。

  • 可扩展 — 扩展点注册表(中间件、路由、MCP 工具、Web 模块),专为无需分叉的插件式定制而设计。

Related MCP server: Modular RAG MCP Server

架构

┌────────────┐   REST    ┌─────────────┐            ┌──────────────┐
│  Web UI    │──────────▶│   Gateway   │──adapter──▶│   RAGFlow    │
│  (React)   │           │  (Fastify)  │            │  (submodule) │
└────────────┘           └──────┬──────┘            └──────────────┘
                                │
                         ┌──────┴──────┐
                         │ MCP Server  │  ◀── Claude Desktop, Cursor, custom agents
                         └─────────────┘

包

包

描述

@phloem/shared

类型、Zod 模式、API 契约

@phloem/gateway

带适配器层的 Fastify API 网关

@phloem/mcp

暴露知识工具的 MCP 服务器

@phloem/web

React Web 控制台(深色、极简)

@phloem/eslint-config

共享的 ESLint 扁平配置

快速开始

前提条件

  • Node.js ≥ 22

  • pnpm ≥ 9

  • Docker(用于 RAGFlow 后端)

安装

git clone --recurse-submodules https://github.com/phytul/phloem.git
cd phloem
pnpm install
cp deploy/docker/.env.example deploy/docker/.env

运行(模拟模式 — 无需后端)

# Gateway
pnpm --filter @phloem/gateway dev

# Web console (mock data via MSW)
VITE_API_MODE=mock pnpm --filter @phloem/web dev

运行(使用 RAGFlow)

# Build and start RAGFlow (Lite profile, Infinity engine)
docker compose -f deploy/docker/docker-compose.yml -f deploy/docker/docker-compose.lite.yml up -d

pnpm --filter @phloem/gateway dev
pnpm --filter @phloem/web dev

验证

curl http://localhost:3000/healthz

API

REST 契约是单一事实来源:openapi.yaml。

核心资源:

  • POST /v1/retrieval — 跨数据集混合检索

  • GET/POST /v1/datasets — 知识库管理

  • POST /v1/datasets/{id}/documents — 文档上传

  • GET /healthz — 存活探针

MCP 工具

工具

描述

retrieve_knowledge

跨知识库混合检索

list_datasets

列出可用知识库

开发

pnpm run build        # build all packages
pnpm run typecheck    # strict TS check across the monorepo
pnpm run lint         # ESLint + Prettier

提交遵循 Conventional Commits。钩子(lint-staged + commitlint)自动强制执行此规范。

许可证

Apache-2.0

链接

  • RAGFlow — 底层引擎

  • MCP — 模型上下文协议

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Hybrid semantic search (dense vector + BM25) over local knowledge bases and codebases, exposed as MCP tools for AI agents to search and list knowledge bases.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Exposes RAG-related tools (query_knowledge_hub, list_collections, get_document_summary) via the Model Context Protocol, enabling AI assistants to perform hybrid search, document ingestion, and evaluation on knowledge bases.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A pluggable RAG framework that exposes hybrid search, ingestion, and evaluation tools via the Model Context Protocol, enabling AI assistants like Copilot and Claude to query knowledge bases directly.
    MIT