Skip to main content

cymraeg-mcp

Gweinydd MCP prawfddarllen Cymraeg / Welsh proofing & validation MCP server

cymraeg-mcp yn dal gwallau treiglo / catching mutation errors

English below


Cymraeg

Haen ddilysu benderfynadwy ar gyfer testun Cymraeg: gwirio sillafu (hunspell cy_GB) a gwirio treigladau (peiriant rheolau lleol). 100% lleol — dim APIau allanol, dim allweddi API, dim lawrlwytho wrth redeg, yn gweithio'n gyfan gwbl all-lein.

Nid pecyn cymorth Cymraeg cyffredinol mo hwn. Mae LLMau eisoes yn ysgrifennu Cymraeg dda — y broblem yw nad oes modd gwarantu cywirdeb allbwn tebygolaethol. Yr egwyddor yma yw: "Claude sy'n drafftio, hwn sy'n dilysu." Wedi'i anelu at unrhyw un sy'n cyhoeddi cynnwys dwyieithog dan Safonau'r Gymraeg — cynghorau, GIG Cymru, cyrff cyhoeddus — sydd angen gramadeg gwarantedig-gywir.

Offer

Offeryn Mewnbwn Allbwn
cymraeg_check_spelling testun Cymraeg camsillafiadau + awgrymiadau (hunspell cy_GB Prifysgol Bangor)
cymraeg_check_mutations testun Cymraeg gwallau treiglo (meddal / trwynol / llaes) gyda chywiriadau, hyder, a'r rheol yn ddwyieithog
cymraeg_explain_mutation gair + cyd-destun pa dreiglad sy'n berthnasol a pham, ynghyd â thabl treiglo llawn y gair
cymraeg_proof_text testun Cymraeg adroddiad cyfun: sillafu + treigladau mewn un pas

Gosod

Gweler y cyfarwyddiadau gosod yn yr adran Saesneg isod — mae'r gorchmynion yn union yr un fath.

Cyfrannu

Mae'r rheolau treiglo yn data/mutation_rules.yaml — ychwanegwch sbardunau, enwau benywaidd, neu eithriadau yno a chyflwynwch PR. Rhedwch uv run pytest cyn cyflwyno.


English

A deterministic validation layer for Welsh text: spellchecking (hunspell cy_GB) and mutation checking (a local rules engine). 100% local — no external APIs, no API keys, no first-run downloads, fully offline.

This is NOT a general Welsh toolkit. LLMs already write good Welsh — the problem is that probabilistic output can't be guaranteed correct. The positioning here is: "Claude drafts it, this verifies it." Target users: anyone publishing bilingual content under the Welsh Language Standards (councils, NHS Wales, public bodies) who need guaranteed-correct grammar rather than probabilistic LLM output.

Novelty: as of July 2026, no other Welsh-language MCP server exists.

Tools

Tool Input Output
cymraeg_check_spelling Welsh text misspellings + up to 5 suggestions each (Bangor University hunspell cy_GB, 72k+ entries, bundled)
cymraeg_check_mutations Welsh text mutation errors (treiglad meddal / trwynol / llaes) with corrections, confidence levels, and the rule cited bilingually
cymraeg_explain_mutation word + context which mutation applies and why, whether the word is radical or mutated, and the word's full mutation table
cymraeg_proof_text Welsh text combined report: spelling + mutation issues in one pass

All tools are read-only, idempotent, and fully offline.

What the mutation engine covers

  • Soft mutation (treiglad meddal): after the prepositions am, ar, at, dan, tan, dros, drwy/trwy, gan, heb, hyd, i, o, wrth; after dy, dau, dwy, neu, mor, rhy, pur, go, dyma, dyna, dacw, pa; feminine singular nouns after y/yr/'r/un (using an extensible noun list); with the ll/rh exceptions applied.
  • Nasal mutation (treiglad trwynol): after fy; yn/ym/yng locative with form agreement (flags "yn Nghaerdydd" → "yng Nghaerdydd", "ym Bangor" → "ym Mangor"); blynedd/blwydd after numerals (pum mlynedd).
  • Aspirate mutation (treiglad llaes): after â, gyda, tua, tri, chwe, a (and), ei (her), na.
  • Ambiguity handled honestly: "ei" (his/her) is disambiguated by an echoing pronoun where present ("ei tad hi" → "ei thad hi"); "a" offers both the aspirate (conjunction) and soft (relative pronoun) readings; genuinely ambiguous cases are reported at low confidence and hidden by default.

The engine is tuned for precision over recall: it only flags what it can justify from an explicit trigger rule plus a dictionary check, and every finding carries a confidence level. A clean result does not guarantee every mutation is correct — see limitations.

Install

Requires Python 3.11+. With uv (preferred):

git clone https://github.com/dwain-barnes/cymraeg-mcp
cd cymraeg-mcp
uv sync

Or with pip:

pip install .

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "cymraeg": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/cymraeg-mcp", "cymraeg-mcp"]
    }
  }
}

Claude Code

claude mcp add cymraeg -- uv run --directory /path/to/cymraeg-mcp cymraeg-mcp

Example

Input: cymraeg_proof_text("Dw i eisiau mynd i Caerdydd gyda fy cath.")

Output: 2 mutation issues — Caerdydd → Gaerdydd (soft mutation after the preposition 'i'), cath → nghath (nasal mutation after 'fy').

Limitations (read this)

  • A clean report is not a proof of correctness. The engine deliberately stays silent where Welsh is genuinely ambiguous without deeper parsing — e.g. unmutated words after predicative/locative "yn", gender of nouns not in its list, mutation after inflected verbs (object soft mutation), and wrong-mutation-type cases like "gyda dad".
  • The feminine-noun rule only covers nouns listed in data/mutation_rules.yaml (extensible by PR).
  • The dictionary includes correctly mutated forms, so the spellchecker will not flag a mutation error as a misspelling — that's the mutation checker's job.
  • hunspell cy_GB is comprehensive (72k+ stems plus affix rules) but no dictionary is complete; rare proper nouns may be reported as unknown.

Licensing

  • Code: MIT © Dwain Barnes (EryriLabs).
  • Bundled dictionary (data/dictionaries/cy_GB.*): © Bangor University (Prifysgol Bangor) and Troi, licensed under the LGPL v3 or later — see data/dictionaries/LICENCE. It is redistributed unmodified with its licence and attribution intact, as permitted by the LGPL.
  • No data leaves your machine; there is no telemetry and no network access.

Contributing

Mutation rules live in data/mutation_rules.yaml — triggers, feminine nouns, exceptions and never-mutate words are all data, not code. Add a rule, add a test case to tests/test_mutations.py, and run:

uv run pytest
uv run ruff check src tests

Credits

Built by Dwain Barnes / EryriLabs — HuggingFace. Dictionary by Uned Technolegau Iaith, Prifysgol Bangor.

Metadata

Release files for cymraeg-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cymraeg-mcp 0.1.0
File Size Uploaded Provenance Actions
cymraeg_mcp-0.1.0.tar.gz 424.5 kB With provenance Details for cymraeg_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cymraeg-mcp 0.1.0
File Interpreter ABI Platform Actions
cymraeg_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for cymraeg_mcp-0.1.0-py3-none-any.whl

Total release size: 694.7 kB

Release files / cymraeg_mcp-0.1.0.tar.gz

Download URL cymraeg_mcp-0.1.0.tar.gz
Size 424.5 kB
Tags Source
SHA-256 checksum
How to use checksums
62b8a3a1f6ec42f4a03aadc13bf2e27b44af8df00179d4e9f90ab08bb1b123a7
BLAKE2b-256 checksum
How to use checksums
baf276cee38b307a96ae1167039f77306ef05dc5124b641ea10c994e26617d24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

Release files / cymraeg_mcp-0.1.0-py3-none-any.whl

Download URL cymraeg_mcp-0.1.0-py3-none-any.whl
Size 270.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e9aa21127aed6bc1e2b62eaa76d924acd8405214a8183e9d17f231df5a26d03
BLAKE2b-256 checksum
How to use checksums
089505f73ff5a0670292d43deab60b0041b5fb0f42e02d13da7bdd71bc2c5949
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

Security for cymraeg-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cymraeg_mcp-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page