Reference Data Mcp Server

io.github.cyanheads由 GitHub 账号 cyanheads 发布v0.2.0更新于 Oct 29, 2026

Countries, timezones, elements, constants, HTTP status codes, unit conversion, and MIME type lookup.

已验证Streamable HTTP可网页运行开发者工具数据与分析

概览

AI 生成的概览

离线参考数据服务器,提供国家、时区、元素周期表、物理常数、单位换算、HTTP 状态码与 MIME 类型查询。

可以做什么
  • 按名称、ISO 代码、地区、语言或货币查询与筛选国家
  • 按 IANA ID、国家或城市查询时区,并在时区间换算时间(含夏令时偏移)
  • 按符号、原子序数、类别、族或周期查询与筛选元素
  • 按名称、符号或别名查询 CODATA 2022 物理常数
  • 在长度、质量、体积、温度等单位域之间换算数值
  • 按数字、关键词、类型字符串或文件扩展名查询 HTTP 状态码与 MIME 类型
适用场景
适合需要可靠、可引用的参考事实而非网络猜测的场景:国家元数据、跨夏令时的会议时间换算、化学与物理查询、单位计算,以及调试 API 与内容类型时的 HTTP 和 MIME 细节。
运行要求
可使用公开托管的 Streamable HTTP 端点(无需安装),或通过 npx/bunx、Docker 或源码在本地运行。本地运行需 Bun v1.4.0+ 或 Node.js v24+。无需 API 密钥或账号;可选环境变量用于传输方式、HTTP 主机与端口、认证模式和日志级别。
安装前请注意
均为只读查询且不调用外部 API,风险较低。托管端点是第三方公开实例,使用它时查询内容会离开本机;如需本地化可自行部署。自行部署并对外暴露 HTTP 实例前,应检查可选的认证模式(jwt、oauth)与绑定设置。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Reference Data Mcp Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.cyanheads%2Freference-data-mcp-server/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "reference-data": {
      "type": "http",
      "url": "https://reference-data.caseyjhand.com/mcp"
    }
  }
}

README

@cyanheads/reference-data-mcp-server

Look up countries, timezones, periodic table elements, physical constants, units, HTTP status codes, and MIME types via MCP. STDIO or Streamable HTTP.

10 Tools • 3 Reference Resource Families • 1 Agent Skill


Overview

Countries, timezones, periodic table elements, physical constants, units, HTTP status codes, and MIME types in one place. Look up, search, and convert across all of them, entirely offline with no API keys or rate limits.

Tools

ToolDescription
ref_geo_lookupLook up a country by name, ISO alpha-2, or alpha-3 code.
ref_geo_searchSearch and filter countries by region, subregion, language, or currency.
ref_timezone_lookupGet timezone info by IANA ID, country code, or city name.
ref_timezone_convertConvert a local datetime from one timezone to another.
ref_element_lookupLook up a periodic table element by name, symbol, or atomic number.
ref_element_searchFilter periodic table elements by category, group, period, or property range.
ref_constant_lookupLook up a CODATA 2022 physical constant by name, symbol, or alias.
ref_unit_convertConvert a numeric value between compatible units of measure.
ref_http_statusLook up an HTTP status code by number or keyword.
ref_mime_typeLook up a MIME type by type string or file extension.

Resources

ResourceDescription
ref://countries/{alpha2}Full country record by ISO alpha-2 code.
ref://elements/{number}Full element record by atomic number.
ref://timezones/{iana_id}Timezone info by IANA ID (slashes percent-encoded as %2F).
skill://reference-data-guide/SKILL.mdAgent guide for resolving locations and converting meeting times across DST transitions.

The three reference families use four URI template routes: countries, elements, encoded timezone IDs, and an unencoded-timezone-slash route that returns retry guidance. The guide is a separate skill resource.

Reference data is also reachable via tools — use ref_geo_lookup, ref_element_lookup, and ref_timezone_lookup when you need flexible query modes or country search.

The reference-data guide is included in plugin installs and available through MCP resource discovery or the Skills extension (skills/list and skills/get). It covers location resolution, repeated-hour disambiguation, and search-completeness gates.


Capability reference

ref_geo_lookup tool

  • Accepts fuzzy name matching ("Brasil" resolves to "Brazil"); a fuzzy hit adds an enrichment notice naming the canonical result
  • Lookup modes: auto (alpha2 → alpha3 → name), name, alpha2, alpha3; numeric ISO codes are not supported
  • Returns capital, region/subregion, languages, currencies, calling codes, TLD, flag emoji, and IANA timezone IDs

ref_geo_search tool

  • At least one filter required (no_filters error otherwise): keyword (name, native name, capital, subregion), region, subregion, language (ISO 639-1 code or name), or currency (ISO 4217 code or name)
  • Limit 1–100 (default 20); truncated flag and totalMatches count when results are cut off
  • Empty result set returns a notice echoing the applied filters

ref_timezone_lookup tool

  • Lookup modes: auto (IANA ID → country code → city name), iana, country; partial city matching ("Tokyo" → "Asia/Tokyo", "NY" → "America/New_York")
  • Country-code queries return every timezone observed in that country
  • Optional at (ISO 8601) evaluates DST state at a specific moment instead of now; malformed values raise invalid_at
  • Returns current/standard UTC offsets, DST status and abbreviations, major cities, and country codes

ref_timezone_convert tool

  • datetime must be a local ISO 8601 string without an offset (regex-enforced, e.g. 2026-05-24T15:30:00); from_tz/to_tz accept full IANA IDs or unambiguous city names
  • Rejects out-of-range calendar dates and spring-forward DST gaps as invalid_datetime; unrecognized zones as invalid_timezone
  • Returns source and target local datetimes with their respective UTC offsets, plus the UTC equivalent

ref_element_lookup tool

  • Lookup modes: auto (atomic number → symbol → name), name, symbol, number
  • Full property set: atomic mass (atomic_mass_estimated flag), electron configuration, group/period/block, category, Pauling electronegativity, density, melting/boiling points in kelvin, phase at STP, radioactivity, natural occurrence, discovery data
  • Data sourced from PubChem/IUPAC 2024; synthetic or unstable elements return null for experimentally inaccessible properties

ref_element_search tool

  • At least one filter required (no_filters error otherwise): category (partial match), group (1–18), period (1–7), atomic-number range, or atomic-mass range
  • Valid categories: alkali metal, alkaline earth metal, transition metal, post-transition metal, metalloid, reactive nonmetal, noble gas, lanthanide, actinide
  • Returns summaries (atomic number, symbol, name, mass, category) plus a totalMatches count and a notice when nothing matches

ref_constant_lookup tool

  • Fuzzy alias matching: "speed of light", "c", "Avogadro's number", "N_A", "Planck", "h", "Boltzmann", "k_B" all resolve against 32 CODATA 2022 constants
  • match_strategy discriminates how the query resolved: exact_symbol, exact_name, or fuzzy (closest candidate — verify before reuse)
  • Returns value, SI unit expression, absolute/relative uncertainty (exact flag for defined constants), CODATA identifier, and up to 3 related constants

ref_unit_convert tool

  • 11 measurement domains: length, mass, volume, temperature (non-linear C/F/K/R), speed, pressure, energy, power, frequency, digital storage, angle
  • Mass mt is the metric tonne (1000 kg); t is the US short ton (907.18 kg) — distinct units, easily confused
  • Typed errors: incompatible_units (mismatched quantities), unknown_unit (unrecognized abbreviation), below_absolute_zero (with the Kelvin equivalent)

ref_http_status tool

  • Numeric queries (e.g., "404") return an exact match; keyword queries (e.g., "not found", "too many requests") return the closest match plus alternatives
  • Returns reason phrase, description, category (1xx–5xx), cacheability per RFC 9110, and the defining RFC with section reference

ref_mime_type tool

  • Accepts "image/webp", ".webp", or "webp" interchangeably
  • Extension lookups return the canonical MIME type first; additional types sharing the extension are listed as alternatives
  • Returns extensions, a compressibility flag (relevant for Content-Encoding decisions), and the data source (iana/apache/nginx)

ref://countries/{alpha2} resource

  • Full country record as application/json — same fields as ref_geo_lookup
  • alpha2 accepts either case; an unmatched code returns a notFound error

ref://elements/{number} resource

  • Full element record as application/json — same fields as ref_element_lookup
  • number must be an integer string 1–118; out-of-range or unmatched values return notFound

ref://timezones/{iana_id} resource

  • Timezone record as application/json — same fields as ref_timezone_lookup, plus evaluated_at
  • Slashes in the IANA ID must be percent-encoded as %2F (e.g. America%2FNew_York); an unencoded slash matches a separate catch-all that returns an actionable error with the correctly encoded URI

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

Reference-data-specific:

  • Entirely in-memory — all datasets load at startup; no runtime network calls, no API keys, no rate limits
  • Works offline and in air-gapped environments
  • Seven specialized services: geo (countries-list), timezone (Node.js Intl + @vvo/tzdb), elements (PubChem/IUPAC 2024, 118 elements), constants (CODATA 2022, 32 entries), units (convert-units), HTTP status (IANA registry), MIME types (mime-db, ~1,000 types)

Agent-friendly output:

  • Structured error contracts on every tool — typed reason codes (no_match, no_filters, unknown_unit, incompatible_units, below_absolute_zero, invalid_timezone, invalid_datetime, invalid_at) with actionable recovery hints
  • Discriminated outputs where relevant — truncated flag on search results, alternatives arrays on MIME/HTTP keyword matches, atomic_mass_estimated flag on element data, match_strategy on constant lookups
  • Consistent null for genuinely unknown or inapplicable values rather than absent fields

Getting started

Public Hosted Instance

A public instance is available at https://reference-data.caseyjhand.com/mcp — no installation required. It serves Streamable HTTP; each client takes its own config shape.

For Claude Code:

sh
claude mcp add --transport http reference-data-mcp-server https://reference-data.caseyjhand.com/mcp

For Cline (cline_mcp_settings.json):

json
{  "mcpServers": {    "reference-data-mcp-server": {      "type": "streamableHttp",      "url": "https://reference-data.caseyjhand.com/mcp"    }  }}

For Cursor (mcp.json):

json
{  "mcpServers": {    "reference-data-mcp-server": {      "url": "https://reference-data.caseyjhand.com/mcp"    }  }}

Claude Desktop adds remote servers under Settings → Connectors.

Self-Hosted / Local

Add the following to your MCP client configuration file:

json
{  "mcpServers": {    "reference-data-mcp-server": {      "type": "stdio",      "command": "bunx",      "args": ["@cyanheads/reference-data-mcp-server@latest"],      "env": {        "MCP_TRANSPORT_TYPE": "stdio",        "MCP_LOG_LEVEL": "info"      }    }  }}

Or with npx (no Bun required):

json
{  "mcpServers": {    "reference-data-mcp-server": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@cyanheads/reference-data-mcp-server@latest"],      "env": {        "MCP_TRANSPORT_TYPE": "stdio",        "MCP_LOG_LEVEL": "info"      }    }  }}

Or with Docker:

json
{  "mcpServers": {    "reference-data-mcp-server": {      "type": "stdio",      "command": "docker",      "args": [        "run", "-i", "--rm",        "-e", "MCP_TRANSPORT_TYPE=stdio",        "ghcr.io/cyanheads/reference-data-mcp-server:latest"      ]    }  }}

For Streamable HTTP, set the transport and start the server:

sh
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http# Server listens at http://localhost:3010/mcp

Prerequisites

  • Bun v1.4.0 or higher (or Node.js v24+).
  • No API keys required — this server is entirely self-contained.

Installation

  1. Clone the repository:
sh
git clone https://github.com/cyanheads/reference-data-mcp-server.git
  1. Navigate into the directory:
sh
cd reference-data-mcp-server
  1. Install dependencies:
sh
bun install
  1. Configure environment (optional):
sh
cp .env.example .env# edit .env if you want to override transport or logging defaults

Configuration

No API keys are required. All configuration is optional overrides of framework defaults.

VariableDescriptionDefault
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTPort for HTTP server.3010
MCP_HTTP_HOSTHost for HTTP server.127.0.0.1
MCP_SESSION_MODESession mode: stateful, stateless, or auto (schema default auto resolves to stateful).stateless
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (RFC 5424): debug, info, notice, warning, error.info
LOGS_DIRDirectory for log files (Node.js only).<project-root>/logs
OTEL_ENABLEDEnable OpenTelemetry instrumentation (spans, metrics, completion logs).false

See .env.example for the full list of optional overrides.


Running the server

Local development

sh
# One-time buildbun run rebuild
# Run the built serverbun run start:stdio# orbun run start:http
sh
bun run devcheck   # Lint, format, typecheck, securitybun run test       # Vitest test suitebun run lint:mcp   # Validate MCP definitions against spec

Docker

sh
docker build -t reference-data-mcp-server .docker run --rm -p 3010:3010 reference-data-mcp-server

The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/reference-data-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.


Project structure

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools/resources and inits services.
src/data/Static datasets (periodic table, physical constants, HTTP status codes).
src/mcp-server/tools/Tool definitions (*.tool.ts).
src/mcp-server/resources/Resource definitions (*.resource.ts).
src/services/Domain service integrations (geo, timezone, elements, constants, units, http-status, mime).
tests/Unit tests mirroring src/.
docs/Generated docs (tree.md, design.md).
changelog/Per-version changelog files.

Development guide

See CLAUDE.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.state for tenant-scoped storage
  • Register new tools and resources directly in src/index.ts
  • Data integrity: validate raw → normalize to domain type → return output schema; never fabricate missing fields

Contributing

Issues are welcome. Run checks and tests before submitting:

sh
bun run devcheckbun run test

License

Apache-2.0 — see LICENSE for details.

来源:README.md,提交 0b66e49

工具

10

ref_geo_lookup

Country Lookup

Look up a country by name, ISO alpha-2 code (2 letters), or ISO alpha-3 code (3 letters). Returns the full record: capital, region, official languages, currencies, calling codes, TLD, flag emoji, and IANA timezone IDs. Accepts fuzzy name matching — "Brasil" and "Brazil" both resolve.

输入参数byquery必填

ref_timezone_lookup

Timezone Lookup

Get timezone info by IANA ID, country code, or partial city/region name. Returns current UTC offset, standard offset, whether DST is currently active, and major cities in the timezone. When querying by country code (ISO alpha-2), returns all timezones observed in that country. Accepts partial matches — "Tokyo" resolves to "Asia/Tokyo", "NY" resolves to "America/New_York".

输入参数atbyquery必填

ref_timezone_convert

Timezone Conversion

Convert a local datetime from one timezone to another. Takes a local time string (no UTC offset, e.g., "2026-05-24T15:30:00") interpreted as local time in the source timezone, returns the equivalent local time in the target timezone. Shows both UTC offsets so DST transitions are visible. Accepts full IANA IDs (e.g., "Asia/Tokyo") or unambiguous city names (e.g., "Tokyo").

输入参数to_tz必填from_tz必填datetime必填

ref_element_lookup

Element Lookup

Look up a periodic table element by name, chemical symbol, or atomic number. Returns the full data record: atomic number, symbol, name, atomic mass (in unified atomic mass units), electron configuration, group, period, block, category (e.g., "noble gas", "transition metal"), Pauling electronegativity, density (g/cm³), melting and boiling points in kelvin, and discovery year. Properties unavailable for synthetic or insufficiently studied elements are returned as null.

输入参数byquery必填

ref_constant_lookup

Physical Constant Lookup

Look up a fundamental physical constant by name, symbol, or common alias. Returns the CODATA 2022 value, SI unit expression, relative standard uncertainty, and a short description. Recognizes common names and symbols — "speed of light", "c", "Avogadro's number", "N_A", "Planck", "h", "Boltzmann", "k_B" all resolve correctly. Fuzzy matching returns the closest match plus alternatives.

输入参数query必填

ref_unit_convert

Unit Conversion

Convert a numeric value between compatible units of measure. Supports: length (mm, cm, m, km, in, ft, yd, mi), mass (mcg, mg, g, kg, oz, lb, mt = metric tonne / 1000 kg, t = US short ton / 907.18 kg), volume (ml, cl, dl, l, kl, tsp, Tbs, fl-oz, cup, pnt, qt, gal, m3), temperature (C, F, K, R — non-linear conversions handled), speed (m/s, km/h, knot, ft/s), pressure (Pa, kPa, MPa, hPa, bar, torr, psi), energy (J, kJ, Wh, kWh, MWh), power (W, mW, kW, MW, GW), frequency (Hz, kHz, MHz, GHz), digital storage (b, Kb, Mb, Gb, Tb, B, KB, MB, GB, TB), and angle (deg, rad, grad). Incompatible units (e.g., km to kg) return an error identifying the quantity mismatch.

输入参数to必填from必填value必填

ref_http_status

HTTP Status Code Lookup

Look up an HTTP status code by number or keyword. Returns the reason phrase, description, category (1xx Informational, 2xx Success, 3xx Redirection, 4xx Client Error, 5xx Server Error), whether the code is cacheable by default, and the defining RFC with section reference. For keyword queries, returns the closest match plus alternatives.

输入参数query必填

ref_mime_type

MIME Type Lookup

Look up a MIME type by type string or file extension. Accepts "image/webp", ".webp", or "webp". Returns the canonical MIME type, known file extensions, whether the type is compressible (relevant for Content-Encoding decisions), and the data source (iana, apache, nginx). For extension lookups, returns the canonical MIME type — e.g., ".jpg" resolves to "image/jpeg". When multiple types map to an extension, the canonical type is returned first with alternatives listed.

输入参数query必填

版本历史

5
  1. v0.2.0最新Oct 29, 2026
  2. v0.1.18Oct 25, 2026
  3. v0.1.17Oct 9, 2026
  4. v0.1.16Sep 21, 2026
  5. v0.1.15Sep 16, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分