Hukuk MCP
# Hukuk MCP
Yerel MCP sunucusu: kamu Türk mevzuatı ve mahkeme/kurul kararlarını AI istemcilerine bağlar; dilekçe taslağı ve UYAP UDF üretir.
UYAP avukat girişi, abonelik ve web sitesi yoktur. Kişisel dava dosyası indirmez. Üretilen metin hukuki tavsiye değildir.
## Ön koşul
[uv](https://docs.astral.sh/uv/) kurulu olsun (Python 3.11+ otomatik gelir).
```powershell
powershell -ExecutionPolicy Bypass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
## Tek satır kurulum (`uvx`)
GitHub’dan doğrudan çalışır; klasör kopyalamaya gerek yok.
```text
uvx --from git+https://github.com/berkebeydag/hukuk-mcp.git hukuk-mcp
```
### Cursor
Settings → MCP veya proje `.cursor/mcp.json`:
```json
{
"mcpServers": {
"hukuk": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/berkebeydag/hukuk-mcp.git",
"hukuk-mcp"
]
}
}
}
```
### Codex (CLI / IDE)
`~/.codex/config.toml` (Windows: `%USERPROFILE%\.codex\config.toml`):
```toml
[mcp_servers.hukuk]
command = "uvx"
args = [
"--from",
"git+https://github.com/berkebeydag/hukuk-mcp.git",
"hukuk-mcp"
]
startup_timeout_sec = 45
```
veya:
```powershell
codex mcp add hukuk -- uvx --from git+https://github.com/berkebeydag/hukuk-mcp.git hukuk-mcp
```
### Claude Desktop / Claude Code
Claude Desktop: `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"hukuk": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/berkebeydag/hukuk-mcp.git",
"hukuk-mcp"
]
}
}
}
```
### OpenCode
`opencode.json` / `~/.config/opencode/opencode.json`:
```json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"hukuk": {
"type": "local",
"command": [
"uvx",
"--from",
"git+https://github.com/berkebeydag/hukuk-mcp.git",
"hukuk-mcp"
],
"enabled": true
}
}
}
```
Hazır kopyalar: [`examples/`](examples/).
## Geliştirici kurulumu
```powershell
git clone https://github.com/berkebeydag/hukuk-mcp.git
cd hukuk-mcp
uv sync
uv run hukuk-mcp
```
Yerel klasörle Cursor:
```json
{
"mcpServers": {
"hukuk": {
"command": "uv",
"args": ["run", "--directory", "C:\\\\path\\\\to\\\\hukuk-mcp", "hukuk-mcp"]
}
}
}
```
## Örnek sorular
- `TMK 166 madde metnini getir`
- `4721 sayılı kanunu bul`
- `Yargıtay boşanma kararlarından son örnekleri ara, esas ve karar no ile yaz`
- `KİK 2025/UH.II-1801 kararını getir`
- `Bu cevap dilekçesini UDF olarak kaydet`
## Araçlar
| Araç | İş |
|------|-----|
| `search_mevzuat` | Kanun / yönetmelik ara |
| `get_mevzuat_content` | Tam metin (sayfalı) |
| `search_within_mevzuat` | Madde içi AND/OR/NOT |
| `get_mevzuat_madde_tree` | İçindekiler |
| `get_mevzuat_gerekce` | Kanun gerekçesi |
| `search_karar` / `get_karar` | Yargıtay, Danıştay, BAM… (`kaynak`: bedesten / resmi / hepsi) |
| `search_aym` / `get_aym` | Anayasa Mahkemesi |
| `search_emsal` / `get_emsal` | UYAP Emsal (kamu) |
| `search_kurum` / `get_kurum` | KİK, Rekabet, Sayıştay, KVKK, BDDK, BTK, GİB, Sigorta Tahkim, Uyuşmazlık |
| `check_kaynaklar` | Kaynak sağlık |
| `dilekce_taslagi` | Dilekçe iskeleti |
| `uslup_kaydet` / `uslup_liste` | Yerel üslup |
| `udf_yaz` / `udf_oku` / `docx_to_udf` | UDF |
Karar numarası uydurulmaz: önce `search_*`, sonra `get_*`. UDF imzasızdır.
## Sınırlar
Kamu sitelerinin hız limitine uyulur. Özel indeks yoktur. KİK ekapv2 AES anahtarı kopyalanmaz (kamu EKAP formu). Sayıştay HTTPS bazı ağlarda TLS reset verir; tarayıcı linki döner.
## Test
```powershell
uv sync --group dev
uv run pytest tests/test_local.py
```
## Lisans
MIT
TDQS
Scored across 20 tools
Each tool targets a distinct legal source or document operation (search_kurum vs search_aym vs search_emsal vs search_karar, etc.), but the overlapping case-law search tools (search_emsal, search_karar, search_kurum) could occasionally be confused without domain knowledge. Descriptions clarify sources like Yargıtay/Danıştay vs UYAP Emsal vs administrative institutions.
Most tools follow a consistent search_X/get_X pattern in snake_case, but utility tools mix English verbs (check_kaynaklar) with Turkish noun-verb order (udf_yaz, uslup_kaydet) and noun-noun forms (dilekce_taslagi), creating minor inconsistency. Still readable and mostly predictable.
20 tools is slightly above the ideal 3-15 range, but the breadth of legal sources (5 research families) and document operations justifies each tool's presence; no redundant tools. It feels comprehensive rather than bloated.
The surface covers search and full-text retrieval for all major Turkish legal sources, plus document conversion, petition drafting, and style management. Minor gaps: no delete/update for saved style samples, and no within-decision search for case law (only for legislation). These are workable.