update mcp descriptions (#2105)

This commit is contained in:
mirror
2025-04-22 17:01:41 +08:00
committed by GitHub
parent 1c37c361e1
commit 3a8d8f5b94
9 changed files with 481 additions and 20 deletions

View File

@@ -0,0 +1,58 @@
# LibreChat MCP Server
An implementation of the Librechat Code Interpreter MCP server that follows the OpenAPI specification, providing code execution and file management capabilities.
## Features
- Supports code execution in multiple programming languages
- Supports file upload, download and deletion
- Provides detailed API response information
## Usage Guide
### Get API-KEY
1. Register for a LibreChat account [Visit official website](https://code.librechat.ai)
2. Manage your plan and then generate API Key through developer console.
### Generate SSE URL
On the MCP Server interface, log in and enter the API-KEY to generate the URL.
### Configure MCP Client
On the user's MCP Client interface, add the generated SSE URL to the MCP Server list.
```json
"mcpServers": {
"librechat": {
"url": "http://mcp.higress.ai/mcp-librechat/{generate_key}",
}
}
```
### Available Tools
#### delete_file
Delete specified file
Parameters:
- fileId: File ID (required)
- session_id: Session ID (required)
#### executeCode
Execute code in specified programming language
Parameters:
- code: Source code to execute (required)
- lang: Programming language (required, options: c, cpp, d, f90, go, java, js, php, py, rs, ts, r)
- args: Command line arguments (optional)
- entity_id: Assistant/agent identifier (optional)
- files: Array of file references (optional)
- user_id: User identifier (optional)
#### get_file
Get file information
Parameters:
- session_id: Session ID (required)
- detail: Detail information (optional)

View File

@@ -0,0 +1,58 @@
# LibreChat MCP Server
一个基于OpenAPI规范的 LibreChat Code Interpreter MCP 服务器,提供代码执行和文件管理功能。
## 功能
- 支持多种编程语言的代码执行
- 支持文件上传、下载和删除
- 提供详细的API响应信息
## 使用教程
### 获取 API-KEY
1. 注册LibreChat账号 [访问官网](https://code.librechat.ai)
2. 在控制台界面选择付费计划,并创建 API Key
### 生成 SSE URL
在 MCP Server 界面,登录后输入 API-KEY生成URL。
### 配置 MCP Client
在用户的 MCP Client 界面,将生成的 SSE URL添加到 MCP Server列表中。
```json
"mcpServers": {
"librechat": {
"url": "http://mcp.higress.ai/mcp-librechat/{generate_key}",
}
}
```
### 可用工具
#### delete_file
删除指定文件
参数:
- fileId: 文件ID (必填)
- session_id: 会话ID (必填)
#### executeCode
执行指定编程语言的代码
参数:
- code: 要执行的源代码 (必填)
- lang: 编程语言 (必填可选值c, cpp, d, f90, go, java, js, php, py, rs, ts, r)
- args: 命令行参数 (可选)
- entity_id: 助手/代理标识符 (可选)
- files: 文件引用数组 (可选)
- user_id: 用户标识符 (可选)
#### get_file
获取文件信息
参数:
- session_id: 会话ID (必填)
- detail: 详细信息 (可选)

View File

@@ -0,0 +1,145 @@
server:
name: librechat-api-server
config:
apiKey: ""
tools:
- name: delete_file
description: Delete a file
args:
- name: fileId
description: ""
type: string
required: true
position: path
- name: session_id
description: ""
type: string
required: true
position: path
requestTemplate:
url: https://api.librechat.ai/v1/files/{session_id}/{fileId}
method: DELETE
headers:
- key: x-api-key
value: "{{ .config.apiKey }}"
responseTemplate: {}
- name: executeCode
description: Execute code - Execute code with specified language and parameters
args:
- name: args
description: Optional command line arguments to pass to the program
type: string
position: body
- name: code
description: The source code to be executed
type: string
required: true
position: body
- name: entity_id
description: Optional assistant/agent identifier for file sharing and reference. Must be a valid nanoid-compatible string.
type: string
position: body
- name: files
description: Array of file references to be used during execution
type: array
items:
type: object
position: body
- name: lang
description: The programming language of the code
type: string
required: true
enum: ["c","cpp","d","f90","go","java","js","php","py","rs","ts","r"]
position: body
- name: user_id
description: Optional user identifier
type: string
position: body
requestTemplate:
url: https://api.librechat.ai/v1/exec
method: POST
headers:
- key: Content-Type
value: application/json
- key: x-api-key
value: "{{ .config.apiKey }}"
responseTemplate:
prependBody: |+
# API Response Information
Below is the response from an API call. To help you understand the data, I've provided:
1. A detailed description of all fields in the response structure
2. The complete API response
## Response Structure
> Content-Type: application/json
- **files**: (Type: array)
- **files[].id**: (Type: string)
- **files[].name**: (Type: string)
- **files[].path**: (Type: string)
- **language**: (Type: string)
- **run**: (Type: object)
- **run.code**: (Type: integer)
- **run.cpu_time**: (Type: number)
- **run.memory**: (Type: integer)
- **run.message**: (Type: string)
- **run.output**: (Type: string)
- **run.signal**: (Type: string)
- **run.status**: (Type: string)
- **run.stderr**: (Type: string)
- **run.stdout**: (Type: string)
- **run.wall_time**: (Type: number)
- **session_id**: (Type: string)
- **version**: (Type: string)
## Original Response
- name: get_file
description: Get files information
args:
- name: detail
description: ""
type: string
position: query
- name: session_id
description: ""
type: string
required: true
position: path
requestTemplate:
url: https://api.librechat.ai/v1/files/{session_id}
method: GET
headers:
- key: x-api-key
value: "{{ .config.apiKey }}"
responseTemplate:
prependBody: |+
# API Response Information
Below is the response from an API call. To help you understand the data, I've provided:
1. A detailed description of all fields in the response structure
2. The complete API response
## Response Structure
> Content-Type: application/json
- **items**: Array of items (Type: array)
- **items.content**: (Type: string)
- **items.contentType**: (Type: string)
- **items.etag**: (Type: string)
- **items.id**: (Type: string)
- **items.lastModified**: (Type: string)
- **items.metadata**: (Type: object)
- **items.metadata.content-type**: (Type: string)
- **items.metadata.original-filename**: (Type: string)
- **items.name**: (Type: string)
- **items.session_id**: (Type: string)
- **items.size**: (Type: number)
## Original Response