English Description

Overview

The Civil Code MCP Server is a Model Context Protocol (MCP) server that provides structured access to the content and organization of the Chinese Civil Code. This implementation allows AI models to efficiently retrieve, navigate, and search through the Civil Code's hierarchical structure and specific articles.

Features

  • Hierarchical Navigation: Browse through the Civil Code's structure from the top level (分编) down to specific articles (条)
  • Structured Data: Access the logical structure of the Civil Code, organized by sections, chapters, and articles
  • Content Retrieval: Fetch the precise content of any specific article by its full path

Technical Implementation

The server is built using the Model Context Protocol SDK and implements two main tools:

  1. get_structure: Retrieve the child nodes of a specified parent node in the Civil Code hierarchy
  2. Input: Optional parent_node (string) - The path of the parent node
  3. Output: A JSON object containing the list of child nodes

  4. get_article_content: Retrieve the content of a specific article

  5. Input: article_path (string) - The full path to the article
  6. Output: The text content of the specified article

Technical Architecture

The server maintains two key data structures: - StructData: A mapping from node paths to their child nodes - ContentData: A mapping from article paths to their textual content

Usage

The server runs on standard input/output and can be connected to any MCP-compatible client. It provides a structured interface for accessing the Chinese Civil Code, enabling AI models to reference specific legal articles and navigate through the code's structure.

Command Line Usage

You can start the server directly using npx:

bash npx -y @jjfather/civil-code-of-china-mcp

This command will download and run the MCP server without needing to install it globally.


Chinese Description

Overview

The Civil Code MCP Server is a server based on the Model Context Protocol (MCP) that provides structured access to the content and organization of the Chinese Civil Code. This implementation allows AI models to efficiently retrieve, navigate, and search through the hierarchical structure and specific articles of the Civil Code.

Features

  • Hierarchical Navigation: Browse through the Civil Code's structure from the top level (分编) down to specific articles (条)
  • Structured Data: Access the logical structure of the Civil Code, organized by sections, chapters, and articles
  • Content Retrieval: Fetch the precise content of any specific article by its full path

Technical Implementation

The server is built using the Model Context Protocol SDK and implements two main tools:

  1. get_structure: Retrieve the child nodes of a specified parent node in the Civil Code hierarchy
  2. Input: Optional parent_node (string) - The path of the parent node
  3. Output: A JSON object containing the list of child nodes

  4. get_article_content: Retrieve the content of a specific article

  5. Input: article_path (string) - The full path to the article
  6. Output: The text content of the specified article

Technical Architecture

The server maintains two key data structures: - StructData: A mapping from node paths to their child nodes - ContentData: A mapping from article paths to their textual content

Usage

The server runs on standard input/output and can be connected to any MCP-compatible client. It provides a structured interface for accessing the Chinese Civil Code, enabling AI models to reference specific legal articles and navigate through the code's structure.

Command Line Usage

You can start the server directly using npx:

bash npx -y @jjfather/civil-code-of-china-mcp

This command will download and run the MCP server without needing to install it globally.