UNPKG

@mcpflow.io/mcp-mentor-mcp-server

Version:

一个模型上下文协议服务器,通过基于人工智能的Deepseek-Reasoning R1导师能力为LLM代理提供第二意见,包括代码审查、设计批判、写作反馈以及通过Deepseek API进行创意头脑风暴。

40 lines (33 loc) 1.32 kB
import type { ServerConfig, APIConfig } from './types/index.js'; // Get configuration from process.env which is populated by the MCP client const apiConfig: APIConfig = { apiKey: process.env.DEEPSEEK_API_KEY || '', baseUrl: process.env.DEEPSEEK_API_BASE_URL || 'https://api.deepseek.com', model: process.env.DEEPSEEK_MODEL || 'deepseek-reasoner', maxRetries: parseInt(process.env.DEEPSEEK_MAX_RETRIES || '3', 10), timeout: parseInt(process.env.DEEPSEEK_TIMEOUT || '30000', 10), maxTokens: parseInt(process.env.DEEPSEEK_MAX_TOKENS || '8192', 10), }; // Validate required configuration if (!apiConfig.apiKey) { throw new Error('DEEPSEEK_API_KEY is required'); } // Validate model name if (!apiConfig.model.startsWith('deepseek-')) { throw new Error('DEEPSEEK_MODEL must be a valid Deepseek model name (e.g., deepseek-reasoner)'); } // Validate numeric values if (apiConfig.maxTokens < 1 || apiConfig.maxTokens > 8192) { throw new Error('DEEPSEEK_MAX_TOKENS must be between 1 and 8192'); } if (apiConfig.maxRetries < 1) { throw new Error('DEEPSEEK_MAX_RETRIES must be at least 1'); } if (apiConfig.timeout < 1000) { throw new Error('DEEPSEEK_TIMEOUT must be at least 1000ms'); } export const config: ServerConfig = { serverName: 'mentor-mcp-server', serverVersion: '1.0.0', api: apiConfig, };