searchloinc
Enables LLMs to search LOINC terms with free-text, relevance-ranked, and faceted queries via the LOINC Search API, mirroring the loinc.org/search experience.
README
SearchLOINC
A thin MCP server wrapping the
LOINC Search API so LLMs can search LOINC the same
way a human does via loinc.org/search — free-text,
relevance-ranked, faceted. It targets the documented Search API
(https://loinc.regenstrief.org/searchapi/), not the FHIR terminology service.
Setup
uv sync --extra dev
cp .env.example .env # then fill in your LOINC credentials
Credentials come from a free registration on loinc.org. Set
LOINC_USERNAME and LOINC_PASSWORD in the environment (never commit them).
Run
From a checkout (development):
uv run python -m searchloinc
Or install it as a standalone command and run it from anywhere:
uv tool install . # puts a `searchloinc` executable on PATH
searchloinc # starts the stdio server
Both run the server over stdio (the transport MCP clients expect). Point your client at
the command, or add it to your client's MCP server config. When you use the installed command,
supply credentials through the client's env block (sourced from your secret store / shell —
never committed):
{
"mcpServers": {
"searchloinc": {
"command": "searchloinc",
"env": {
"LOINC_USERNAME": "your-loinc-username",
"LOINC_PASSWORD": "your-loinc-password"
}
}
}
}
The checked-in .mcp.json uses the dev form (uv run --env-file .env) so a local
checkout picks up credentials from .env automatically.
Tools
Two-tier design — cheap compact search for triage, explicit drill-in for detail:
search_loincs— LOINC terms (lab tests, vitals, measurements, panels, surveys). The main table.search_answerlists— enumerated answer sets attached to survey/nominal terms.search_parts— the LP-coded building blocks (components, systems, methods, properties).search_groups— curated collections of related terms.get_loinc(code)— drill into one term by exact code; returns the full flat record.
Each search tool takes query (required), rows, offset, sortorder, language, and
include_facets. Pick the scope that matches what you're after; results are
relevance-ranked, so if the top hits miss, reformulate rather than deep-page. Triage with
a search tool, then get_loinc the code you want.
Output shape
Search responses are a JSON envelope plus a result table:
- The table is serialized as TOON — a compact tabular
format that pays the column-name cost once, so wide uniform tables stay small. Columns are
fixed per scope; empty fields render as
""to preserve row uniformity. Tab-delimited (LOINC display values contain commas but never tabs). - The envelope reports
requested,returned,total,offset, andtruncated.
Character budget & pagination. The whole serialized payload is capped at 9500 characters
(a cushion under the ~10K downstream tool-result limit). The row-packing loop encodes and
measures the full payload incrementally and stops before the cap; when results don't all fit,
truncated is true — page forward with offset. include_facets (filter counts) is off by
default and opt-in; facet payloads still respect the budget.
get_loinc returns a single JSON object — the flat search-API record with null/empty fields
dropped (always keeping Link), so the field set adapts to the term type. Page-only content
(part LP hierarchy, language variants, curated part descriptions) is not in the flat
record — follow Link to loinc.org for it.
There is a debug-only raw-JSON path toggled by the SEARCHLOINC_RAW_JSON env var; it is never
exposed as an agent-facing tool parameter.
Development
uv run ruff check searchloinc # lint
uv run pytest # tests (no network; API stubbed with fixtures)
The /loinc-search skill drives the live API to
validate wrapper output against ground truth.
Status
Wrapper is implemented and validated against the live API. Eventual deployment target is a Databricks app (credentials via secret scope, inference via AI Gateway).
License & attribution
The SearchLOINC code is licensed under the MIT License.
This project wraps the LOINC Search API and includes sample LOINC API responses as test fixtures. That LOINC (and referenced SNOMED CT) content is not covered by the MIT license and remains under its own terms — see NOTICE for the required attributions.
This material contains content from LOINC (http://loinc.org). LOINC is copyright © Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee and is available at no cost under the license at http://loinc.org/license. LOINC® is a registered United States trademark of Regenstrief Institute, Inc.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。