Emsal MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| EMSAL_MCP_HOST | No | HTTP dinleme adresi | 127.0.0.1 |
| EMSAL_MCP_PORT | No | HTTP dinleme portu | 8790 |
| EMSAL_CACHE_PATH | No | Korpus SQLite dosyası. Varsayılan: ~/.emsal_mcp/cache.sqlite3 | ~/.emsal_mcp/cache.sqlite3 |
| EMSAL_BULK_VEC_DIR | No | fp16 vektör sidecar'ları (refine için). Örnek: <bench-dizini>\vec | |
| EMSAL_TOOL_PROFILE | No | Araç profili: 'core' (varsayılan) veya 'full' | core |
| EMSAL_TOOL_THREADS | No | Sync araçları için thread havuzu (0 = kapalı) | 6 |
| EMSAL_TOOL_TIMEOUT | No | Araç başına saniye sınırı | 180 |
| EMSAL_MCP_TRANSPORT | No | Taşıma katmanı: 'stdio' (varsayılan) veya 'streamable-http' | stdio |
| EMSAL_EMBEDDING_PROVIDER | No | Gömme sağlayıcısı. Örnek: fastembed-multilingual-e5 | |
| EMSAL_EMBEDDING_CACHE_DIR | No | ONNX model önbelleği. Örnek: <veri-dizini>\models\fastembed |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_decisionsA | ✅ PRIMARY, MANDATORY TOOL FOR ALL CASE-LAW / DECISION / MEVZUAT RESEARCH. For ANY question about court decisions, precedents, case law, or legislation you MUST call THIS tool first. It is the ONLY tool that retrieves real, current documents LIVE from the official source (online — e.g. Bedesten/Yargıtay, Mevzuat). HARD RULES — no exceptions, no interpretation:
--- QUERY HYGIENE (CRITICAL) ---
--- BEDESTEN SOLR OPERATOR COOKBOOK ---
⚠️ THE DEFAULT OPERATOR IS OR — whitespace between bare terms means
UNION. +required must appear (+tazminat) -excluded must not (-bölge) "exact" phrase ("iş kazası") AND/OR/NOT UPPERCASE only (grouping) sub-expressions ⚠️ CHARACTER WHITELIST (measured live): Bedesten accepts ONLY letters,
digits, spaces and the operators above. Wildcards (* ?), fuzzy (~),
boost (^) and ANY punctuation (/ . , ' : ; _ …) are rejected outright
with INVALID_QUERY — there is NO wildcard search, write the full word.
Article numbers: ⚠️ THE INDEX IS NOT STEMMED — each inflected form is its own token:
TWO-PASS BEHAVIOUR: A plain multi-word query with NO operators is first
tried with every term required ( Worked examples (query string → what it does): +işçi +tazminat → BOTH "işçi" AND "tazminat" +"iş kazası" +tazminat → phrase "iş kazası" AND "tazminat" (+işçi OR +memur) +tazminat -manevi → (işçi OR memur) AND tazminat, not "manevi" ⚠️ Quote each concept rather than listing bare inflected words:
Notes:
Args:
source: Optional source identifier. Available sources:
- Returns:
Dict with results, pagination metadata, and optional warnings.
The |
| get_documentA | Fetch a single document by ID from the given source. Args: source: Source identifier. document_id: Document ID (must not be empty). include_raw: If True, include the raw upstream response in the output (debugging). Default: False (deduplicated output with single markdown text field). page_number: 1-indexed page number for long documents (>= 40 000 chars). Default 1 returns the first page. Long documents are split at paragraph boundaries so no page starts or ends mid-paragraph. Returns:
Document dict with deduplicated metadata and content fields.
Text is served as a single |
| search_legislationA | Search legislation via the Mevzuat source. Use Args: query: Search phrase (body-text). Auto-routes TCK/HMK/etc → number. sources: Source IDs (default: ["mevzuat"]). legislation_type: Filter by type (e.g. "Kanun", "Yönetmelik"). limit: Max results. scope: 'law' (default) or 'article'. document_id: Required when scope='article'. sort_by: "relevance" (default) | "date" | "kayit_tarihi". mevzuat_adi: Title-only search. mevzuat_no: Official legislation number (NEVER guess). mevzuat_tur_list: Multi-type filter (KANUN, KHK, YONETMELIK, ...). Returns: Dict with ok, query, results, total_results, warnings, etc. |
| mevzuat_korpus_araA | YEREL korpusta MADDE bazında arama (çevrimdışı, madde metinlerinde). mode: "hybrid" (varsayılan; BM25+anlam RRF), "lexical" (FTS5, kelime AND), "semantic" (ifade metinde geçmese de bulur). 0 sonuç "hüküm yok" DEMEK DEĞİL: korpus yalnız çekilmişi içerir, search_legislation çağır. mevzuat_no tek mevzuatla sınırlar (ör. "6098"). Sonuç: mevzuat_adi, madde_no, baslik, snippet, kaynak_url. |
| mevzuat_madde_getirA | Yerel korpustan tek maddenin TAM metni (çevrimdışı). madde_no "390", "12/A", "Geçici 1" kabul eder. Korpusta yoksa NOT_FOUND döner — uydurma, canlı get_legislation çağır. |
| research_topicC | Search sources, fetch documents, and build a research bundle. Returns bundle metadata with query, sources, result_count, fetched_count, content_status_summary, citation_safe_count, generated_files, warnings, and recommended_next_steps. |
| search_local_corpusA | Concept DISCOVERY over the local corpus. Searches the local corpus (decisions already fetched this session or
via the corpus crawl) for a legal CONCEPT when the exact wording is
unknown. Each result carries Roles are complementary: THIS tool = DISCOVERY over the local corpus;
QUERY FORM: 2–6 legal keywords, NOT a sentence. All terms are
required (AND) and match anywhere in the text, so narrative filler
only shrinks the result set. Quote words to require them adjacent:
Args:
query: 2–6 legal keywords; |
| get_legislationA | Get legislation content from the Mevzuat source. Args: document_id: Mevzuat document ID. source: Source ID (default: "mevzuat"). part: 'document' (default, full text), 'article_tree' the part/section/article tree, 'gerekce' the rationale. page_number: page of part='document' (40 000 chars/page). Returns: Dict for the requested part; 'document' also carries current_page/total_pages/total_chars. |
| export_documentA | Unified document export: DOCX, UDF, PDF, plain text, or bundle. Args: format: 'docx' (default), 'udf', 'pdf', 'plain', 'bundle', or 'capabilities' (returns supported formats). draft_path: Path to draft.md (for docx/plain). draft_json: Draft metadata dict (for docx). text: Text to write (for udf; plain text — petition formatting such as bold title/labels/headings is applied automatically). out_path: Output file path (for docx/udf/plain). out_dir: Output directory (for bundle). pack_dir: Pack directory (for bundle). draft_dir: Draft output directory (for bundle). docx_path: Path to a .docx (for bundle; for udf this is the PREFERRED input — converts DOCX directly to UDF preserving bold, alignment, indent and line spacing). udf_path: Path to a .udf — converts it to docx or pdf via LibreOffice (replaces convert_udf_to_docx/pdf). title_centered: Center the title in UDF output. title: Document title (for legacy export_bundle). body: Document body (for legacy export_bundle). documents: List of document dicts (for legacy export_bundle). |
| load_extended_toolsA | Load extra tool categories into the running MCP server (no restart). Core profile registers 11 tools. Everything else waits here; load a category when the task needs it. Categories: drafting — citation_check (atif dogrula/bicimlendir/guvenlik), prepare_petition (dilekce input_pack/outline/taslak) files — read_legal_file (UDF/PDF dosyasi oku) meta — list_sources (kaynaklar, birim kodlari, mevzuat turleri), legal_research_guide (arama/Solr/daire/atif rehberi) legislation — mevzuat_degisiklik_raporu (haftalik mevzuat degisimi) drafting_advanced — coklu-mesele paketi, sablonlar, argüman zinciri, draft_document, export_bundle chambers — daire profili, timeline, benzer daire privacy — PII tarama/maskeleme/denetim watch — arastirma izleme listeleri indexing — index_status (semantik indeks durumu) health_admin — circuit breaker, kaynak sagligi/smoke udf_admin — UDF/PDF araci durumu, PDF tam metne yukseltme Args: categories: List of category names, e.g. ["drafting", "files"]. Returns: Dict with ok, loaded tools, already_loaded, invalid_categories, and a note if the MCP client may need to refresh its tool list. |
| health_checkA | Run a consolidated health check across sources, breakers, indexes and cron jobs. Returns overall status plus source smoke summary, circuit breaker
states, search index status and |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 11 tools
The search surface is heavily overlapping: mevzuat_korpus_ara, search_local_corpus, search_decisions, search_legislation all perform searches with only subtle distinctions (local vs live, decisions vs legislation). Descriptions spend enormous effort explaining which to use and the corpus-lag nuance, which itself signals the boundaries are unclear; search_legislation vs mevzuat_korpus_ara vs get_legislation further blur retrieval vs fetch.
Names mix English and Turkish (search_decisions vs mevzuat_korpus_ara vs mevzuat_madde_getir), and verb styles vary (get_document, get_legislation, mevzuat_madde_getir, search_*, research_topic, load_extended_tools, health_check). There is a loose verb_noun pattern but the Turkish/English split and inconsistent word order make it unpredictable.
11 core tools for a legal research server is well within a reasonable range, and the load_extended_tools mechanism sensibly gzips the broader surface into categories rather than exposing everything upfront.
Search, fetch, legislation retrieval, research bundle, export and health check cover the core legal-research lifecycle; drafting, citation check, file reading and PII are gated behind load_extended_tools rather than absent. Minor gaps: no direct delete/cleanup or a default-visible listing of extended tools' own availability.