LimeSurvey的MCP服务器
此MCP服务器能够与LimeSurvey API进行交互,同时遵守 模型上下文协议 规格。它通过标准化的MCP端点公开了LimeSurvey的核心功能。
特性
- 🚀 调查创建
- ❓ 问答管理
- 📋 问题组处理
- ✅ 调查激活
- 📊 响应导出
- 🔍 列出可用的调查
先决条件
- Python 3.7+
- 访问LimeSurvey实例(版本3.X+)
- LimeSurvey管理员帐户
安装
- 克隆存储库:
git clone https://gitlab.com/mehdi_guiraud/mcp-limesurvey.git
cd mcp-limesurvey- 配置环境变量:
cp .env.example .env
# Edit .env with your LimeSurvey credentials
nano .env- 安装依赖项:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt启动服务器
./start_server.sh服务器将在以下时间可用 http://localhost:8080
与Claude Desktop集成
步骤1:在Claude Desktop中添加MCP服务器
- 打开克劳德桌面
- 引导到 设置 → 模型上下文协议
- 点击 添加自定义服务器
- 提供服务器详细信息:
- 服务器名称:LimeSurvey MCP - 基础URL: http://localhost:8080/mcp - 规范URL: http://localhost:8080/spec
步骤2:使用Claude Desktop
使用MCP语法直接从Claude Desktop与LimeSurvey交互:
创建新调查
{
"model": "limesurvey",
"action": "create_survey",
"parameters": {
"survey_title": "Customer Feedback",
"survey_language": "en"
}
}添加一个问题
{
"model": "limesurvey",
"action": "add_question",
"parameters": {
"survey_id": 123456,
"group_id": 1,
"question_text": "How satisfied are you with our service?",
"question_type": "5",
"question_options": {
"subquestions": ["Very satisfied", "Satisfied", "Neutral", "Unsatisfied", "Very unsatisfied"]
}
}
}激活调查
{
"model": "limesurvey",
"action": "activate_survey",
"parameters": {
"survey_id": 123456
}
}出口回复
{
"model": "limesurvey",
"action": "export_responses",
"parameters": {
"survey_id": 123456,
"format": "json"
}
}可用的MCP端点
| 操作 | 必需参数 | 说明 |
|---|---|---|
create_survey | survey_title, survey_language | 创建新调查 |
add_question | survey_id, group_id, question_text, question_type | 在调查中添加问题 |
add_group | survey_id, group_title, group_description | 添加问题组 |
activate_survey | survey_id | 激活调查 |
list_surveys | 无 | 列出所有调查 |
export_responses | survey_id | 出口调查回复 |
技术规范
服务器完全实现了MCP规范(2025-06-18)。访问完整的规范:
GET http://localhost:8080/spec安全
- 认证:使用存储在中的凭据
.env - 验证:所有请求都根据MCP模式进行验证
- 会话管理:自动缓存和回收LimeSurvey会话
定制
要添加新的API方法,请执行以下操作:
- 在中添加端点
config/config.yaml - 在中实施该方法
app/main.py - 更新文档
get_mcp_spec函数
故障排除
- 确保在LimeSurvey中启用RPC API(
Configuration → Interfaces → Enable RPC API) - 验证中的正确凭据
.env - 检查服务器日志以获取详细的错误消息
许可证
该项目由麻省理工学院授权。看 许可证 了解详情。
