mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-13 11:26:18 +01:00
32 lines
628 B
TypeScript
32 lines
628 B
TypeScript
|
|
import { Schema } from 'mongoose';
|
||
|
|
import type { MCPServerDocument } from '~/types';
|
||
|
|
|
||
|
|
const mcpServerSchema = new Schema<MCPServerDocument>(
|
||
|
|
{
|
||
|
|
serverName: {
|
||
|
|
type: String,
|
||
|
|
index: true,
|
||
|
|
unique: true,
|
||
|
|
required: true,
|
||
|
|
},
|
||
|
|
config: {
|
||
|
|
type: Schema.Types.Mixed,
|
||
|
|
required: true,
|
||
|
|
// Config contains: title, description, url, oauth, etc.
|
||
|
|
},
|
||
|
|
author: {
|
||
|
|
type: Schema.Types.ObjectId,
|
||
|
|
ref: 'User',
|
||
|
|
required: true,
|
||
|
|
index: true,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
timestamps: true,
|
||
|
|
},
|
||
|
|
);
|
||
|
|
|
||
|
|
mcpServerSchema.index({ updatedAt: -1, _id: 1 });
|
||
|
|
|
||
|
|
export default mcpServerSchema;
|