How afsozer/emsal-mcp works
Dayanak is an MCP server and CLI for citation-safe research, search, and document preparation across Turkish legal sources. The principal workflow starts with an MCP client request, dispatches through the server to live-source or local-corpus search, and returns sourced results; research can fetch documents and assemble a quality-checked bundle. Separate capabilities include legislation lookup, citation checks, drafting, privacy tools, watches, exports, and health administration. Edges reflect README-documented tool behavior and source-index references; unsampled implementation details are not inferred.
Main entry points: server.py MCP tool server · registry.py Source registry · research.py Topic research · semantic.py Hybrid search
Components 21
Client interface
- MCP tool server
src/dayanak/server.py - CLI commands
src/dayanak/cli.py
Legal sources
- Source registry
src/dayanak/sources/registry.py - Bedesten decisions
src/dayanak/sources/bedesten.py - Official legislation
src/dayanak/sources/mevzuatgov.py - Other public sources
src/dayanak/sources/simple_public.py - Legislation tools
src/dayanak/legislation.py
Local corpus
- Document cache
src/dayanak/cache.py - Hybrid search
src/dayanak/semantic.py - Embedding providers
src/dayanak/embeddings.py - Legislation corpus
src/dayanak/legislation_corpus.py - PDF extraction
src/dayanak/pdf_extractor.py
Research workflows
- Topic research
src/dayanak/research.py - Research watches
src/dayanak/research_watch.py - Petition drafting
src/dayanak/petition.py - Argument building
src/dayanak/argument.py - Document export
src/dayanak/exporter.py
Trust and operations
- Citation safety
src/dayanak/safety.py - Privacy controls
src/dayanak/privacy.py - Source health
src/dayanak/ops_status.py
Other components
- MCP client
Connections 24
- MCP client → MCP tool server: invokes tools
README.md - MCP tool server → Source registry: routes searches
src/dayanak/server.py - Source registry → Bedesten decisions: registers adapter
src/dayanak/sources/registry.py - Source registry → Official legislation: registers adapter
src/dayanak/sources/registry.py - Source registry → Other public sources: registers adapters
src/dayanak/sources/registry.py - MCP tool server → Legislation tools: dispatches legislation
src/dayanak/server.py - MCP tool server → Hybrid search: dispatches local search
src/dayanak/server.py - Hybrid search → Document cache: searches corpus
src/dayanak/semantic.py - Hybrid search → Embedding providers: uses embeddings
src/dayanak/semantic.py - MCP tool server → Topic research: starts research
README.md - Topic research → Source registry: searches sources
src/dayanak/research.py - Topic research → Document cache: reads cached documents
src/dayanak/research.py - MCP tool server → Research watches: dispatches watch tools
README.md - Research watches → Topic research: reruns topic research
src/dayanak/research_watch.py - MCP tool server → Petition drafting: dispatches drafting
src/dayanak/server.py - MCP tool server → Argument building: dispatches argument tools
src/dayanak/server.py - MCP tool server → Document export: dispatches export
src/dayanak/server.py - MCP tool server → Privacy controls: dispatches privacy tools
README.md - MCP tool server → Source health: dispatches health checks
README.md - Petition drafting → Citation safety: checks safe use
src/dayanak/petition.py - MCP tool server → PDF extraction: extracts legal files
src/dayanak/server.py - PDF extraction → Document cache: reads cached documents
src/dayanak/pdf_extractor.py - Legislation tools → Legislation corpus: queries local corpus
src/dayanak/legislation.py - CLI commands → MCP tool server: starts server
src/dayanak/cli.py