refactor: 移除硬编码的APIFOX环境变量默认值
这些默认值不应硬编码在代码中,而应通过环境变量配置或配置文件提供
This commit is contained in:
1 parent
a6978c948b
commit
ae684d83b1
1 file changed
-9
@@ -4,15 +4,6 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
||||
import { z } from "zod";
|
||||
import { ApifoxService } from './apifox.js'
|
||||
|
||||
// 设置默认环境变量
|
||||
if (!process.env.APIFOX_TOKEN) {
|
||||
process.env.APIFOX_TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MzQ1MTIwLCJ0cyI6IjUyOGZiZDMwNGM3MjU2NDMiLCJpYXQiOjE3NjQxNTQyODEzMzB9.IZvoCb3pN5AUl375c4Dhpur1GdYBqyHWVkJ94bDQ6BQ';
|
||||
}
|
||||
if (!process.env.APIFOX_PROJECT_ID) {
|
||||
// 使用 steering 中提到的 organizationId 作为默认值
|
||||
process.env.APIFOX_PROJECT_ID = '345161';
|
||||
}
|
||||
|
||||
// 创建 MCP 服务器实例
|
||||
// 为其设置一个名字和版本
|
||||
const server = new McpServer(
|
||||
|
||||
Reference in new issue
Block a user