Skip to main content

MCP server to allow LLMs to read MDX/MDD dictionary files directly

Project description

MDict MCP Server

Installation

git clone https://github.com/cdpath/mdict-mcp
cd mdict-mcp
uv sync

Usage

  1. Place your MDX dictionary files in the /path/to/mdicts/ directory
  2. Start the MCP server:
uv run mdict-mcp -d /path/to/mdicts/
  1. Connect from your MCP client (Claude Desktop, Chatwise, etc.)

Chatwise:

uv --directory $HOME/Developer/mdict-mcp run mdict-mcp --log-level INFO --dictionary-dir /path/to/mdicts/

Available Tools

Core Dictionary Tools

lookup_word - Look up a word in the loaded dictionaries

Request:

{
  "word": "science",
  "dictionary": "optional_specific_dictionary_name"
}

Response:

{
  "word": "science",
  "found": true,
  "dictionary": null,
  "definition": "<HTML definition content>",
  "success": true
}
search_words - Search for words matching a pattern

Request:

{
  "pattern": "sci",
  "limit": 10,
  "dictionary": "optional_specific_dictionary_name"
}

Response:

{
  "pattern": "sci",
  "limit": 10,
  "dictionary": null,
  "count": 5,
  "words": ["science", "scientist", "scissors", "scintillate", "scimitar"],
  "success": true
}
find_similar_words - Find words similar to a given word using fuzzy matching

Request:

{
  "word": "science",
  "dictionary": "optional_specific_dictionary_name",
  "limit": 10,
  "max_distance": 2
}

Response:

{
  "word": "science",
  "dictionary": null,
  "limit": 10,
  "max_distance": 2,
  "total_found": 15,
  "returned": 10,
  "similar_words": [
    {
      "word": "sciences",
      "dictionary": "Webster",
      "edit_distance": 1,
      "similarity_score": 0.875
    }
  ],
  "success": true
}

Dictionary Management Tools

list_dictionaries - List all loaded dictionaries with metadata

Request:

{}

Response:

{
  "count": 2,
  "dictionaries": [
    {
      "name": "Webster",
      "path": "/path/to/webster.mdx",
      "description": "Webster's Dictionary",
      "version": "1.0"
    }
  ],
  "success": true
}
scan_dictionaries - Scan the dictionary directory for new MDX files and load them

Request:

{}

Response:

{
  "directory": "./mdicts",
  "total_files": 5,
  "already_loaded": 2,
  "new_loaded": 3,
  "failed": 0,
  "successfully_loaded": ["./mdicts/oxford.mdx"],
  "failed_files": [],
  "success": true
}
get_dictionary_metadata - Get detailed metadata information for a specific dictionary

Request:

{
  "dictionary": "dictionary_name"
}

Response:

{
  "dictionary": "Webster",
  "metadata": {
    "title": "Webster's Dictionary",
    "description": "English Dictionary",
    "version": "1.0",
    "entries": 50000
  },
  "success": true
}
get_dictionary_keys - Get all available keys (words) from a dictionary or sample of keys

Request:

{
  "dictionary": "dictionary_name",
  "limit": 100,
  "prefix": "optional_prefix"
}

Response:

{
  "dictionary": "Webster",
  "prefix": "sci",
  "total_keys": 50000,
  "filtered_keys": 25,
  "returned_keys": 10,
  "limit": 10,
  "keys": ["science", "scientist", "scientific"],
  "success": true
}

Dependencies

  • mcp: Model Context Protocol implementation
  • mdict-utils: MDX/MDD file parsing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdict_mcp-0.1.0.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdict_mcp-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file mdict_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: mdict_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mdict_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aa59d73a5c47e58608747d2fa6d86ea6f651629a2ae3ee01e390ac13a444159e
MD5 1cf63cc99d3e2d9447ebfe2551b8cf9d
BLAKE2b-256 8df3882d67da59917c57849e79d1dbd9dd2a416c7d55216384f33695d6f29878

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdict_mcp-0.1.0.tar.gz:

Publisher: python-publish.yml on cdpath/mdict-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mdict_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mdict_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mdict_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 986334683664fa3561559b07ae8a24db9a86c98c432ed1211d7ad21a00b07f58
MD5 aee5325cc72c517c1218577e63a5f966
BLAKE2b-256 4b3f7d4a523d00b311443801e8b58a49eebc0cd926bc8b1f13d6278fcb31cc6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdict_mcp-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on cdpath/mdict-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page