1. Conduid
  2. AI
  3. Openai LLM MCP RAG Js
MCP server · AI

Openai LLM MCP RAG Js

This repository is a 100% TypeScript powerhouse that takes "RAG" (Retrieval-Augmented Generation) to the next level! It's like a brainy librarian on caffeine—fetching knowledge, augmenting it, and generating magic, all while staying strongly typed. 🚀

Unclaimed last commit a year ago ai
41Fair

Scored 5 months ago · breakdown

About Openai LLM MCP RAG Js

Openai LLM MCP RAG Js is an MCP server published by sunpcm in the AI category: this repository is a 100% TypeScript powerhouse that takes "RAG" (Retrieval-Augmented Generation) to the next level! It's like a brainy librarian on caffeine—fetching knowledge, augmenting it, and generating magic, all while staying strongly typed. 🚀.

The repository has 2 stars and 2 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/sunpcm/openai-llm-mcp-rag-js

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Openai LLM MCP RAG Js

Powered by Claude · Grounded in docs

I know everything about Openai LLM MCP RAG Js. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 5 days ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • !License declaredNo license file. Legally you have no right to use it in a product.
  • !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

README

LLM-MCP-RAG-JS

提示: 如果需要 Python 版本的实现,请访问 LLM-MCP-RAG-Python。 Python版本具有更好的扩展性,可以更好的集成rag/Vector DB/ComfyUI

项目架构

项目采用模块化设计,主要包含以下核心组件:

目录结构

src/
├── core/          # 核心业务逻辑
├── protocol/      # MCP 协议实现
├── retrieval/     # 文档检索相关实现
├── utils/         # 工具函数
└── config/        # 配置文件

核心组件

  1. MCP Service (src/protocol/MCPService.ts)

    • 负责与 MCP 服务器的通信
    • 管理工具注册和调用
    • 实现了重试机制和错误处理
  2. Document Retrieval (src/retrieval/)

    • 实现文档检索功能
    • 支持文档的加载和向量化
    • 提供相似度搜索
  3. RAG Agent (src/core/)

    • 协调 MCP 服务和文档检索
    • 处理用户查询
    • 生成上下文增强的响应

技术栈

  • 运行时环境: Node.js
  • 开发语言: TypeScript
  • 包管理器: pnpm
  • 主要依赖:
    • @modelcontextprotocol/sdk: MCP 协议实现
    • openai: OpenAI API 客户端
    • zod: 类型验证
    • dotenv: 环境变量管理

配置和运行

环境要求

  • Node.js >= 18
  • pnpm >= 10.6.3

安装依赖

pnpm install

环境变量配置

创建 .env 文件并配置以下环境变量:

EMBEDDING_BASE_URL=https://oneapi.biubiuniu.com
EMBEDDING_KEY=your_embedding_api_key
OPENAI_BASE_URL=https://oneapi.biubiuniu.com
OPENAI_API_KEY=your_llm_api_key

开发运行

# 开发模式
pnpm dev

# 构建
pnpm build

# 生产运行
pnpm start

待改进方向

  1. 错误处理优化

    • 实现更细粒度的错误类型
    • 添加错误重试策略配置
    • 改进错误日志记录
  2. 性能优化

    • 实现文档缓存机制
    • 优化向量检索性能
    • 添加批处理支持
  3. 可观测性

    • 添加详细的日志记录
    • 实现性能指标收集
    • 添加监控接口

使用示例

import { MCPService } from './protocol/MCPService';
import { DocumentRetriever } from './retrieval/DocumentRetriever';
import { RAGAgent } from './core/RAGAgent';

// 初始化服务
const mcpService = new MCPService('my-service', 'mcp-server');
await mcpService.initialize();

// 初始化文档检索
const retriever = new DocumentRetriever();
await retriever.loadDocuments('./knowledge');

// 创建 RAG Agent
const agent = new RAGAgent(mcpService, retriever);

// 处理查询
const response = await agent.process('你的问题');

本项目部分代码参考了 KelvinQiu802/llm-mcp-rag,在此表示感谢。# LLM-MCP-RAG

README fetched from the repository 5 days ago. The original is authoritative.

Questions

About Openai LLM MCP RAG Js

How do I install Openai LLM MCP RAG Js?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Openai LLM MCP RAG Js safe to use with an AI agent?

Its trust score is 41 out of 100 (fair). It passes 3 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Openai LLM MCP RAG Js still maintained?

The last commit was a year ago. That's long enough that you should check whether the maintainer is responding to issues before depending on it.