Secil Canary Historian MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LOG_LEVEL | No | Logging verbosity: DEBUG, INFO, WARNING, ERROR, or CRITICAL. | INFO |
| CANARY_TIMEOUT | No | Request timeout in seconds. | 30 |
| CANARY_MCP_HOST | No | Host for the remote HTTP/SSE transport, for example 0.0.0.0. | |
| CANARY_MCP_PORT | No | Port for the remote HTTP/SSE transport. | 6000 |
| MCP_SERVER_HOST | No | Optional MCP server host. | localhost |
| MCP_SERVER_PORT | No | Optional MCP server port. | 6000 |
| CANARY_API_TOKEN | Yes | Authentication token for the Canary API. Keep this secret. | |
| CANARY_POOL_SIZE | No | Connection pool size. | 10 |
| CANARY_ASSET_VIEW | No | Asset metadata view used by get_asset_types and get_asset_instances. | |
| CANARY_VECTOR_DIM | No | Dimension used for deterministic vector embeddings. | 512 |
| CANARY_DEFAULT_VIEW | No | Optional default view scoping for read_timeseries. | |
| CANARY_SAF_BASE_URL | Yes | Base URL for the Canary SAF (Store and Forward) API. | |
| CANARY_TESTER_ROLES | No | Comma-separated allowed tester roles for write_test_dataset. | |
| CANARY_VECTOR_TOP_K | No | Number of top semantic matches to return from the vector index. | 5 |
| CANARY_MCP_TRANSPORT | No | Transport mode for the MCP server, for example stdio or http. | stdio |
| CANARY_RETRY_ATTEMPTS | No | Number of retry attempts for failed requests. | 6 |
| CANARY_VIEWS_BASE_URL | Yes | Base URL for the Canary Views API. | |
| CANARY_WRITER_ENABLED | No | Flag controlling whether the write tool is enabled. | |
| CANARY_TAG_SEARCH_ROOT | No | Root namespace used when calling browseTags, for example Secil.Portugal. | |
| CANARY_VECTOR_HASH_SEED | No | Hash seed for deterministic vector embeddings. | 0 |
| CANARY_MAX_WRITE_RECORDS | No | Maximum number of records allowed in a write_test_dataset request. | |
| CANARY_VECTOR_INDEX_PATH | No | Path to the optional vector index. | data/vector-index |
| CANARY_MAX_RESPONSE_BYTES | No | Maximum MCP response size in bytes before truncation. | 1000000 |
| CANARY_ENABLE_VECTOR_SEARCH | No | Flag enabling optional vector/RAG semantic search. | false |
| CANARY_LAST_VALUE_PAGE_SIZE | No | Maximum number of samples requested to resolve last known values. | 500 |
| CANARY_TAG_SEARCH_FALLBACKS | No | Comma-separated additional namespace prefixes to probe when the root search scope is empty. | |
| CANARY_WRITE_ALLOWED_DATASETS | No | Comma-separated allowed Test datasets for write_test_dataset, for example Test/Maceira,Test/Outao. | |
| CANARY_LAST_VALUE_LOOKBACK_HOURS | No | Window in hours used when retrieving last known values. | 24 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Expose Canary historian metadata, guide natural-language requests toward precise tag paths, and lean on the tag catalog resource plus the tag_lookup_workflow prompt to clarify any ambiguous user intent. Interpret time ranges with the Canary relative time standard (see resource://canary/time-standards) and convert results from the Europe/Lisbon timezone to UTC. When requesting data for more than one tag, prefer the historian POST endpoints instead of multi-tag GET queries. When searching, pair English keywords with Portuguese synonyms—especially for the Portuguese sites (Maceira, Outão, Pataias, Montijo, Rio Maior, Martingança)—and translate the user's natural-language prompt as needed to surface the correct tags, variables, and historian locations. Remember this database stores industrial-process telemetry (PLCs, temperature sensors, pressure transmitters, etc.) that is normalized, filtered, or aggregated into metrics and KPIs over intervals such as weekly or monthly, so keep plant performance, maintenance, product quality, and compliance context in mind.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| pingA | Simple ping tool to test MCP server connectivity. Returns: str: Success message confirming server is responding |
| mcp_statusB | Checks MCP server connectivity and provides a status message named "mcp status". Returns: str: A detailed success message with server status, time, weather, and project info. |
| get_asset_catalogA | Retrieve curated metadata for Secil Maceira sensors, devices, and historian tags. This tool compiles information from the Canary auxiliary catalog so LLM or MCP clients
can convert natural-language requests into concrete historian paths. Pair this with
the Args: refresh: When True, reload the auxiliary files from disk (default: False) limit: Maximum number of tag entries to return inline (default: 200) include_examples: When True, include the raw request examples from the source file Returns:
dict[str, Any]: Keys include
- success: Whether metadata was loaded
- tags: Inline sample of tag entries limited by |
| search_tagsA | Search for Canary tags by name pattern. This tool searches for industrial process tags in the Canary historian that match the provided search pattern. Results are cached for performance. Hint: combine this tool with the Args: search_pattern: Tag name or pattern to search for (supports wildcards) bypass_cache: If True, skip cache and fetch fresh data (default: False) search_path: Optional namespace path to scope the browseTags query. Defaults to the CANARY_TAG_SEARCH_ROOT environment variable when omitted. Returns: dict[str, Any]: Dictionary containing search results with keys: - tags: List of matching tags with metadata - count: Total number of tags found - success: Boolean indicating if operation succeeded - pattern: The search pattern used - search_path: The path used to scope the search (may be empty) - cached: Boolean indicating if result came from cache Raises: Exception: If authentication fails or API request errors occur |
| get_tag_metadataB | Get detailed metadata for a specific tag in Canary. This tool retrieves comprehensive metadata for a tag including properties, data type, units, description, and configuration details. Args: tag_path: Full path or name of the tag to retrieve metadata for Returns: dict[str, Any]: Dictionary containing tag metadata with keys: - metadata: Dictionary of tag properties - success: Boolean indicating if operation succeeded - tag_path: The tag path that was queried Raises: Exception: If authentication fails or API request errors occur |
| get_tag_pathA | Resolve a natural-language tag description to the best-matching tag path. Args: description: Natural-language description of the desired tag max_results: Maximum number of candidate tags to return bypass_cache: If True, skip cached results and fetch fresh data Returns: dict[str, Any]: Response containing the most likely tag path and candidates |
| get_tag_propertiesB | Fetch raw tag property dictionaries from Canary getTagProperties API. Args: tag_paths: List of fully qualified tag paths to fetch properties for. Returns: dict[str, Any]: { "success": bool, "properties": mapping of tag path -> property dict, "count": number of property payloads returned, "requested": original tag_paths, "cached": always False } |
| list_namespacesA | List available Canary namespaces from the historian. This tool retrieves the hierarchical organization of industrial process tags by querying the Canary Views API for namespace information. Returns: dict[str, Any]: Dictionary containing namespace structure with keys: - namespaces: List of namespace paths - count: Total number of namespaces found - success: Boolean indicating if operation succeeded Raises: Exception: If authentication fails or API request errors occur |
| get_last_known_valuesC | Retrieve the most recent sample for one or more tags. |
| read_timeseriesB | Retrieve historical timeseries data for specific tags and time ranges. This tool retrieves historical process data from the Canary historian for analysis and troubleshooting. Args: tag_names: Single tag name or list of tag names to retrieve data for. If a JSON-style string array is provided (e.g. '["tag1","tag2"]'), it will be parsed automatically, but callers should prefer passing an actual list. start_time: Start time (ISO timestamp or relative expression like "now-1d") end_time: End time (ISO timestamp or relative expression like "now") page_size: Number of samples per page (default 1000) Returns: dict[str, Any]: Dictionary containing timeseries data with keys: - data: List of data points with timestamp, value, quality - count: Total number of data points returned - success: Boolean indicating if operation succeeded - tag_names: The tag names that were queried - start_time: The start time used for the query - end_time: The end time used for the query - hint: Guidance for correct usage Raises: Exception: If authentication fails or API request errors occur Note: When retrieving data for multiple tags, the MCP issues POST requests to the Canary historian. Avoid multi-tag GET queries to remain compatible with the API. |
| write_test_datasetA | Write manual entry samples into approved Test/* datasets via Canary SAF. Args:
dataset: The Test dataset to target (e.g., "Test/Maceira").
records: List of objects with keys Returns: Dict summarising the write attempt, including recorded prompt and role metadata. |
| get_tag_data2B | Retrieve historian data via Canary getTagData2 endpoint with optional aggregates. Args: tag_names: Single tag or list of tags (same normalization rules as read_timeseries) start_time: ISO timestamp or relative time string end_time: ISO timestamp or relative time string aggregate_name: Optional aggregate (e.g., TimeAverage2) aggregate_interval: Optional interval (e.g., 00:05:00) when aggregate_name is set max_size: Desired response size (# of samples) before Canary paginates (default 1000) Returns: dict: Structured response including raw data, count, and metadata summary |
| get_aggregatesB | Fetch supported Canary aggregate definitions (wrapper around getAggregates). |
| get_asset_typesC | Return asset types available in the configured Canary view. |
| get_asset_instancesC | Return asset instances for a given asset type (wrapper for getAssetInstances). |
| get_events_limit10C | Retrieve recent Canary events (wrapper for getEvents with limit 10 default). |
| browse_statusC | Inspect namespace nodes using the browseStatus endpoint. |
| get_server_infoA | Get Canary server health and capability information. This tool retrieves server version, status, supported time zones, and aggregation functions from the Canary historian, along with MCP server configuration details. Returns: dict[str, Any]: Dictionary containing server information with keys: - success: Boolean indicating if operation succeeded - server_info: Dictionary with Canary server details - mcp_info: Dictionary with MCP server details - error: Error message (only on failure) Raises: Exception: If authentication fails or API request errors occur |
| get_eventsB | Retrieve event data from the Canary historian. Args: start_time: Start time (ISO timestamp or relative expression like "now-1d") end_time: End time (ISO timestamp or relative expression like "now") limit: Maximum number of events to return (default 10) tag_names: Optional list of tag names to filter events Returns: dict[str, Any]: Dictionary containing event data with keys: - success: Boolean indicating if operation succeeded - events: List of event records - count: Total number of events returned - error: Error message (only on failure) |
| get_metricsB | Get performance metrics in Prometheus format. Story 2.1: Returns collected metrics including request counts, latencies, cache hit/miss rates, and connection pool statistics. Returns: str: Metrics formatted in Prometheus text exposition format Example:
|
| get_metrics_summaryB | Get human-readable summary of performance metrics. Story 2.1: Returns aggregated metrics including request counts, latency percentiles, and cache statistics for all MCP tools. Returns: dict[str, Any]: Dictionary containing metric summaries with keys: - total_requests: Total number of requests processed - by_tool: Per-tool statistics (counts, latencies, cache stats) - cache_stats: Overall cache hit/miss counts - active_connections: Current connection pool usage Example:
|
| get_cache_statsB | Get cache statistics. Story 2.2: Returns cache performance statistics including hit rate, size, and entry count. Returns: dict[str, Any]: Dictionary containing cache statistics with keys: - success: Boolean indicating if operation succeeded - stats: Cache statistics object Example:
|
| invalidate_cacheA | Invalidate cache entries matching pattern. Story 2.2: Clears cached data, optionally filtering by pattern. Use this when configuration changes or fresh data is required. Args: pattern: SQL LIKE pattern for keys (empty string = invalidate all) Returns: dict[str, Any]: Dictionary containing invalidation results with keys: - success: Boolean indicating if operation succeeded - count: Number of entries invalidated - pattern: The pattern used (if any) Example:
|
| cleanup_expired_cacheA | Remove expired entries from cache. Story 2.2: Cleans up expired cache entries to free storage space. This is done automatically but can be triggered manually. Returns: dict[str, Any]: Dictionary containing cleanup results with keys: - success: Boolean indicating if operation succeeded - count: Number of expired entries removed Example:
|
| get_healthA | Get MCP server health status including circuit breaker state. Story 2.3: Advanced Error Handling & Retry Logic Exposes circuit breaker state and system health for monitoring. Returns: dict[str, Any]: Dictionary containing health status with keys: - status: Overall health status ("healthy", "degraded", "unhealthy") - timestamp: Current timestamp - circuit_breakers: Dictionary of circuit breaker states - cache_health: Cache system health information - metrics_summary: Performance metrics summary Example:
|
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| tag_lookup_workflow | Workflow for translating natural-language requests into precise Canary tag paths. |
| timeseries_query_workflow | Workflow for retrieving historical samples from the Canary historian. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| maceira_tag_catalog | Structured metadata for the Secil Maceira site, including tag paths, descriptions, and engineering units gathered from Canary auxiliary files. |
| canary_time_standards | Reference guide for Canary relative time expressions and Europe/Lisbon timezone defaults used in historian queries. |
| maceira_uns_tag_guide | Human-readable guide to the Secil Maceira ISA-95/UNS hierarchy and tag naming. LLM/MCP clients should read this to understand the semantics and translate natural-language asset references into valid Canary tag paths. |
TDQS
Scored across 25 tools
Several tools have overlapping boundaries: read_timeseries and get_tag_data2 both retrieve historical timeseries with optional aggregates, get_events and get_events_limit10 overlap, and get_tag_metadata vs get_tag_properties both expose tag details. Status/health tools (ping, mcp_status, get_health, get_server_info) also blur connectivity, server health, and capability reporting. Distinct core tools exist, but an agent could easily misselect among these pairs.
Most tool names follow a predictable snake_case verb_noun pattern such as search_tags, get_tag_metadata, list_namespaces, and invalidate_cache. Minor deviations include ping and mcp_status, plus numeric suffixes in get_tag_data2 and get_events_limit10. The convention is still readable and mostly consistent.
At 25 tools, the surface is at the heavy end for a historian server and includes redundant wrappers, connection-test tools, and multiple observability/cache tools. The domain is complex enough to justify many operations, but several tools do not clearly earn their place as separate entries. This feels borderline over-scoped rather than well-scoped.
The server covers a strong historian read/analysis lifecycle: tag discovery, metadata, namespaces, historical timeseries, last-known values, aggregates, events, assets, and cache/health monitoring. Write support is intentionally limited to test datasets, and real-time subscriptions or broader production write operations are absent, but these are minor gaps for the apparent purpose.