Skip to main content
Glama
liam-edmunds

enable-nz-mcp

by liam-edmunds

enable-nz-mcp

一个公开托管的 MCP 服务器,将 enable.co.nz 的内容以可搜索工具的形式暴露出来,可从 Copilot Studio、VS Code Copilot、Claude Desktop 或任何 MCP 客户端连接。

这是一个个人作品集项目。它与 Enable New Zealand 或任何雇主无关,并且只读取公共网站上的公开内容。

  • 服务器:https://enable-nz-mcp.duckdns.org/mcp(Streamable HTTP)

  • 健康检查:https://enable-nz-mcp.duckdns.org/health


架构

GitHub Actions (weekly cron)
  └─ crawl enable.co.nz → build index.db.new
     └─ rsync over SSH → droplet:/opt/enable-nz-mcp/data/index.db.new
        └─ atomic mv → index.db

DigitalOcean droplet (Ubuntu 24.04, Sydney)
  ├─ Caddy  → TLS termination + reverse proxy on enable-nz-mcp.duckdns.org
  └─ pm2    → node dist/server.js  (port 8081, localhost only)
                └─ opens a fresh SQLite read connection per query

服务器从不将索引缓存在内存中——每次工具调用都会对磁盘上的 index.db 打开一个新的只读连接。每周一次的爬取会重建索引,并通过一次原子性的 mv 将其替换,因此索引刷新零停机、无需重启。

每个方向都是只读的:爬虫只读取 enable.co.nz,MCP 工具只读取本地 SQLite 索引。不进行任何写操作。


Related MCP server: MCP Knowledge Base Server

工具

search_enable_nz

对 enable.co.nz 进行全文搜索。

参数

类型

必填

说明

query

string

搜索词

limit

integer

默认 5,最大 20

section

string

限制在某个板块内,例如 services

返回按相关性排序的匹配页面,每个页面包含 urltitlesection 和带高亮的摘要片段。

get_page

按 URL 获取单个页面的完整文本。

参数

类型

必填

url

string

返回 urltitlesectiondescriptioncontentcrawled_at。超过约 15,000 字符的内容会被截断,响应中会带有 truncated: true

list_sections

无需输入。列出网站的顶级板块及其页面数量,以及索引的 crawled_at 时间戳——有助于在搜索前了解整体结构,或检查数据的时效性。


示例查询

连接后,可以向你的 MCP 客户端提问,例如:

  • "搜索 enable.co.nz 上关于轮椅资助的信息。"

  • "enable.co.nz 索引覆盖了哪些板块?"

  • "获取 https://www.enable.co.nz/services 的完整内容并总结。"


连接 MCP 客户端

Copilot Studio

  1. 打开你的代理 → 工具添加工具新建工具Model Context Protocol

  2. 服务器名称enable-nz-mcp(或任何你喜欢的名称——这只是一个标签)。

  3. 服务器 URLhttps://enable-nz-mcp.duckdns.org/mcp

  4. 身份验证无身份验证(保持默认,除非服务器设置了 API_KEY,在这种情况下选择 API 密钥/Bearer 认证选项并提供密钥)。

  5. 创建 → Copilot Studio 通过 Streamable HTTP 连接(这是它自 2025 年 8 月弃用 SSE 以来唯一支持的传输方式),并列出 search_enable_nzget_pagelist_sections。将该工具添加到你的代理中,然后用类似"搜索 enable.co.nz 上关于轮椅资助的信息"的提示进行测试。

VS Code Copilot

  1. 打开命令面板 → MCP: 添加服务器

  2. 选择 HTTP 并输入 https://enable-nz-mcp.duckdns.org/mcp

  3. 连接后,VS Code 会将 search_enable_nzget_pagelist_sections 列为可用工具。

Claude Desktop

  1. 设置 → 连接器添加自定义连接器

  2. URL:https://enable-nz-mcp.duckdns.org/mcp

  3. Claude 会自动协商 Streamable HTTP 传输方式。

任何其他 MCP 客户端

使用 Streamable HTTP 传输方式将其指向 https://enable-nz-mcp.duckdns.org/mcp。如果服务器设置了 API_KEY,请发送 Authorization: Bearer <key>


本地开发

npm ci
cp .env.example .env        # edit as needed

npm run crawl                # builds data/index.db.new
mv data/index.db.new data/index.db

npm run dev                  # starts the server with tsx, reading .env

使用 MCP Inspector 测试运行中的服务器:

npx @modelcontextprotocol/inspector
# connect to http://127.0.0.1:8081/mcp

或手动冒烟测试:

curl http://127.0.0.1:8081/health

curl -X POST http://127.0.0.1:8081/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

运行测试套件:

npm test

部署

服务器运行在现有的 DigitalOcean droplet 上,使用独立的非特权系统用户(mcpsvc),与同一台机器上的其他服务隔离——mcpsvc 没有 sudo 权限,也无法读取 /opt/enable-nz-mcp 之外的任何内容。pm2 进程配置见 deploy/ecosystem.config.cjs,反向代理配置块见 deploy/Caddyfile.example

pm2 和 Caddy 的配置更改都需要 root 权限,因此 mcpsvc 最多只能自行执行 pm2 save——管理员必须运行 pm2 startup(以在重启后保持进程运行)并安装/重新加载 Caddy 站点配置块。目前 Caddy 层未应用速率限制:这需要第三方 caddy-ratelimit 插件,而该插件不在此机器的 Caddy 构建中。

.github/workflows/refresh-index.yml 工作流每周重新爬取网站(周日 02:00 UTC,或通过 workflow_dispatch 手动触发),以最小页面数/大小作为门槛,并通过 rsync + 原子性 mv 通过 SSH 部署新索引。它需要三个仓库密钥:DEPLOY_SSH_KEYDEPLOY_HOSTDEPLOY_USER——使用专用的部署密钥对,并通过 authorized_keys 中的 command= 指令进行限制,使其只能运行 rsync/mv,而不能执行任意 shell。


v1 范围之外

  • 嵌入/语义搜索(对一个营销网站来说,通过 SQLite FTS5 进行关键词搜索已经足够)

  • 无头浏览器渲染

  • 多站点支持

  • 任何形式的写操作

  • 用户级认证或按租户隔离

F
license - not found
Not graded
quality - not tested
B
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

  • A
    license
    C
    quality
    F
    maintenance
    Enables searching for any text within a specified Algolia index through an MCP-compatible interface. It allows users to integrate Algolia search capabilities into their environment using an application ID and API key.
    1
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables searching and retrieving records from the DigitalNZ collection, with tools for keyword search and fetching full item details.
    9
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables users to search, read, and query saved bookmark content via a read-only MCP interface, with full-text and optional semantic search.
    4
    MIT

View all related MCP servers

Related MCP Connectors

  • GETS NZ MCP — New Zealand Government Electronic Tenders Service (keyless).

  • data.govt.nz CKAN MCP.

  • Internet Archive (archive.org) item search & metadata MCP.

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/liam-edmunds/enable-nz-mcp'

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