Skip to main content

A Model Context Protocol server for the Hungarian Science Bibliography (MTMT).

Project description

MTMT-MCP

A simple Model Context Protocol (MCP) server for the Hungarian Science Bibliography (MTMT), built with Python and FastMCP.

MTMT-MCP lets MCP clients search the public MTMT catalogue and retrieve bibliographic records, authors, journals, institutions, conferences, grants, and publishers. It is read-only and does not require MTMT credentials for public records.

[!IMPORTANT] This is an independent community project. It is not affiliated with or endorsed by MTMT.

Features

  • Search publications by title, author, journal, external identifier, year, university, and department.
  • Resolve universities and organizational units to stable MTMT institution IDs.
  • Resolve author profiles before listing a specific researcher's publications.
  • Retrieve MTMT's official author summary metrics and both h-index variants.
  • Fetch one publication or batch-fetch up to 20 known MTMT IDs.
  • Traverse explicit incoming and outgoing MTMT citation links.
  • Run advanced searches using native MTMT conditions.
  • Retrieve public records by MTMT ID.
  • Control response size with MTMT field selection.
  • Use English or Hungarian response labels.
  • Connect over MCP's standard input/output transport.

Requirements

  • Python 3.11 or newer
  • An MCP-compatible client

Installation

Clone the repository and install it in a virtual environment:

git clone https://github.com/attilaimre99/MTMT-MCP.git
cd MTMT-MCP
python -m venv .venv

On Linux or macOS:

source .venv/bin/activate
pip install -e .

On Windows PowerShell:

.venv\Scripts\Activate.ps1
pip install -e .

Run the server:

mtmt-mcp

You can also run it without installing the command-line entry point:

python -m mtmt_mcp.server

Expose the server through ngrok

The commands above use MCP's local stdio transport. To connect from a remote MCP client, start FastMCP's HTTP transport and expose its port through ngrok.

In the first terminal, start the HTTP server on port 8000:

uv run python -c 'from mtmt_mcp.server import mcp; mcp.run(transport="http", host="127.0.0.1", port=8000)'

If the project environment is already activated, python can be used instead of uv run python. The server should report that it is listening at http://127.0.0.1:8000/mcp.

In a second terminal, start the tunnel. Use a reserved ngrok domain when one is available:

ngrok http --url=applied-tile-such.ngrok-free.dev 8000

Without a reserved domain, let ngrok assign a temporary URL:

ngrok http 8000

Configure the remote MCP client with the public URL shown by ngrok and append /mcp:

https://applied-tile-such.ngrok-free.dev/mcp

Both terminal processes must remain running. Restarting a tunnel without a reserved domain usually changes its public URL.

[!WARNING] An ngrok URL exposes the MCP server to the internet. This project is read-only, but the HTTP endpoint does not add authentication. Use an authenticated gateway or equivalent access control before sharing the URL or running a long-lived deployment.

MCP client configuration

Add the server to an MCP client configuration. Replace /absolute/path/to/MTMT-MCP with the local repository path.

{
  "mcpServers": {
    "mtmt": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/MTMT-MCP",
        "run",
        "mtmt-mcp"
      ]
    }
  }
}

If uv is not installed, point the client directly at the virtual environment's Python:

{
  "mcpServers": {
    "mtmt": {
      "command": "/absolute/path/to/MTMT-MCP/.venv/bin/python",
      "args": ["-m", "mtmt_mcp.server"]
    }
  }
}

On Windows, the command path ends in .venv\\Scripts\\python.exe.

Available tools

search_publications

Search publications by any combination of title, author name, earliest year, and latest year, journal, exact external identifier such as a DOI or ISBN, university MTMT ID, or department MTMT ID. This is the primary tool for literature discovery. It returns compact metadata, recorded institutional affiliations, and paging information; an agent can request abstracts only when needed.

Example request:

Find MTMT publications with "machine learning" in the title, published since 2022.

search_institutes

Resolve a university, faculty, clinic, institute, department, or research-unit name to a stable MTMT institution ID before filtering publications. Results include organizational type, immediate parents, child count, active dates, and names in both Hungarian and English.

For reliable department filtering, use a two-step workflow:

  1. Resolve the university and retain its MTMT ID.
  2. Resolve the department with within_university_mtid set to that university ID.
  3. Pass the selected IDs as university_mtid and department_mtid to search_publications.

University and department filters are hierarchy-aware: they include publications assigned to the selected organization or any organizational unit below it in MTMT. MTMT affiliation coverage depends on the institutions recorded on each authorship.

get_publication and get_publications

Retrieve detailed metadata for one known publication, or batch-fetch up to 20 MTMT IDs. The results include authorships, identifiers, publication type, journal or publisher, open-access metadata, and citation counts. Abstracts are optional to keep agent context manageable. The batch tool reports individual failures without discarding successful records.

search_authors and get_author_publications

First resolve a researcher's name to a stable MTMT author ID, then list publications linked to that exact profile. This workflow is preferable to name-only publication searches when authors have common names or several name variants.

get_author_metrics

Read the public MTMT "összesítő táblázat" for an identified author. The result includes the independent-citation and all-citation Hirsch indices, core scientific and overall publication/citation totals, selected author-profile counts, and an optional category breakdown. These are MTMT metrics—not estimates calculated from a capped search result. MTMT's table notes state that the h-index is based on all scientific publications and excludes citing dissertations and records classified as other publication types.

get_publication_connections

Return publications recorded by MTMT as citing a source (cited_by) or publications referenced from an MTMT citation record (references). Citation coverage depends on MTMT's curated records; this tool is not a semantic similarity search.

search_mtmt

Search any supported record collection using native MTMT query conditions. A condition has the form field;operator;value. Conditions can be combined with AND or OR.

resource_type: publication
conditions:
  - title;any;machine learning
  - publishedYear;ge;2022
sort:
  - publishedYear,desc
size: 10

Page numbers are one-based: use page: 1 for the first page.

Common operators include eq, ne, any, prefix, gt, ge, lt, le, in, isnull, and notnull. The fields and valid operators depend on the record type.

Supported collections are publication, author, journal, institute, conference, funding, and publisher.

get_mtmt_record

Retrieve one public record by its resource type and MTMT ID. Use include_fields to keep large records focused, for example:

resource_type: publication
mtid: 12345678
include_fields: title,publishedYear,authorships:1,identifiers

Configuration

The defaults work with the public MTMT service. These optional environment variables are available for development or self-hosted gateways:

Variable Default Purpose
MTMT_API_BASE_URL https://m2.mtmt.hu/api MTMT API base URL
MTMT_TIMEOUT 30 HTTP timeout in seconds

MTMT API documentation

The official MTMT2 API documentation is available here:

MTMT2 API documentation (PDF)

MTMT also publishes the current list of query operators at m2.mtmt.hu/api-docs/query-ops.

The upstream API uses application/vnd.mtmt2-1.0+json, returns records inside a content property, and includes paging metadata for collection searches. MTMT may cap the total accessible result set; use narrow conditions and pagination for reliable calls.

Development

Install the development dependencies and run the checks:

pip install -e ".[dev]"
ruff check .
pytest

Pull requests and pushes to main run Ruff, the test suite on Python 3.11 through 3.13, and a package build. The release workflow runs when a GitHub release is published. It requires a v<project-version> tag, attaches the wheel and source distribution to the GitHub release, and publishes them to PyPI through trusted publishing.

Before the first release, create a pypi GitHub environment and configure a PyPI trusted publisher for this repository, the release.yml workflow, and that environment. Keep the versions in pyproject.toml and src/mtmt_mcp/__init__.py synchronized.

License

Licensed under the Apache License 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mtmt_mcp-0.1.0.tar.gz (106.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mtmt_mcp-0.1.0-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file mtmt_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: mtmt_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 106.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mtmt_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f2212f0239849c4a1c1b93edd0c27a3eb0bd52768fe0c2b9873791e6bcc8e208
MD5 98e0a17d429872eeacb993efeafa59f1
BLAKE2b-256 f0335cf10ba7cf702d50eac890f876346732bd84e1203c22d0413cbdb247d613

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtmt_mcp-0.1.0.tar.gz:

Publisher: release.yml on attilaimre99/MTMT-MCP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtmt_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mtmt_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mtmt_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7feb3bcbc1ab0a871613cc7138d2ba83baf8f6e5081cb6f2b93c05baee0f619
MD5 dab9622d9021b547e3def021e899618e
BLAKE2b-256 517be6b8eb1878f7b91a817efb862dcbbd47419e1c77fb12a17f14936954a31e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtmt_mcp-0.1.0-py3-none-any.whl:

Publisher: release.yml on attilaimre99/MTMT-MCP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page