Skip to main content
Glama

Tainan Mental Health Resources MCP

Turns the mental health resources buried under a dozen levels of menus on the Tainan City Health Bureau website into something you can look up with a single sentence.

你說:我們機構在哪幾份官方名單上?
它做:查四個來源 → 寬欣心理治療所 + 芯寬欣,兩個據點都在,
      而且你們在「免費諮商合作名單」裡,每週一至五 8:00-21:00

Why this exists

This data is all manually searchable. The problem is that the URLs look like this:

https://health.tainan.gov.tw/page.asp?mainid=0A3943E7-033E-4686-8514-7BD39368D32D

No semantics, just a string of GUIDs. You can't guess them; you can only click through layer by layer from the homepage.

So the value of this project isn't in "fetching data" — it's in automating cross-source cross-referencing:

  • Which entries do the three official lists miss from each other?

  • Which community mental health center does a given district actually belong to?

  • Which weekdays do the free counseling slots cluster on, and which days are effectively empty?

Doing this by hand takes half a day, and you have to redo it all next month when the data changes.


Related MCP server: Taiwan Government Open Data MCP Server

Install in five minutes

git clone https://github.com/scatjay/kxmind-tainan-mental-mcp.git
cd kxmind-tainan-mental-mcp
pip install -r requirements.txt

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "tainan-mental": {
      "command": "python",
      "args": ["C:/你的路徑/kxmind-tainan-mental-mcp/server.py"]
    }
  }
}

Restart Claude, then say "run ping". Seeing the record count means it's connected.

No account to register, no key to apply for. The repo already includes a data snapshot.


Nine tools

Read layer

Tool

What it does

ping

Confirms the connection and shows how fresh the snapshot is

find_myself

Finds which lists a given organization appears on

list_clinics

Lists treatment centers / counseling centers / psychiatric clinics, filterable by district and type

find_free_counseling

Finds free counseling, filterable by district and weekday

which_center

Which community mental health center covers this district

list_datasets

Which sources are connected and when they were fetched

Analysis layer — this layer is the real point

Tool

How long it takes by hand

diff_clinic_sources

40–60 minutes (3 tabs, 80 rows typed into Excel, name normalization, two VLOOKUPs)

free_slots_by_weekday

50+ minutes (reading the time-slot text of 58 entries one by one, classifying manually, then grouping by district)

count_by_layer

Nobody would normally do this — because you'd open 5 sources, find the numbers don't match, and give up


Three live demos that actually run

1. find_myself("寬欣") — look yourself up

「寬欣」出現在 6 個地方:
  【地圖/心理治療、諮商所】寬欣心理治療所    北區育德一街227號1、2樓  (06)2510966
  【地圖/心理治療、諮商所】芯寬欣心理治療所  北區北安路一段273號      (06)2510560
  【免費諮商合作名單】      寬欣心理治療所    週一 每週一至五 8:00-21:00
  【衛生局名冊】…

2. diff_clinic_sources() — which entries the three official lists miss from each other

衛生局名冊 32 家 / 資源地圖 26 家 / 兩邊都有 24 家

只在名冊、地圖沒有(8 家)
   誼仁、欣空間、欣橋、星語、愛相會、好心情、山實、沐盼

只在地圖、名冊沒有(2 家)
   心物語、李慧芳

This isn't a one-way omission; the two official documents don't know about each other.

3. which_center("永康區") — the question nobody can guess right

永康區 → 善化區社區心理衛生中心   (06)581-0105

It's not Yongkang itself. The service areas of the 6 centers add up to exactly 37 districts, with no overlap and no gaps, so the answer is findable for any district, and the demo won't fall flat.


🔴 On-site discipline: read the snapshot by default, don't have the whole class hit government websites at once

data/ contains a snapshot fetched on 2026-08-27, with fetch timestamps attached. All tools read it by default.

Reason: a workshop with a dozen people, the same IP, at the same time. Hitting government websites together risks triggering rate limits, and the venue WiFi quality is usually unknown.

To update the data:

python fetch_snapshot.py

Or call refresh_snapshot()but on-site, only the instructor demonstrates it once; everyone else reads the snapshot.


Data sources

All public data, no permission needed to apply for anything. Every record was independently adversarially verified on 2026-08-27 (100 passed, 22 were removed for dead URLs or mismatched content).

Source

Content

Tainan City Mental Health Resource Map

KML, 141 markers, 4 layers

Counseling Center and Psychotherapy Center Registry

12 treatment centers + 20 counseling centers

Free Counseling – Public Sector Locations

40 locations

Free Counseling – Locations Requiring Venue Fees

22 private organizations

Community Mental Health Center Locations

6 centers, covering 37 districts

Free Counseling Locations CSVDistrict Codes CSV

43 records / 37 districts


Data quality: these pitfalls are written into the code

Things I hit while writing this, all left in the comments:

  • All 58 free-counseling records have the same <name> string — "預約免費心理諮商" (Reserve Free Psychological Counseling). The actual location is in the "諮商地點" (counseling location) field of ExtendedData. Reading name directly gives you 58 identical points.

  • The CSV has a double BOM (EF BB BF EF BB BF). utf-8-sig only strips one layer, leaving an invisible character in the first column name.

  • The mental health centers' service areas: in the first version I regex-scraped all "XX區" within 900 characters of the center name, which turned Shanhua Center into 26 districts and mixed in fakes like "服務區" (service area), "願景園區" (vision park), and "社區" (community). The queries happened to be right — but a tool that's right by accident can't be used to teach. I switched to reading the 服務區域: (service area:) line, and now the 6 centers add up to exactly 37 districts.

  • Organization names need normalization before they can be compared: 台南 vs 臺南, with or without the "社團法人" (incorporated association) prefix.


⚠️ Usage notes

  • The data here is a snapshot of public information, not a real-time system. It's recommended to call and confirm before making referrals.

  • There is no single answer to "how many psychiatric institutions does Tainan have" — count_by_layer() will tell you why, and only 7 "designated institutions" can admit patients for involuntary treatment, not 41.

  • This tool does not process any case data. It queries organizations, not people.

License

MIT. Data copyright belongs to the Tainan City Government Health Bureau and the Tainan City Government Open Data Platform.

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables natural language exploration and advanced analysis of VitalDB medical datasets. Supports statistical filtering, correlation analysis, group comparisons, anomaly detection, and comprehensive visualization of physiological signals and patient data.
    1
  • A
    license
    Not graded
    quality
    D
    maintenance
    Integrates Taiwan-specific medical data including ICD-10 codes, FDA drug databases, and nutrition information into the Model Context Protocol. It enables AI models to query clinical guidelines, verify medical codes, and convert health data into FHIR R4 standardized formats.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    An open-source MCP server that aggregates Taiwan public data sources (data.gov.tw, TWSE, MOEA, CWA, etc.) and exposes them through the Model Context Protocol, enabling AI agents to query Taiwan data with a single configuration line.
    1
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • French public-data MCP: cross-ref health, demographics, business, geo & real-estate.

  • Citation-guarded retrieval over 22M Taiwan court judgments and administrative interpretations

  • The statistical analyst in your AI chat — validated, citable, re-runnable analysis of your data.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/scatjay/kxmind-tainan-mental-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server