Skip to main content
Glama
Turkish Legal Research MCP

Turkish Legal Research MCP

by tifosiman
README.md
# Turkish Legal Research MCP

An early-stage, MIT-licensed project exploring source-grounded legal research in Turkish. The goal is to let legal professionals and researchers search a defined corpus of decisions and legislation, retrieve original passages, and verify citations instead of relying on unsupported generated answers.

## Current prototype

- Local JSONL corpus with explicit source URLs and document identifiers.
- Turkish-aware case normalization and deterministic keyword retrieval.
- Read-only MCP tools for search and document lookup over stdio.
- Synthetic fixtures and unit tests. No real court decisions are included.

This is a lexical retrieval baseline, not yet semantic RAG. Source URLs are supplied by the corpus operator, not independently verified. The project does not yet connect to official legal databases. No adoption or download figures are claimed.

## Quick start

Python 3.10 or later is recommended.

```sh
python -m pip install -r requirements.txt
python -m unittest -v test_search
python server.py
```

Configure your MCP client to launch `python` with the absolute path to `server.py` as its argument. Set the `LEGAL_CORPUS` environment variable to an absolute path to your own JSONL file. Each line must contain `id`, `title`, `text`, `kind` (`case`, `legislation` or `synthetic`) and `source_url` (HTTPS). Use only authorized, appropriately anonymized material. Treat corpus text as data, never as instructions. Do not upload confidential court files, personal information or credentials to this repository.

## Roadmap

- PDF/UDF ingestion with reproducible metadata and page/paragraph locators.
- Official-source adapters where permitted, with rate limits and provenance checks.
- Turkish semantic retrieval and hybrid ranking, evaluated against a curated test set.
- Citation validation, duplicate detection and version-aware legislation retrieval.

Contributions are welcome, especially anonymized or synthetic test cases, Turkish retrieval evaluation and documentation. Open an issue to discuss changes before submitting a substantial pull request.

## Türkçe

Türkçe içtihat ve mevzuat araştırmalarında, belirli bir belge kümesinden özgün metin parçalarını kaynak bilgileriyle birlikte getirmeyi hedefleyen erken aşama bir açık kaynak projesidir. İlk prototip yerel JSONL belgelerinde anahtar kelime araması ve salt okunur MCP araçları sunar. Anlamsal RAG, PDF/UDF işleme ve resmi kaynak bağlantıları henüz geliştirme hedefidir. Örnek belgeler sentetiktir; gerçek mahkeme kararı değildir. Gizli dosyaları veya kişisel verileri depoya yüklemeyin. Sonuçları özgün kaynak üzerinden doğrulayın.