@give-tech/lingxi-mcp-server
v1.6.2
Published
MCP Server for Lingxi API Management Platform
Maintainers
Readme
Lingxi MCP Server
Model Context Protocol server for Lingxi API Management Platform.
功能
通过 MCP Protocol 提供 Lingxi API 管理平台的完整 CRUD 操作:
- Team (团队): 5 个工具
- Project (项目): 7 个工具
- Module (模块): 5 个工具
- API: 6 个工具
- Model: 5 个工具
- Document (文档): 5 个工具
安装
无需安装,直接使用 npx 运行:
npx @give-tech/lingxi-mcp-server@latest配置
支持两种配置方式:命令行参数(推荐)和环境变量。命令行参数优先级更高。
命令行参数
| 参数 | 说明 | 默认值 |
|------|------|--------|
| --token | API Token | LINGXI_API_TOKEN 环境变量 |
| --baseUrl | API 基础 URL | LINGXI_API_BASE_URL 环境变量,默认 https://lingxiapi.8jinkeji.com |
| --teamId | 默认团队 ID | 无(相关工具参数仍为必填) |
| --projectId | 默认项目 ID | 无(相关工具参数仍为必填) |
配置 --teamId 和 --projectId 后,相关工具的 teamId/projectId 参数变为可选,未传时自动使用默认值。显式传参始终优先于默认值。
环境变量(fallback)
| 变量 | 说明 |
|------|------|
| LINGXI_API_TOKEN | API Token |
| LINGXI_API_BASE_URL | API 基础 URL |
获取 API Token
方式一:通过灵犀平台 Web 页面
- 访问灵犀 API 管理平台:https://lingxi.8jinkeji.com
- 登录后点击右上角头像 → 设置
- 选择 API Token → 点击 创建 Token
- 输入 Token 名称(如 "MCP Server")和有效期
- 创建后复制 Token(仅显示一次,请妥善保管)
方式二:通过 API 创建
curl -X POST https://lingxiapi.8jinkeji.com/api/v1/users/tokens \
-H "Authorization: Bearer YOUR_LOGIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "MCP Server", "expire_days": 365}'使用
命令行参数配置(推荐)
通过命令行参数传入所有配置,适合多项目并行场景,每个项目配置独立的 MCP 实例。
最小配置(仅 token):
{
"mcpServers": {
"lingxi": {
"command": "npx",
"args": [
"-y", "@give-tech/lingxi-mcp-server@latest",
"--token", "your-api-token-here"
]
}
}
}完整配置(绑定团队和项目):
{
"mcpServers": {
"lingxi": {
"command": "npx",
"args": [
"-y", "@give-tech/lingxi-mcp-server@latest",
"--token", "your-api-token-here",
"--baseUrl", "https://lingxiapi.8jinkeji.com",
"--teamId", "team-uuid-here",
"--projectId", "project-uuid-here"
]
}
}
}环境变量配置
通过环境变量传入配置,保持向后兼容。
{
"mcpServers": {
"lingxi": {
"command": "npx",
"args": ["-y", "@give-tech/lingxi-mcp-server@latest"],
"env": {
"LINGXI_API_TOKEN": "your-api-token-here",
"LINGXI_API_BASE_URL": "https://lingxiapi.8jinkeji.com"
}
}
}
}客户端配置
macOS / Linux
配置文件路径:
| 客户端 | 路径 |
|--------|------|
| VS Code | .vscode/mcp.json(项目级)或 ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json(全局) |
| Cursor | .cursor/mcp.json(项目级) |
| Cline | ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json |
| Continue | ~/.continue/config.json |
Windows
配置文件路径:
| 客户端 | 路径 |
|--------|------|
| VS Code | .vscode/mcp.json(项目级)或 %APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json(全局) |
| Cursor | .cursor/mcp.json(项目级) |
| Cline | %APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json |
| Continue | %USERPROFILE%/.continue/config.json |
Windows 注意事项:
- Windows 下需通过
cmd /c npx方式调用:
{
"mcpServers": {
"lingxi": {
"command": "cmd",
"args": [
"/c", "npx", "-y", "@give-tech/lingxi-mcp-server@latest",
"--token", "your-api-token-here",
"--baseUrl", "https://lingxiapi.8jinkeji.com",
"--teamId", "team-uuid-here",
"--projectId", "project-uuid-here"
]
}
}
}- 也可以混合使用命令行参数和环境变量:
{
"mcpServers": {
"lingxi": {
"command": "npx",
"args": ["-y", "@give-tech/lingxi-mcp-server@latest"],
"env": {
"LINGXI_API_TOKEN": "your-api-token-here",
"LINGXI_API_BASE_URL": "https://lingxiapi.8jinkeji.com"
}
}
}
}多项目并行配置示例
通过配置多个 MCP 实例,实现多项目并行工作:
{
"mcpServers": {
"lingxi-project-a": {
"command": "npx",
"args": [
"-y", "@give-tech/lingxi-mcp-server@latest",
"--token", "your-token",
"--projectId", "project-a-uuid"
]
},
"lingxi-project-b": {
"command": "npx",
"args": [
"-y", "@give-tech/lingxi-mcp-server@latest",
"--token", "your-token",
"--projectId", "project-b-uuid"
]
}
}
}本地开发
# 安装依赖
npm install
# 构建
npm run build
# 运行
npm start
# 开发模式
npm run dev可用工具
Team 工具
| 工具 | 描述 |
|------|------|
| lingxi_list_teams | 获取团队列表 |
| lingxi_get_team | 获取团队详情 |
| lingxi_create_team | 创建团队 |
| lingxi_update_team | 更新团队 |
| lingxi_delete_team | 删除团队 |
Project 工具
| 工具 | 描述 | 可省略参数 |
|------|------|-----------|
| lingxi_list_projects | 获取团队项目列表 | teamId(配置 --teamId 后) |
| lingxi_get_project | 获取项目详情 | projectId(配置 --projectId 后) |
| lingxi_create_project | 创建项目 | teamId(配置 --teamId 后) |
| lingxi_update_project | 更新项目 | projectId(配置 --projectId 后) |
| lingxi_delete_project | 删除项目 | projectId(配置 --projectId 后) |
| lingxi_get_project_type_mapping | 获取项目类型映射 | projectId(配置 --projectId 后) |
| lingxi_update_project_type_mapping | 更新项目类型映射 | projectId(配置 --projectId 后) |
Module 工具
| 工具 | 描述 | 可省略参数 |
|------|------|-----------|
| lingxi_list_modules | 获取项目模块列表 | projectId(配置 --projectId 后) |
| lingxi_get_module | 获取模块详情 | - |
| lingxi_create_module | 创建模块 | projectId(配置 --projectId 后) |
| lingxi_update_module | 更新模块 | - |
| lingxi_delete_module | 删除模块 | - |
API 工具
| 工具 | 描述 |
|------|------|
| lingxi_list_apis | 获取模块 API 列表 |
| lingxi_get_api | 获取 API 详情 |
| lingxi_create_api | 创建 API |
| lingxi_update_api | 更新 API |
| lingxi_delete_api | 删除 API |
| lingxi_update_api_status | 更新 API 状态 |
Model 工具
| 工具 | 描述 | 可省略参数 |
|------|------|-----------|
| lingxi_list_models | 获取模块 Model 列表 | - |
| lingxi_list_enum_models | 获取项目枚举 Model 列表 | projectId(配置 --projectId 后) |
| lingxi_get_model | 获取 Model 详情 | - |
| lingxi_create_model | 创建 Model | projectId(配置 --projectId 后) |
| lingxi_update_model | 更新 Model | - |
| lingxi_get_model_fields | 获取 Model 字段详情 | - |
| lingxi_delete_model | 删除 Model | - |
Document 工具
| 工具 | 描述 | 可省略参数 |
|------|------|-----------|
| lingxi_list_documents | 获取模块文档列表 | - |
| lingxi_get_document | 获取文档详情 | - |
| lingxi_create_document | 创建文档 | projectId(配置 --projectId 后) |
| lingxi_update_document | 更新文档 | - |
| lingxi_delete_document | 删除文档 | - |
示例
在配置了默认 --teamId 和 --projectId 后,可以直接操作而无需每次指定:
请列出当前项目的所有模块请创建一个新的 API,方法为 GET,路径为 /api/users未配置默认值时,需要显式指定:
请帮我创建一个名为 "用户服务" 的团队请列出团队 xxx 中的所有项目许可证
MIT
