Artsdata

ca.artsdata由 artsdata.ca 發布官方發布者v1.0.0更新於 Oct 24, 2026

Search Artsdata for authoritative data on Canadian events, artists, organizations, and places.

已驗證Streamable HTTP可網頁執行資料庫知識與記憶

概覽

AI 產生的概覽

面向 Artsdata 知識圖譜的遠端 MCP 伺服器,讓助理檢索加拿大活動、藝術家、機構與地點,並執行唯讀 SPARQL 查詢。

可以做什麼
依名稱檢索實體,可依實體類型與概念架構篩選,回傳帶連結的標籤與可在回答中引用的 Artsdata ID。依 URI 取得實體詳情,包括該實體來源的資料集。依地點、藝術家、機構、活動類型概念與語言檢索活動。讀取圖譜資料模型:實體類別、屬性、基數、值類型與受控詞彙。執行唯讀 SPARQL SELECT 或 ASK 查詢,回傳標準 JSON 結果,並附列數上限與截斷標記。
適用情境
適合需要加拿大文化藝術領域權威且有出處資料的情境:活動列表、場館與機構查詢、藝術家辨識,或對關聯資料圖譜做結構化查詢。較適合研究與資料核對類任務,而非一般網頁搜尋。
執行需求
遠端 streamable HTTP 端點,無需安裝套件或本機執行環境。未宣告需要身分驗證、API 金鑰或請求標頭。助理需能存取 Artsdata 的網路端點。若自行部署 Rails 應用程式,需要 Ruby、Rails 與 Bundler,以及文件中列出的對帳、結構定義、API 與 SPARQL 端點環境變數。
安裝前請注意
查詢為唯讀,但伺服器會回報使用情形:呼叫會送至 Google Analytics 4,包含所用工具、耗時與呼叫方 User-Agent,SPARQL 呼叫還包含 WHERE 子句。每次呼叫也會寫入請求日誌,記錄完整參數,例如搜尋詞、實體 URI 與完整 SPARQL 查詢。應假設所查詢的內容可能被記錄或分析。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Artsdata,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/ca.artsdata%2Fmcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "artsdata": {
      "type": "http",
      "url": "https://mcp.artsdata.ca/mcp"
    }
  }
}

README

Artsdata MCP Server (Rails)

Prerequisites

  • Ruby 4.0.6
  • Rails 8.1
  • Bundler

Setup

bash
bundle install

Endpoints

  • POST /mcp: MCP Streamable HTTP endpoint (tools and resources are documented in docs/mcp-server.md)
  • GET /up: health check
  • GET /llms.txt: machine-readable guide for agents

Calls to /mcp are reported to Google Analytics 4.

MCP resources

  • artsdata://dumps/core-minus-provenance/latest (artsdata_dump): manifest for the latest Artsdata core-minus-provenance dump — the core graph with provenance and RDF-star annotations removed, published monthly as a gzipped Turtle file.

    resources/read asks the Artsdata Databus for the newest version of the artifact (GET /databus/artifact/latest?artifact=<ARTIFACT_URI>) and returns a small JSON document with the download URL, version, format and compression — never the dump contents. Going through the Databus means MCP clients need to know nothing about where the file is actually stored. Clients download the file from downloadUrl and compare version across reads to detect when a new dump lands.

Directory structure

text
.github/  workflows/    deploy-to-heroku.yml  # Workflow deploying to Heroku    run-unit-tests.yml    # Reusable workflow running Minitest    unit-test-on-pull-request.yml # Workflow running unit tests on pull requestsapp/  resource/     # MCP resources  schema/       # JSON schemas of the tools' input and output  services/     # Clients for the reconciliation service, SPARQL endpoint and Databus  tool/         # MCP toolsconfig/  initializers/mcp_server.rb  # MCP server: registered tools, resources and transport  initializers/mcp_analytics.rb # Google Analytics 4 reporting configuration  routes.rblib/  mcp_analytics/  # Rack middleware reporting MCP usage to Google Analytics 4test/

Configuration

  • ARTSDATA_RECONCILIATION_ENDPOINT: reconciliation service URL used by the search_entities, get_entity and search_events tools.
  • ARTSDATA_SCHEMA_URL (optional): Turtle file compiled by the get_schema tool (default https://docs.artsdata.ca/artsdata-schema.ttl).
  • ARTSDATA_SCHEMA_CACHE_TTL_SECONDS (optional): how long the compiled schema is cached in process (default 86400).
  • ARTSDATA_CORS_ORIGINS (optional): comma-separated CORS origins (default *).
  • ARTSDATA_API_ENDPOINT (optional): base URL of the Artsdata API, used to query the Databus for the latest data dump (default https://api.artsdata.ca).
  • ARTSDATA_SPARQL_ENDPOINT (optional): SPARQL endpoint queried by the sparql_query tool (default https://query.artsdata.ca/query).
  • ARTSDATA_SPARQL_TIMEOUT_SECONDS (optional): read timeout for a sparql_query call (default 25).
  • ARTSDATA_SPARQL_MAX_ROWS (optional): maximum rows sparql_query returns; extra rows are cut and the result is flagged truncated (default 1000).
  • Docker instance profiles are provided in:
    • env/production.env
    • env/staging.env
  • ARTSDATA_INSTANCE_TYPE (optional): PRODUCTION (default) or STAGING. The Docker entrypoint loads the matching file from env/.

Usage analytics

Calls to /mcp are reported to Google Analytics 4, including the tool used, how long the call took, and the caller's User-Agent. Reporting stays off until both variables below are set, so development and CI need no configuration.

  • GA4_MEASUREMENT_ID: the GA4 property's G-XXXXXXXXXX id. Not a secret; defaulted for production in config/environments/production.rb.
  • GA4_API_SECRET: Measurement Protocol secret. Secret — set it as a Heroku. config var, never in env/*.env, which is committed.
  • GA4_DEBUG (optional): tag events so they appear in GA4's DebugView within seconds, and log whether GA4 considers each payload valid. Events are still recorded. Useful because the normal endpoint answers 204 whether or not the payload is valid.

Reporting is on when both credentials are present and off otherwise.

Separately, every MCP call is written to stdout as one JSON line, including the complete arguments the agent sent — the full SPARQL query, search terms, entity URIs. On Heroku these lines go to heroku logs and to any drain you attach.

  • MCP_REQUEST_LOG (optional): set to false to silence the request log. It runs independently of Google Analytics and works with no GA4 credentials set.

For sparql_query calls, two extra facts are reported: sparql_form (SELECT, ASK or UNKNOWN) and sparql_where, the WHERE clause as the agent wrote it with the PREFIX block removed and whitespace collapsed. Both go to Google Analytics and to the request log; GA4 cuts the WHERE clause at its 100-character limit, the log keeps it whole.

Run the application

bash
bundle exec rails server

The API will be available at http://localhost:3000.

Docker

Build the image:

bash
docker build -t artsdata-mcp-server .

Run the server:

bash
docker run --rm -p 3000:3000 artsdata-mcp-server

Run with staging profile:

bash
docker run --rm -p 3000:3000 -e ARTSDATA_INSTANCE_TYPE=STAGING artsdata-mcp-server

Run tests in Docker:

bash
docker run --rm artsdata-mcp-server bundle exec rails test

Run tests

Run a single test file:

bash
bundle exec rails test test/tool/search_events_test.rb

Run all tests:

bash
bundle exec rails test

llms.txt maintenance

The public/llms.txt file is generated from MCP server metadata (tools, resources, descriptions, and schemas).

CI behavior:

  • Pull request CI runs bundle exec rake docs:check_llms.
  • If public/llms.txt is stale, the workflow fails.

Developer workflow:

  • Most of the time, no manual action is needed.
  • If you change MCP tools, resources, or schemas, regenerate the file with:
bash
bundle exec rake docs:generate_llms
  • Confirm it is in sync with:
bash
bundle exec rake docs:check_llms
  • Commit the updated public/llms.txt.

Deployment & CI/CD Details:

This project uses GitHub Actions for continuous integration and automated deployment to Heroku. Every push to the main branch triggers a workflow that builds and deploys the application to Heroku. The workflow is defined in .github/workflows/deploy-to-heroku.yml.

Every pull request triggers a workflow that unit tests. The workflow is defined in .github/workflows/run-unit-tests.yml.

Server Access & API Documentation

The Artsdata MCP Server is actively deployed and hosted in a live production environment.

Live Production Endpoints

來源:README.md,提交 2ed7f52

工具

5

search_entities

Tool to search for entities in the Artsdata knowledge graph by name, with optional filters on entity type and on the controlled vocabulary (skos:ConceptScheme) a concept belongs to. Each result has a markdown-link `label` like '[Name (K12-345)](https://kg.artsdata.ca/resource/K12-345)': use it verbatim when mentioning the entity.

輸入參數limitquery必填typeslanguagein_scheme

get_entity

Tool to get entities details from Artsdata Knowledge Graph by entity URI. Entity URIs end in the Artsdata ID (K\d+-\d+, e.g. K12-345); cite it with the entity name. The result's `sources` lists the datasets the entity was built from: name them when you answer about the entity, linking `url` when present, else by `name`.

輸入參數uri必填

search_events

Tool to search for events in the Artsdata knowledge graph by place, artist, organization, has_event_type_concept and language. Places, artists and organizations are Artsdata entity URIs; the has_event_type_concept filter takes concept URIs from the Artsdata Event Types vocabulary (adr:ArtsdataEventTypes), not schema.org classes. Resolve any name or label to its URI with search_entities first. Places must be venues; for events in a city or region, use sparql_query (see the places parameter). At least one filter is required. Entity URIs end in the Artsdata ID (K\d+-\d+, e.g. K12-345); cite it with the entity name.

輸入參數limitplacesartistslanguagestartDateToorganizationsstartDateFromhas_event_type_concept

get_schema

Returns the data model of the Artsdata Knowledge Graph: its entity classes (Event, Place, Organization, Person, LivePerformanceWork...), the properties of each with required/optional, cardinality, value types, linked classes and allowed values, the controlled vocabularies, the SPARQL prefixes, and conventions for querying. Derived from the Artsdata Ontology and the Artsdata CORE graph SHACL shapes. Call this before writing a SPARQL query to run with sparql_query against https://query.artsdata.ca/query, since Artsdata's model is not general knowledge. Takes no input.

無需輸入參數。

sparql_query

Runs a read-only SPARQL 1.1 SELECT or ASK query against the Artsdata Knowledge Graph (https://query.artsdata.ca/query) and returns the result as SPARQL 1.1 Query Results JSON, exactly as the endpoint returns it: head.vars and results.bindings for SELECT, boolean for ASK. Call get_schema first and build the query from the classes, properties, prefixes and conventions it returns, since Artsdata's model is not general knowledge. Declare every PREFIX you use and always add a LIMIT: at most 1000 rows are returned (the rest is cut and truncated is true; page with OFFSET), and a query gets 25 seconds. If the endpoint rejects the query, its error message is returned so you can fix the query and retry. For the details of an entity URI in the results use get_entity; to find an entity's URI from its name use search_entities. Always SELECT the entity URI next to its label so its Artsdata ID can be cited. Entity URIs end in the Artsdata ID (K\d+-\d+, e.g. K12-345); cite it with the entity name. To find who claims a property value, see the sources guidance in the get_schema conventions.

輸入參數query必填

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。