Skip to main content

trthaber-mcp 🇹🇷

mcp-name: io.github.mohammad-abbasi-sh/trthaber-mcp

Unofficial read-only MCP server for trthaber.com (TRT Haber), the Turkish public broadcaster's news site — headlines by category, breaking news (son dakika), full article text, keyword search over the current listings, and the category list.

Built by Mohammad Abbasi as part of the "Turkey MCP factory" (Sepehr-style pipeline). Not affiliated with trthaber.com or TRT.

For AI agents

Add to your MCP client config (stdio):

{
  "mcpServers": {
    "trthaber": {
      "command": "uvx",
      "args": ["trthaber-mcp==0.1.1"]
    }
  }
}

Or run locally: python -m trthaber_mcp.server (needs mcp<2, curl-cffi).

Tools

Tool Description
trthaber_headlines Top headlines in one category — category: "gundem" (default), "turkiye", "dunya", "turk-dunyasi", "ekonomi", "spor", "savunma", "cocuk", "dunya-disi", "kultur-sanat", "yasam", "saglik", "bilim-teknoloji", "egitim", "cevre", "guncel", "trt-arsiv", "interaktif"; limit 1..30 (category pages list 15)
trthaber_latest Breaking news (son dakika), newest first — limit 1..30 (the page lists ~120 articles)
trthaber_get_article Full text of one article — article_url (as returned by the headlines/latest/search tools); returns title, spot, publish/modify dates, description, image, full body
trthaber_search_news Keyword search over current news — scans the homepage, the breaking-news page and all 18 category listings, matching titles and summaries; limit 1..30
trthaber_list_categories The 18 TRT Haber news categories (slug + Turkish display name), for use with trthaber_headlines

Example output (trthaber_get_article / Güney Torid meteor-shower story, 5 Nov 2026):

{"title": "Güney Torid göktaşı yağmuru bu gece nadir görülen ateş topları oluşturacak",
 "spot": "Güney Torid göktaşı yağmurunun en yoğun döneme ulaşmasıyla birlikte …",
 "date_published": "2026-11-05 07:06:00+03:00", "paragraph_count": 9,
 "image": "https://trthaberstatic.cdn.wp.trt.com.tr/resimler/2480000/necef-colu-meteor-yagmuru-aa-2481428.jpg"}

How it works

trthaber.com serves its homepage, category pages (/haber/<category>/), article pages (/haber/<category>/<slug>-<id>.html) and the breaking-news page (/son-dakika-haberleri, ~120 articles, newest first) fully server-rendered — no login, no API key, no session cookies. Category pages carry 15 headline links each in the fixtures. Article pages carry the title in <h1>, the spot in <h2 class="news-spot">, publish/modify dates in an inline JSON blob, description and image in meta tags, and the full body as consecutive <p> elements inside news-detail-container (the run ends at the news-tags block). There is no author byline anywhere on the site, and no NewsArticle JSON-LD (only an Organization block). One site feature does NOT work server-side and is documented, not faked: the site's own search (/arama.html) is JS + CSRF-token POST gated (POST /ajax/getCsrfToken/search/), and a tokenless GET returns a 200 page with an empty results container — so trthaber_search_news scans the current listings instead. Transport uses Chrome TLS impersonation (curl-cffi, chrome120); requests are spaced ~0.8s apart; everything is read-only.

Install

uvx trthaber-mcp==0.1.1        # run directly (needs uv)
# or
pip install trthaber-mcp==0.1.1
trthaber-mcp    # starts the MCP server on stdio

Tests

python -m venv .venv && .venv/bin/pip install -e .
.venv/bin/python -m unittest discover -s tests -v

Offline tests run on recorded fixtures (real pages fetched 2026-11-08); live tests hit trthaber.com. 26/26 green at build time (14 offline + 12 live) plus an MCP stdio smoke test.

Roadmap

  • "Çok okunanlar" (most read) if the site ever exposes it server-side
  • Video/social-video listings (/sosyal-videolar/)
  • Live TV schedule (/canli-yayin-izle.html is a stream page, not data)

License

MIT — see LICENSE.


Built by Mohammad Abbasi — Almanibama · mabbasi.ir

Metadata

Release files for trthaber-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trthaber-mcp 0.1.1
File Size Uploaded Provenance Actions
trthaber_mcp-0.1.1.tar.gz 112.6 kB With provenance Details for trthaber_mcp-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for trthaber-mcp 0.1.1
File Interpreter ABI Platform Actions
trthaber_mcp-0.1.1-py3-none-any.whl Python 3 none any Details for trthaber_mcp-0.1.1-py3-none-any.whl

Total release size: 125.1 kB

Release files / trthaber_mcp-0.1.1.tar.gz

Download URL trthaber_mcp-0.1.1.tar.gz
Size 112.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4684c89909da0101ddd0ea1ff3f8b8b56807db4b8a2f572539112ca309405f40
BLAKE2b-256 checksum
How to use checksums
fc5d1052e4ec2335b4947dd419bd3262685a2ec916de3baac67db3f52f8e465e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / trthaber_mcp-0.1.1-py3-none-any.whl

Download URL trthaber_mcp-0.1.1-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb2599581a64ff83d06238f0edc7810d25a0008492a49e3a12c31bba20be34ba
BLAKE2b-256 checksum
How to use checksums
bf36f658d22c2733ef38f2a6d97ec3ca4b6f12971059e139ac3916b76521b7c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for trthaber-mcp 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for trthaber_mcp-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page