Skip to main content
Glama
w-metcalfe

Canada Travel Advisory MCP Server

by w-metcalfe

加拿大旅行建议 MCP 服务器

一个为加拿大政府旅行建议服务的 MCP 服务器,由加拿大全球事务部(Global Affairs Canada)的 230 个目的地的开放数据索引支持。

轻量化设计:单个 index.js 文件,一个依赖项(@modelcontextprotocol/sdk),无需构建步骤,无需 TypeScript 编译,无需 HTTP 库。

安装

npm install

需要 Node.js 18+(使用内置的 fetch)。

Related MCP server: Travel Assistant MCP

设置

无需 API 密钥——数据集是公开且无需认证的。以下所有客户端都运行相同的 stdio 命令:node <path-to>/index.js。

如果项目位于其他位置,请替换为你自己的绝对路径。

Claude Code

claude mcp add canada-travel-advisory -- node E:/Claude/mcp-servers/canada-travel-advisory/index.js

添加 --scope user 可使其在所有项目中可用,而不仅仅是当前项目。

Claude Desktop

在 claude_desktop_config.json 中(设置 → 开发者 → 编辑配置):

{
  "mcpServers": {
    "canada-travel-advisory": {
      "command": "node",
      "args": ["E:/Claude/mcp-servers/canada-travel-advisory/index.js"]
    }
  }
}

保存后重新启动 Claude Desktop。

Codex CLI

codex mcp add canada-travel-advisory -- node E:/Claude/mcp-servers/canada-travel-advisory/index.js

或者直接编辑 ~/.codex/config.toml(使用项目根目录下的 .codex/config.toml 可将其范围限定在一个受信任的项目中):

[mcp_servers.canada-travel-advisory]
command = "node"
args = ["E:/Claude/mcp-servers/canada-travel-advisory/index.js"]

使用 codex mcp list 验证。

Cursor

在项目根目录下创建 .cursor/mcp.json,或创建 ~/.cursor/mcp.json 以全局启用:

{
  "mcpServers": {
    "canada-travel-advisory": {
      "command": "node",
      "args": ["E:/Claude/mcp-servers/canada-travel-advisory/index.js"]
    }
  }
}

然后该服务器会出现在设置 → MCP 下,必须在此处打开开关。

Windows 路径说明

上述正斜杠在 Windows 上运行良好。如果你在 JSON 配置中更喜欢反斜杠,请转义它们:"E:\\Claude\\mcp-servers\\canada-travel-advisory\\index.js"。

工具

工具

用途

get_travel_advisory

获取一个目的地的建议。接受名称(英文或法文)、ISO 代码(如 JP)或短横线分隔的标识符(如 costa-rica)。如果输入有歧义,则返回候选列表。

list_travel_advisories

按 risk_level、min_risk_level、has_regional_advisory 过滤和浏览所有目的地;按 name / risk / updated 排序;通过 limit + offset 分页。

get_recent_updates

最近变更过的建议,最新的排在最前面。可按 days 和 update_type 过滤。

search_countries

跨名称、ISO 代码和短横线分隔的标识符进行部分匹配搜索。

compare_advisories

同时比较多个目的地,按风险从高到低排序。

get_advisory_statistics

数据集概览:各风险等级的数量、区域建议数量、变更类型细分、数据新鲜度。

所有工具都接受 language 参数(默认为 "en",或 "fr"),它会将名称、建议文本和目的地链接在 travel.gc.ca 和 voyage.gc.ca 之间切换。

风险等级

等级

含义

0

采取正常安全预防措施

1

高度谨慎

2

避免非必要旅行

3

避免所有旅行

min_risk_level: 2 会列出加拿大建议不要前往的所有目的地。过滤器也接受标签文本(例如 risk_level: "avoid all travel")。

此工具能回答的示例问题

  • “去秘鲁的旅行建议是什么?”

  • “我现在应该避免前往哪些国家旅行?”

  • “上周有哪些建议发生了变化?”

  • “比较一下日本、马里和法国,为旅行做准备。”

  • “有多少目的地有区域建议?”

数据源和行为说明

数据来源:https://data.international.gc.ca/travel-voyage/index-alpha-eng.json

  • 只获取一个端点,而非两个。 发布的 index-updated.json 与 index-alpha-eng.json 字节完全相同(已验证:MD5 一致,字母键顺序相同),并且实际上并非按最新程度排序。因此,get_recent_updates 在本地对 date-published.timestamp 进行排序,这是可靠的,无论上游文件碰巧是什么顺序。

  • 一次获取服务两种语言。 尽管有 -eng 后缀,但每条记录都嵌入了 eng 和 fra 块;-fra 文件仅在键顺序上有所不同。

  • 缓存:响应在内存中缓存 60 分钟(数据集大约每小时重新生成一次),并通过条件性的 If-None-Match / If-Modified-Since 请求进行刷新。如果刷新失败,则提供最后的好数据并附带 stale: true,而不是报错。

  • 仅限摘要数据。 数据集包含风险等级、建议文本、更新日期和变更摘要。完整的建议详情(安全和安保、入境要求、健康、区域细分)仅以 HTML 形式存在,因此每个结果都包含目的地 url 以供阅读。

每个响应还包含 data_generated(上游生成时间)和一条来源归属行,以便对答案进行日期标注。

许可

MIT。建议数据 © 加拿大政府,依据 开放政府许可 – 加拿大 使用。

Available Tools

6 tools
compare_advisoriesB

Compare travel advisories for several destinations at once, ranked from highest to lowest risk. Useful for planning a multi-country trip.

ParametersJSON Schema
NameRequiredDescriptionDefault
languageNoLanguage for names and advisory text. Defaults to 'en'.
countriesYesCountry names, ISO codes, or slugs to compare.

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavioral traits. It only mentions that the output is 'ranked from highest to lowest risk', but does not disclose whether the operation is read-only, any authentication requirements, rate limits, or likely output structure. This is minimal behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences long, front-loaded with the primary action, and every word adds value. No fluff or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of output schema and annotations, the description is insufficient. It does not explain what the output looks like (e.g., list of advisory objects, risk levels, country names), nor does it mention error handling, limits, or performance considerations. For a comparison tool, the output format is critical context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with both parameters already described. The description adds no additional meaning to the parameters beyond stating that the tool accepts 'several destinations' (countries parameter) and that results are ranked. This is a baseline score given the schema already does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: comparing travel advisories for multiple destinations and ranking them by risk. It distinguishes from siblings like get_travel_advisory (single country) and list_travel_advisories (all advisories, not sorted). However, it does not explicitly call out these alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a usage hint ('Useful for planning a multi-country trip') but does not explicitly state when to use this tool instead of alternatives, nor does it mention any exclusion criteria or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_advisory_statisticsA

Overview of the whole advisory dataset: how many destinations sit at each risk level, how many carry regional advisories, a breakdown of recent change types, and when the data was generated.

ParametersJSON Schema
NameRequiredDescriptionDefault
languageNoLanguage for names and advisory text. Defaults to 'en'.

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description bears full burden for behavioral disclosure. It only describes the output contents, not side effects, performance, or operational constraints such as read-only nature or data freshness.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence with a colon-led list. It is front-loaded with the overall purpose and every clause adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one optional parameter and no output schema, the description covers the key output elements adequately. It could mention data freshness or caching, but is sufficient for an agent to understand what statistics are returned.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the description adds no extra meaning to the single 'language' parameter. Baseline score of 3 is appropriate as the schema already fully describes it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool provides an overview of the advisory dataset with specific metrics (risk levels, regional advisories, change types, timestamp). This distinguishes it from sibling tools that handle individual advisory retrieval, listing, or searching.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for obtaining aggregate statistics but does not explicitly state when to use it over alternatives like get_travel_advisory or list_travel_advisories. No when-not-to-use or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_recent_updatesA

Get advisories updated most recently, newest first. Use this for 'what changed this week' questions. Optionally restrict to a change type such as 'Regional advisory added' or 'National advisory decreased'.

ParametersJSON Schema
NameRequiredDescriptionDefault
daysNoOnly include advisories updated within this many days (default 7).
limitNoMax results (default 25).
languageNoLanguage for names and advisory text. Defaults to 'en'.
update_typeNoRestrict to a single type of change.

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description must do all the work. It clearly states the ordering (newest first), optional time window (days parameter), type restriction (update_type), and default behaviors. It doesn't explicitly state if this is a read-only operation, but the verb 'Get' strongly implies it, and nothing suggests side effects. A small gap is not mentioning pagination or what happens with empty results.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, zero fluff. The purpose is front-loaded in the first sentence, usage guidance in the second, and optional parameter usage in the third. Every sentence earns its place without repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no output schema and moderate complexity (4 params, 2 enums), the description is fully self-contained. Agents can understand what the tool does, when to use it, and how to use the parameters. The absence of output schema is compensated by the clear behavior description (list of recent advisories).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema already covers all 4 parameters with descriptions (100% coverage), so baseline is 3. The description adds value by explaining the purpose of the date filter and the update_type restriction with concrete examples like 'Regional advisory added', which goes beyond the schema's terse description. However, it doesn't add context for limit or language beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool gets the most recently updated advisories, ordered newest first. It clearly distinguishes itself from siblings like get_travel_advisory (single advisory) and list_travel_advisories (likely a listing without update recency) by focusing on recency and change tracking.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description directly says 'Use this for "what changed this week" questions', providing a concrete usage scenario. It also explains optional restriction by update_type, giving agents clear guidance on when to apply that parameter.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_travel_advisoryA

Get the current Government of Canada travel advisory for a single country. Accepts a country name (English or French), an ISO code, or a URL slug. Returns the risk level, advisory text, when it was last updated, what changed, and a link to the full advisory page.

ParametersJSON Schema
NameRequiredDescriptionDefault
countryYesCountry name, ISO code (e.g. 'JP'), or slug (e.g. 'costa-rica').
languageNoLanguage for names and advisory text. Defaults to 'en'.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations are absent so description carries full burden. It describes the ouput (risk level, text, updates, link) and implies a read only operation. However, it does not mention errr handling or what happens if the country is not found, which slightly limits transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front loaded with purpose and input format, then output details. No verbose or redundant content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, description adequately lists output fields. It covers input variations and output, but lacks detail on default language behavior and error cases, leaving minor gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds value by explaining that country acccepts English/French names, ISO codes, and slugs. This reinforces and clarifies the schema description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool gets a single travel advisory from the Government of Canada. It specifies the verb 'get' and the resource 'travel advisory', and differentiates from siblings like list_travel_advisories which imply multiple advisories.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While the description implies use for single countries, it does not explicitly state when to use this versus other tools like list_travel_advisories or get_recent_updates. No when not guidance is provided, making it reliant on agent inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_travel_advisoriesA

List and filter travel advisories across all 230 destinations. Use min_risk_level: 2 to find everywhere Canada advises against travel. Sort by name, risk, or most recently updated.

ParametersJSON Schema
NameRequiredDescriptionDefault
sortNoSort order. 'risk' and 'updated' are descending. Defaults to 'name'.
limitNoMax results (default 50).
offsetNoResults to skip, for paging (default 0).
languageNoLanguage for names and advisory text. Defaults to 'en'.
risk_levelNoExact risk level: 0 (normal precautions), 1 (high degree of caution), 2 (avoid non-essential travel), 3 (avoid all travel). Also accepts the label text.
min_risk_levelNoMinimum risk level (inclusive). Use 2 for all 'avoid travel' advisories.
has_regional_advisoryNoOnly countries that do (true) or do not (false) carry regional advisories.

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the scope (all 230 countries), sorting behavior ('risk' and 'updated' are descending), and the risk_level parameter's semantics with labels. However, it does not mention rate limits, authentication needs, or whether this operation is read-only (which is reasonable given the apparent read nature, but transparency could be higher).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise at three sentences, each providing useful information: purpose, example usage, and sorting options. The structure flows logically from what the tool does, to how to use it, to sorting options. However, the sorting example could be integrated into the purpose to reduce redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 7 parameters with 100% schema coverage but no output schema, the description provides enough context for an AI agent to understand what it does and how to use it. The naming and example usage help the agent select it over siblings. However, it does not describe the output format, which could be critical for proper usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents all 7 parameters in detail. The description adds value by explicitly explaining the behavior of sort (descending for 'risk' and 'updated'), providing a concrete example for min_risk_level (value 2), and clarifying risk_level's dual acceptance of numeric and label text. However, the description does not significantly enhance understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists and filters travel advisories across all 230 destinations, specifying the resource (travel advisories) and action (list and filter). It distinguishes itself from siblings like 'get_travel_advisory' (which likely returns a single advisory) and 'search_countries' (which likely returns countries, not advisories).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear guidance on when to use this tool, including a concrete example ('Use min_risk_level: 2 to find everywhere Canada advises against travel'). It implies when to use alternatives like 'get_travel_advisory' for a single destination but does not explicitly state when not to use it or list alternative tools for specific purposes.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_countriesA

Search destinations by partial name, ISO code, or slug. Use this to discover or disambiguate a destination before calling get_travel_advisory.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMax results (default 25).
queryYesPartial name or code, e.g. 'congo' or 'saint'.
languageNoLanguage for names and advisory text. Defaults to 'en'.

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It only states the search criteria (partial name, ISO code, slug) but does not mention whether results are approximate, case‑sensitive, or what happens when no match is found. The return format (e.g., list of countries with identifiers) is also omitted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no wasted words. The first sentence states the core action, and the second immediately provides usage context. Perfectly front‑loaded and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers purpose and usage context well, but with no output schema, it should describe what the tool returns (e.g., a list of countries with names, codes, slugs). It also lacks details about behavior like default limit, language effect on output, or result field semantics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description confirms that the query parameter accepts partial names or codes and gives examples in the schema, but it adds little extra semantics beyond what the schema already documents.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches destinations by partial name, ISO code, or slug, and explicitly positions it as a discovery/disambiguation step before calling get_travel_advisory. This distinguishes it from sibling tools and provides a specific verb+resource.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly advises using this tool to discover or disambiguate a destination before calling get_travel_advisory. This is strong contextual guidance, though it does not mention when not to use it or alternative tools like list_travel_advisories.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv1.0.0
    • First observedcompare_advisories
    • First observedget_advisory_statistics
    • First observedget_recent_updates
    • First observedget_travel_advisory
    • First observedlist_travel_advisories
    • First observedsearch_countries

TDQS

A4/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a distinct purpose: single-country lookup, list/filter across all, recent changes, search/disambiguation, comparison, and statistics. No two tools overlap in function; an agent can clearly choose based on need.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (get_, list_, get_recent_, search_, compare_, get_). This predictability helps an agent understand the action and target without ambiguity.

Tool Count5/5

Six tools is ideal for the scope: covering single query, list, recent updates, search, comparison, and statistics. Each tool serves a distinct and necessary use case without redundancy or unnecessary bloat.

Completeness5/5

The tool surface covers all common travel advisory workflows: lookup, filtering, discovering recent changes, searching/disambiguation, multi-country comparison, and aggregate statistics. No obvious gaps—users can answer questions about specific countries, broad trends, or comparisons.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers