Nettskjema MCP Server

Nettskjema MCP Server

Enables interaction with Nettskjema forms, submissions, invitations, and data export through the MCP protocol.

Category
访问服务器

README

Nettskjema MCP Server

Model Context Protocol (MCP) server for the Nettskjema API. This server provides tools to interact with Nettskjema forms, submissions, invitations, and more through the MCP protocol.

Features

  • OAuth 2.1 Authentication: Secure client credentials flow with 24-hour token caching
  • Form Management: List, retrieve, and update forms
  • Submissions: Access and manage form submissions
  • Invitations: Create and manage form invitations
  • Data Export: Export form responses as CSV, Excel, and SPSS
  • User Information: Get authenticated user details
  • Automatic Token Management: Tokens are cached and automatically refreshed

Installation

  1. Clone this repository:
git clone <repository-url>
cd nettskjema-mcp
  1. Install dependencies using pip:
pip install -e .

Or using uv:

uv pip install -e .

Configuration

1. Create API Client Credentials

  1. Log into https://authorization.nettskjema.no/
  2. Click "Register client"
  3. Provide a client name and email
  4. Save the clientSecret immediately - it's shown only once!
  5. Note your clientId and clientSecret

2. Configure Environment Variables

Create a .env file from the example:

cp .env.example .env

Add your credentials to the .env file:

NETTSKJEMA_CLIENT_ID=your_client_id_here
NETTSKJEMA_CLIENT_SECRET=your_client_secret_here

Security Note: Never commit or hardcode your clientSecret in code. It's like a password and valid for 365 days. Store it in environment variables or a secure vault.

Token Management: OAuth access tokens are valid for 24 hours and are automatically cached and reused by the server. You don't need to manage token refresh manually.

3. Grant Form Access

Your API client username is: <clientId>@apiclient

For each form you want to access, add this username to the form permissions:

  • Open the form in Nettskjema
  • Go to: Settings → Permissions → Editing permissions
  • Add your client username

Usage

Running the Server

After installation, you can run the server using the installed command:

nettskjema-mcp

Or run as a Python module:

python -m nettskjema_mcp

For development (without installation):

python -m nettskjema_mcp

MCP Client Configuration

Add this to your MCP client configuration (e.g., Claude Desktop config):

Option 1: Using installed command (recommended)

{
  "mcpServers": {
    "nettskjema": {
      "command": "nettskjema-mcp",
      "env": {
        "NETTSKJEMA_CLIENT_ID": "your_client_id_here",
        "NETTSKJEMA_CLIENT_SECRET": "your_client_secret_here"
      }
    }
  }
}

Option 2: Using Python module (for development)

{
  "mcpServers": {
    "nettskjema": {
      "command": "python",
      "args": ["-m", "nettskjema_mcp"],
      "cwd": "/path/to/nettskjema-mcp",
      "env": {
        "NETTSKJEMA_CLIENT_ID": "your_client_id_here",
        "NETTSKJEMA_CLIENT_SECRET": "your_client_secret_here"
      }
    }
  }
}

Available Tools

Authentication & User

  • check_auth_status - Check OAuth authentication status and token info (debugging)
  • get_user_info - Get authenticated user information

Forms

  • list_my_forms - List all your forms
  • create_form - Create a new form
  • delete_forms - Delete forms with trash retention
  • get_form_info - Get metadata for a specific form
  • get_form_settings - Get form configuration
  • get_form_elements - Get all questions/elements in a form
  • get_form_definition - Get complete form definition
  • update_form_settings - Update form settings
  • lookup_form_by_title - Find form ID by short title

Submissions

  • submit_form - Submit a response to a form
  • get_submission - Get a single submission with answers
  • get_submission_metadata - Get metadata for all submissions
  • list_my_submissions - List your submissions
  • get_form_answers - Get all answers for a form
  • delete_submissions - Delete specific submissions

Data Export

  • export_form_csv - Export responses as CSV
  • export_form_excel - Export responses as Excel
  • get_spss_syntax - Generate SPSS syntax file

Invitations

  • get_invitations - List all form invitations
  • create_invitation - Create new invitation with optional SMS
  • delete_invitations - Delete specific invitations
  • send_reminder - Send reminder notifications

Quick Start

After installation and configuration, you can use the MCP server with any MCP-compatible client. Here are some example use cases:

List Your Forms

Use the list_my_forms tool to see all forms you have access to.

Get Form Details

Use get_form_info with a form_id to see the form's metadata.
Use get_form_elements to see all questions in the form.

Export Data

Use export_form_csv or export_form_excel to download form responses.
Use get_form_answers to get raw answer data.

Manage Invitations

Use create_invitation to invite someone to fill out a form.
Use send_reminder to remind people who haven't responded yet.

API Documentation

Full Nettskjema API documentation: https://nettskjema.no/apidoc

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选