Skip to main content
Glama
MEK MCP

MEK MCP

by wlagyorgy

MEK MCP

Python MCP szerver a Magyar Elektronikus Könyvtár keresőinek eléréséhez agentic eszközök számára.

Dokumentáció

Related MCP server: mcp-openalex

MCP toolok

Tool

Leírás

mek_search_simple

Egyszerű metaadat-keresés (szerző, cím, téma, MEK ID)

mek_search_fulltext

Teljes szöveg keresés HTML/PDF dokumentumokban

mek_search_advanced

Összetett keresés — max. 5 mezősor, AND/OR/NOT (Playwright scraping)

mek_list_search_fields

Elérhető mező-aliasok és fulltext témakörök

Találati limitek

Keresés

Default

Lapozás

Egyszerű / fulltext

page_size=10 (max 100)

page paraméterrel

Összetett

max_results=50

Nincs — a MEK egy listában adja vissza az összes találatot

Minden válasz tartalmazza a total_hits értéket (teljes találatszám) és a documents szeletet (amit az LLM kap).

Telepítés

python -m venv .venv
.venv\Scripts\activate
pip install -e ".[dev]"
playwright install chromium

Az összetett kereséshez Playwright + Chromium szükséges (headless böngésző scraping a detailed oldalhoz).

Tesztelés

pytest -m "not network"    # offline tesztek
pytest -m network          # élő MEK hálózati tesztek

Cursor MCP konfiguráció

A projekt tartalmazza: .cursor/mcp.json

{
  "mcpServers": {
    "mek": {
      "command": "${workspaceFolder}/.venv/Scripts/python.exe",
      "args": ["-m", "mek_mcp.server"],
      "cwd": "${workspaceFolder}"
    }
  }
}

Előfeltétel: pip install -e ".[dev]" a .venv-ben. Cursorban: Settings → MCP → a mek szerver engedélyezése.

Render deploy (Streamable HTTP)

Docker (ajánlott)

docker build -t mek-mcp .
docker run --rm -p 10000:10000 -e MCP_TRANSPORT=streamable-http -e HOST=0.0.0.0 mek-mcp

Health check: http://localhost:10000/health

MCP végpont: http://localhost:10000/mcp

Render Web Service

  1. Push a repót GitHubra

  2. Render Dashboard → New → Blueprint → válaszd a render.yaml-t
    (vagy New → Web Service → Docker runtime, Dockerfile útvonal)

  3. A PORT változót a Render automatikusan beállítja

Változó

Érték

MCP_TRANSPORT

streamable-http

HOST

0.0.0.0

MEK_PLAYWRIGHT_HEADLESS

true

MEK_SCRAPE_TIMEOUT_MS

90000

Start command (Dockerfile-ből automatikus): python -m mek_mcp.server

Health check: GET /health

MCP végpont (alapértelmezés):

  • Streamable HTTP: https://<service>.onrender.com/mcp

Legacy SSE (opcionális, MCP_TRANSPORT=sse):

  • SSE stream: https://<service>.onrender.com/sse

  • Üzenetek: https://<service>.onrender.com/messages/

A Playwright Chromium a Docker image része (mcr.microsoft.com/playwright/python).

Fejlesztés: űrlap-paraméterek feltárása

python scripts/discover_forms.py --probe

A riport: discovery/output/forms_report.json

Licenc

A MEK tartalmára az OSZK felhasználási feltételei vonatkoznak. Ez a projekt nem hivatalos OSZK/MEK termék.

Available Tools

4 tools
mek_list_search_fieldsA

List available field names for mek_search_advanced and fulltext topic filters.

Inputs: no named parameters.

mek_search_advancedA

Advanced MEK bibliographic search with up to 5 field-specific criteria rows.

Each row is a field + query pair. Rows are combined with AND/OR/NOT operators (operator between rows 1-2, operator2 between 2-3, etc.). MEK returns all hits in one list; max_results only limits how many documents are returned.

Args: query: Search term for row 1. field: Row 1 field alias or raw MEK value (see mek_list_search_fields). field2: Optional row 2 field. query2: Optional row 2 search term. field3, query3: Optional row 3. field4, query4: Optional row 4. field5, query5: Optional row 5. operator: Combine rows 1 and 2: "and", "or", or "not". operator2: Combine rows 2 and 3. operator3: Combine rows 3 and 4. operator4: Combine rows 4 and 5. sort_by: Sort results by "title", "author", "date", or "id". accent_insensitive: Search without Hungarian accents when True. include_processing: Include in-processing documents when True. max_results: Maximum documents returned (MEK has no server-side paging).

Inputs: query (required), field, field2, field3, +14 more.

mek_search_fulltextA

Search inside MEK document full text (HTML and PDF).

Args: query: Words or phrase to find in document bodies. Use quotes for exact phrases. broadtopic: Optional collection filter: "", "science", "technical", "social", "humanities", "reference", or the full Hungarian topic string. page_size: Results per page (10, 50, or 100). page: Page number (1-based).

Inputs: query (required), page, page_size, broadtopic.

mek_search_simpleA

Search MEK bibliographic metadata (simple search).

All provided fields are combined with AND logic. Supports wildcards with *. At least one of creator, title, subject, or mek_id must be provided.

Args: creator: Author, editor, or translator name (e.g. "Ady", "Petőfi"). title: Book title or part of title. subject: Theme, keyword, or topic. mek_id: MEK document ID number. page_size: Results per page (10, 50, or 100). page: Page number (1-based).

Inputs: page, title, mek_id, creator, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: listing search fields, advanced multi-field search, fulltext search, and simple search. There is no overlap in functionality.

    Naming Consistency5/5

    All tools follow a consistent snake_case pattern with the 'mek_' prefix and verb+modifier structure (list, search_advanced, search_fulltext, search_simple), making it predictable.

    Tool Count4/5

    With 4 tools, the set is slightly on the lower end but well-scoped for a search-focused server. Each tool is essential, and the count does not feel excessive or insufficient.

    Completeness3/5

    The tool set covers multiple search modes and field listing, but lacks a direct tool to retrieve a specific document by ID or list all documents, which are notable gaps for a bibliographic library server.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP server for the OpenAlex scholarly database, providing AI agents with tools to search and retrieve academic works, authors, and institutions via natural language queries.
      8
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Enables searching the Hungarian Electronic Library (MEK) for books, authors, subjects, and full-text via MCP tools and REST API, with accent-insensitive fallback and controlled vocabulary browsing.
      5
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      An MCP server that gives AI agents read access to a Zotero library, enabling search, item metadata, collections, tags, notes, and full-text search of attached PDFs.
      MIT