Online Kommentar MCP Server

Online Kommentar MCP Server

Provides access to Swiss legal commentaries through Model Context Protocol, allowing users to search and retrieve detailed legal commentary content from onlinekommentar.ch in multiple languages.

Category
访问服务器

Tools

search_commentaries

Searches for legal commentaries based on a query and filters.

get_commentary_by_id

Retrieves a specific commentary by its ID.

README

Online Kommentar MCP Server

A Model Context Protocol (MCP) server that provides access to Swiss legal commentaries from onlinekommentar.ch. This server allows you to search and retrieve detailed legal commentaries on Swiss federal law through Claude Desktop or other MCP-compatible clients.

Features

  • Search Commentaries: Full-text search across legal commentaries with filtering options
  • Retrieve Individual Commentaries: Get detailed content for specific legal articles
  • Multi-language Support: Search in English, German, French, and Italian
  • Advanced Filtering: Filter by legislative act, sort by title or date
  • Pagination Support: Navigate through large result sets

Installation

Prerequisites

  • Node.js (version 14 or higher)
  • npm or yarn package manager
  • Claude Desktop (for MCP integration)

Setup

  1. Clone the repository:

    git clone https://github.com/self-tech-labs/onlinekommentar-mcp.git
    cd onlinekommentar-mcp
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    

Usage with Claude Desktop

Configuration

Add the following configuration to your Claude Desktop MCP settings file:

On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "online-kommentar": {
      "command": "node",
      "args": ["/path/to/onlinekommentar-mcp/build/index.js"]
    }
  }
}

Replace /path/to/onlinekommentar-mcp with the actual path to your project directory.

Restart Claude Desktop

After adding the configuration, restart Claude Desktop to load the MCP server.

Available Tools

1. Search Commentaries

Search for legal commentaries using various filters.

Parameters:

  • search (required): Full-text search query
  • language (optional): Content language (en, de, fr, it)
  • legislative_act (optional): Filter by legislative act ID
  • sort (optional): Sort order (title, -title, date, -date)
  • page (optional): Page number for pagination

Example queries:

  • "Search for commentaries about intellectual property"
  • "Find German commentaries about data protection"
  • "Search for articles related to criminal law, sorted by date"

2. Get Commentary by ID

Retrieve detailed information about a specific commentary using its ID.

Parameters:

  • id (required): The unique identifier of the commentary

Example:

  • "Get commentary details for ID: 6d8aee6b-86d0-43f2-8110-2d5b7360dd18"

Examples

Search Example

Search for commentaries about "constitutional rights" in English

This will return a list of relevant commentaries with their IDs, titles, publication dates, and URLs.

Detailed Commentary Example

Get the full content of commentary ID: 7058f7a5-19d8-444e-a901-7bb635ded375

This will return comprehensive information including:

  • Full title and publication details
  • Authors and editors
  • Legislative act information
  • Complete commentary content
  • Legal text being commented on

Development

Project Structure

onlinekommentar-mcp/
├── src/
│   └── index.ts          # Main MCP server implementation
├── build/                # Compiled JavaScript output
├── package.json          # Project dependencies and scripts
├── tsconfig.json         # TypeScript configuration
└── README.md            # This file

Available Scripts

  • npm run build: Compile TypeScript to JavaScript
  • npm start: Run the compiled server (for testing)

API Integration

The server integrates with the onlinekommentar.ch API:

  • Base URL: https://onlinekommentar.ch/api
  • Endpoints:
    • /commentaries - Search commentaries
    • /commentaries/{id} - Get specific commentary

Technical Details

MCP Protocol

This server implements the Model Context Protocol specification, providing:

  • Tool registration for search and retrieval functions
  • Proper error handling and response formatting
  • JSON schema validation for parameters

Data Structure

Commentary objects include:

  • Unique identifiers
  • Multilingual titles and content
  • Author and editor information
  • Legislative act associations
  • Publication dates and metadata
  • Direct links to online versions

Troubleshooting

Common Issues

  1. Server not appearing in Claude Desktop:

    • Check the configuration file path and syntax
    • Ensure the build directory exists and contains compiled JavaScript
    • Restart Claude Desktop after configuration changes
  2. Build errors:

    • Verify Node.js version (14+ required)
    • Run npm install to ensure all dependencies are installed
    • Check for TypeScript compilation errors
  3. API connection issues:

    • Verify internet connectivity
    • Check if onlinekommentar.ch is accessible
    • Review error messages in Claude Desktop logs

Debugging

To debug the MCP server:

  1. Check Claude Desktop logs for error messages
  2. Test the API endpoints directly using curl:
    curl "https://onlinekommentar.ch/api/commentaries?search=test"
    
  3. Verify the build output in the build/ directory

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and add tests
  4. Commit your changes: git commit -am 'Add new feature'
  5. Push to the branch: git push origin feature-name
  6. Submit a pull request

License

This project is open source. Please refer to the license file for details.

Support

For issues and questions:

  • Open an issue on GitHub
  • Check the troubleshooting section above
  • Review the MCP protocol documentation

Acknowledgments


Note: This tool provides access to Swiss legal commentaries for informational purposes. Always consult qualified legal professionals for legal advice.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选