TL

tonisormisson/limesurvey-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

6 stars 4 forks 质量 52 趋势 14

Limesurvey MCP server

概览

A Model Context Protocol (MCP) server that exposes LimeSurvey Remote API functionality as MCP tools. This server provides a standardized way to interact with LimeSurvey's powerful survey management capabilities through MCP clients. Create a .env file in the root directory with the following variables: Once the server is running, you can use any MCP client to connect to it and access LimeSurvey functionality. By default the server starts with stdio only. Set ENABLE_SSE=true when you need the HTTP/SSE transport on /sse and /messages, for example when the MCP server runs remotely instead of being spawned locally by the client. You can build a survey without the LimeSurvey admin UI by combining write tools: 1. — create an inactive survey; note the returned survey ID (sid). 2. — create one or more question groups; each call returns a group ID (gid) for the next step. 3. — for each question, pass content (export a prototype question once from the UI, or generate compatible XML).

README

以下为原文 README 节选,完整内容请查看原文。

LimeSurvey MCP Server

A Model Context Protocol (MCP) server that exposes LimeSurvey Remote API functionality as MCP tools. This server provides a standardized way to interact with LimeSurvey’s powerful survey management capabilities through MCP clients.

Table of Contents

Installation

# Clone the repository
git clone https://github.com/TonisOrmisson/limesurvey-mcp.git
cd limesurvey-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Start the server
npm start

Configuration

Create a .env file in the root directory with the following variables:

# LimeSurvey Remote API Settings
LIMESURVEY_API_URL=https://your-limesurvey-instance.com/admin/remotecontrol
LIMESURVEY_USERNAME=your_username
LIMESURVEY_PASSWORD=your_password

# Server settings
PORT=3000
ENABLE_SSE=false

# Optional: run in read‑only mode
# When true, all write tools short‑circuit and return an error message
# instead of calling LimeSurvey.
READONLY_MODE=false

Usage

Once the server is running, you can use any MCP client to connect to it and access LimeSurvey functionality.

By default the server starts with stdio only. Set ENABLE_SSE=true when you need the HTTP/SSE transport on /sse and /messages, for example when the MCP server runs remotely instead of being spawned locally by the client.

Headless survey construction (addSurvey → groups → questions)

You can build a survey without the LimeSurvey admin UI by combining write tools:

  1. addSurvey — create an inactive survey; note the returned survey ID (sid).
  2. addGroup — create one or more question groups; each call returns a group ID (gid) for the next step.
  3. importQuestion — for each question, pass base64-encoded .lsq content (export a prototype question once from the UI, or generate compatible XML). Use importDataType: lsq.
  4. setSurveyProperties — welcome text, description, end URL, etc.
  5. activateSurvey — when the structure is ready.

Idempotent rebuilds: use deleteQuestion (per qid, with confirmDeletion: true) and deleteGroup (per survey + gid) to tear down a group or individual questions before re-importing .lsq templates. Deleting a group removes that group’s content; confirm behaviour on your LimeSurvey version in a dev survey first.

Participant link pattern: https:///index.php/ (use sid from addSurvey or listSurveys). Tokenised access uses your existing participant tools.

Example MCP client snippet (pseudo‑YAML) to list surveys:

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →