Skip to main content
Glama
self-tech-labs

Online Kommentar MCP Server

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

Related MCP server: German Legal MCP Server

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.

Available Tools

2 tools
get_commentary_by_idGet Commentary by IDC

Retrieves a specific commentary by its ID.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the commentary to retrieve.

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a retrieval operation, implying read-only behavior, but doesn't address permissions, error conditions, rate limits, or what happens if the ID doesn't exist. Significant behavioral context is missing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a simple retrieval tool and gets straight to the point without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a retrieval tool with no annotations and no output schema, the description is insufficient. It doesn't explain what a 'commentary' is, what format it returns, error handling, or how this differs from the sibling search tool. More context is needed for proper agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents the single 'id' parameter. The description doesn't add any additional parameter semantics beyond what's in the schema, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('retrieves') and resource ('a specific commentary'), making the purpose unambiguous. However, it doesn't explicitly differentiate from the sibling 'search_commentaries' tool, which would be needed for a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus the sibling 'search_commentaries' tool. The description doesn't mention prerequisites, alternatives, or contextual constraints, leaving the agent without usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_commentariesSearch CommentariesC

Searches for legal commentaries based on a query and filters.

ParametersJSON Schema
NameRequiredDescriptionDefault
searchYesThe full-text search query.
languageNoContent language.
legislative_actNoFilter by legislative act ID.
sortNoSort order.
pageNoPage number for pagination.

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'searches' but doesn't clarify if this is a read-only operation, what the expected response format is, whether there are rate limits, authentication requirements, or pagination behavior beyond the 'page' parameter. This leaves significant gaps in understanding how the tool behaves in practice.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence contributes to understanding the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a search tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what a 'legal commentary' is, the search scope, result format, or behavioral aspects like error handling. This leaves the agent with insufficient context to use the tool effectively beyond basic parameter input.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value by mentioning 'filters' generically, but doesn't elaborate on specific parameters like 'legislative_act' or 'sort' beyond what the schema provides. This meets the baseline for high schema coverage, but doesn't enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('searches for') and resource ('legal commentaries'), making the purpose understandable. It distinguishes from the sibling tool 'get_commentary_by_id' by indicating this is a search operation rather than retrieval by specific ID. However, it doesn't specify what constitutes a 'legal commentary' or the search scope beyond 'based on a query and filters,' which keeps it from being fully specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'filters' but doesn't specify which filters are available or when to apply them. There's no mention of prerequisites, limitations, or comparison to the sibling tool 'get_commentary_by_id,' leaving the agent without clear usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updates
    • First observedget_commentary_by_id
    • First observedsearch_commentaries

TDQS

B3.1/5.0
Disambiguation5/5

The two tools have clearly distinct purposes: one retrieves a specific commentary by ID, while the other searches for commentaries based on queries and filters. There is no overlap or ambiguity between them.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern with snake_case naming: get_commentary_by_id and search_commentaries. The naming is predictable and readable throughout.

Tool Count2/5

With only two tools, the server feels thin for a legal commentary domain. It lacks essential operations like creating, updating, or deleting commentaries, which limits its utility and scope.

Completeness2/5

The tool surface is severely incomplete for a legal commentary server. It only provides retrieval and search capabilities, missing core CRUD operations (create, update, delete) and other lifecycle management tools, leading to significant gaps in functionality.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables access to LDS Gospel Library content and scriptures through the Model Context Protocol. Provides tools for searching and retrieving religious texts and study materials from the Church of Jesus Christ of Latter-day Saints.
    2
    -
  • A
    license
    A
    quality
    A
    maintenance
    Provides unified access to German federal and state legislation, court decisions, and European Union legal databases for comprehensive legal research. It enables users to search and retrieve full-text laws, parliamentary documents, and judicial rulings directly through the Model Context Protocol.
    20
    132
    4
    GPL 3.0
  • A
    license
    A
    quality
    A
    maintenance
    MCP server for searching Swiss court decisions from federal and cantonal courts via entscheidsuche.ch. Enables full-text search, law reference lookup, and filtering by canton, court level, and date without API keys.
    8
    1
    MIT
  • F
    license
    A
    quality
    B
    maintenance
    Enables AI models to search and retrieve legal documents, magazine issues, comments, and related references from the Linde database (linda.lindeverlag.at) using the Model Context Protocol.
    8
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/self-tech-labs/onlinekommentar-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server