Labsco
nakamura196 logo

Genji MCP Server

from nakamura196

Search and analyze classical Japanese literature using the Genji API, with advanced normalization features.

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

Genji MCP Server

A Model Context Protocol (MCP) server that provides access to the Genji API for classical Japanese literature analysis and search. This server enables AI assistants like Claude to search and analyze texts from classical Japanese literature with advanced normalization features.

Features

  • ๐Ÿฅ Health Check: Monitor API status and availability
  • ๐Ÿ” Advanced Text Search: Search classical Japanese texts with sophisticated normalization options
  • โš™๏ธ Normalization Rules: Access and understand text normalization rules
  • ๐Ÿ” Normalization Preview: Preview how text will be normalized before processing
  • ๐Ÿ‡ฏ๐Ÿ‡ต Classical Japanese Support: Specialized handling of historical Japanese text variations

Available Tools

genji_health_check

Checks the health and availability of the Genji API.

Parameters: None

Searches classical Japanese texts with advanced normalization options.

Parameters:

  • query (string, optional): Search query text
  • limit (number, optional): Maximum results to return (1-100, default: 20)
  • offset (number, optional): Number of results to skip (default: 0)
  • sort (string, optional): Sort order for results
  • expand_repeat_marks (boolean, optional): Expand repeat marks (default: true)
  • unify_kanji_kana (boolean, optional): Unify kanji/kana variations (default: true)
  • unify_historical_kana (boolean, optional): Unify historical kana (default: true)
  • unify_phonetic_changes (boolean, optional): Unify phonetic variations (default: true)
  • unify_dakuon (boolean, optional): Unify voiced sound variations (default: true)
  • vol_str (array, optional): Volume/chapter filter

genji_get_normalization_rules

Retrieves the list of available text normalization rules.

Parameters: None

genji_preview_normalization

Previews how text would be normalized with current rules.

Parameters:

  • text (string, required): Text to preview normalization for

Text Normalization Features

The server supports various normalization options for classical Japanese text:

  • Repeat Marks Expansion: Converts repeat marks (ใ€…, ใ‚, ใ‚ž) to full characters
  • Kanji-Kana Unification: Handles variations between kanji and kana representations
  • Historical Kana Unification: Normalizes historical kana usage to modern equivalents
  • Phonetic Changes: Accounts for historical phonetic variations
  • Dakuon Unification: Handles voiced/unvoiced sound variations

Development

# Clone the repository
git clone https://github.com/nakamura196/genji-mcp-server.git
cd genji-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

# Start in development mode
npm run dev

API Reference

This server interfaces with the Genji API, which provides:

  • Full-text search of classical Japanese literature
  • Advanced text normalization for historical Japanese
  • Metadata about literary works and volumes
  • Health monitoring endpoints

Error Handling

The server includes comprehensive error handling for:

  • API connectivity issues
  • Invalid search parameters
  • Text encoding problems
  • Normalization errors
  • Rate limiting (if applicable)

Support

If you encounter any issues, please file them on the GitHub Issues page.

Changelog

1.0.1

  • Fix API URL references in documentation
  • Remove unused TypeScript interfaces for cleaner code
  • Update documentation links

1.0.0

  • Initial release
  • Health check functionality
  • Advanced text search with normalization options
  • Normalization rules management
  • Text normalization preview
  • Full classical Japanese text analysis support