Skip to main content
Glama

elog-mcp

OpenAPI/MCP 服务器,为 LLM 代理提供对 ELOG 电子日志的只读访问(通过 HTTP)。参考部署:T2K/ND280 日志,位于 https://elog.nd280.org/elog/;适用于任何标准 elogd 实例。

  • 按全文(正则)、属性和日期范围搜索条目

  • 读取完整条目(属性 + 正文 + 附件)

  • 下载附件、发现日志

严格只读:仅发出 HTTP GET 请求。默认启用 TLS 验证。凭据仅来自环境变量,绝不记录或回显。

设置

需要 Python ≥ 3.10 和 uv:

uv sync

Related MCP server: mcp-opensearch

配置

所有设置均为环境变量(ELOG_ 前缀):

变量

必需

含义

ELOG_URL

是

基础 URL(含子目录),例如 https://elog.nd280.org/elog

ELOG_USER / ELOG_PASSWORD

否

共享凭据

ELOG_LOGBOOKS

否

逗号分隔的允许列表,用于搜索 * / 列表顺序

ELOG_SSL_VERIFY

否

true(默认)/ false — 切勿在本地测试之外禁用

ELOG_TIMEOUT

否

HTTP 超时秒数(默认 30)

ELOG_MCP_TRANSPORT

否

stdio(默认)· streamable-http · openapi

ELOG_MCP_HOST / ELOG_MCP_PORT

否

HTTP 模式下的绑定地址/端口(默认 127.0.0.1:8000)

ELOG_API_KEY

否

要求所有 OpenAPI 端点提供 Authorization: Bearer <key>

ELOG_CORS_ORIGINS

否

openapi 模式的逗号分隔 CORS 来源(默认 *)

ELOG_MCP_CERTFILE / ELOG_MCP_KEYFILE

否

TLS 证书/密钥(PEM)— 在 HTTP 模式下提供 HTTPS

每个部署的通用前缀:

export ELOG_URL=https://elog.nd280.org/elog
export ELOG_USER=your-shared-user
export ELOG_PASSWORD=your-shared-password

部署

ELOG_MCP_TRANSPORT 决定客户端如何与服务器通信:

传输

客户端

端点

stdio(默认)

Claude Desktop、opencode 及其他本地 MCP 主机

生成的进程

streamable-http

通过 HTTP 使用 MCP 的 Web UI(LibreChat 等)

http://<host>:<port>/mcp

openapi

OpenAPI 工具服务器(Open WebUI 等)

规范位于 /openapi.json,文档位于 /docs,基础 / 返回存活 JSON

stdio(本地 MCP 客户端)

uv run elog-mcp

Claude Desktop(claude_desktop_config.json):

{
  "mcpServers": {
    "elog": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/elog-mcp", "run", "elog-mcp"],
      "env": { "ELOG_URL": "…", "ELOG_USER": "…", "ELOG_PASSWORD": "…" }
    }
  }
}

opencode(~/.config/opencode/opencode.json):

{
  "mcp": {
    "elog": {
      "type": "local",
      "command": ["uv", "--directory", "/absolute/path/to/elog-mcp", "run", "elog-mcp"],
      "environment": { "ELOG_URL": "…", "ELOG_USER": "…", "ELOG_PASSWORD": "…" }
    }
  }
}

streamable-http(远程 MCP 客户端)

ELOG_MCP_TRANSPORT=streamable-http uv run elog-mcp

在您的 UI 中将 http://127.0.0.1:8000/mcp 注册为远程 MCP 服务器。

openapi(Open WebUI 及类似工具)

ELOG_MCP_TRANSPORT=openapi \
ELOG_API_KEY=pick-a-random-secret \
uv run elog-mcp

五个只读端点与下面的工具对应(operationId 与工具名称相同)。在 Open WebUI 中:设置 → 工具 → +(用户级,由您的浏览器获取)或管理员设置 → 工具(全局,由其后端获取),输入服务器 URL,并将您的 ELOG_API_KEY 值放入 Bearer 密钥字段。

HTTPS: 传递 ELOG_MCP_CERTFILE/ELOG_MCP_KEYFILE,或在前面放置反向代理或隧道(例如 cloudflared tunnel --url http://localhost:8000)。对于本地受信任的开发证书:mkcert -install && mkcert localhost 127.0.0.1 ::1,然后将两个文件提供给上述变量(绝对路径)。

可达性经验法则:

  • 默认所有内容绑定 127.0.0.1。当其他人必须访问服务器时,设置 ELOG_MCP_HOST=0.0.0.0 和 ELOG_API_KEY。

  • 客户端在 Docker 中?其容器内的 127.0.0.1 不是您的机器 — 使用 http://host.docker.internal:<port>(在 Linux 上使用 --add-host=host.docker.internal:host-gateway)。

  • 托管实例(例如大学 WebUI)?它永远无法访问您笔记本电脑的回环地址。用户级工具服务器还受该站点的内容安全策略(Content-Security-Policy)约束 — 如果 DevTools 显示请求为 Transferred: CSP,则浏览器阻止了它,只有 IT 端的 connect-src 更改才能解决。实际途径:将 elog-mcp 部署在可访问的位置,并让管理员将其注册为一次全局工具服务器。

工具

每种传输方式都有相同的五个操作(REST 路由针对 openapi 显示):

工具

REST 路由

用途

elog_list_logbooks()

GET /logbooks

列出日志

elog_search(text?, attributes?, date_from?, date_to?, last_days?, logbook="*", max_results=50, reverse=true)

GET /search(attributes = JSON 对象字符串)

正则全文 + 属性 + 日期过滤;返回摘录

elog_get_entry(logbook, entry_id)

GET /logbooks/{logbook}/entries/{entry_id}

完整条目正文、属性、线程

elog_get_recent_entries(logbook, count=20)

GET /logbooks/{logbook}/recent?count=N

最新优先快捷方式

elog_get_attachment(logbook, filename)

GET /logbooks/{logbook}/attachments/{filename}

Base64 附件内容

注意:

  • 文本和属性过滤器是正则表达式(elogd 语义);^value$ 锚点提供精确匹配。

  • 日期:YYYY-MM-DD[ HH:MM[:SS]],或使用 last_days 代替范围;logbook="*" 搜索所有已知日志。

  • 错误统一呈现:EntryNotFound、AuthFailed、ServerError、NetworkError、InvalidLogbook(REST 状态码:404/502/502/503/404,无效查询参数 → 400/422)。

开发

uv run pytest                # unit tests, offline
uv run pytest -m live        # live suite (needs ELOG_TEST_URL)
uv run ruff check .          # lint
uv run ruff format --check . # formatting gate
uv run mypy src              # type check (strict)

协议细节和线格式参考见 RESOURCES.md;架构和工具契约见 SPEC.md。

Available Tools

5 tools
elog_get_attachmentA

Download an attachment (screenshot, config file, ...) as base64 content.

Args: logbook: Name of the logbook holding the attachment. filename: Attachment filename exactly as listed on the entry.

Returns {filename, content_b64, mime, size}; embed via MCP resource mechanisms when presenting to users.

ParametersJSON Schema
NameRequiredDescriptionDefault
logbookYes
filenameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.6/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. It discloses the return structure ({filename, content_b64, mime, size}) and advises embedding via MCP resource mechanisms, which is key behavioral context. It doesn't mention error conditions, authentication, or size limits, but for a simple read operation the core behavior is well-covered.

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 concise and well-structured with explicit 'Args' and 'Returns' sections. The purpose is front-loaded, and every sentence adds value. There is no redundancy or filler.

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?

For a two-parameter tool with an output schema (per context), the description covers all necessary calling information: parameters, return format, and integration guidance. No additional details are needed for an agent to call it correctly.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate. It does so effectively: 'logbook' is explained as the name of the holding logbook, and 'filename' is specified as the exact name as listed on the entry. This adds critical meaning beyond the bare schema titles.

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 opens with a specific verb ('Download') and a concrete resource ('an attachment'), and specifies the output encoding ('as base64 content'). This clearly distinguishes it from sibling tools like elog_get_entry or elog_search, which operate on entries or search results rather than binary attachments.

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 clearly implies when to use the tool: when you need to retrieve an attachment by logbook and filename. It does not explicitly reference alternatives or exclusions, but the purpose is self-evident and matches the tool's name. Since no sibling tool offers attachment downloading, no additional routing guidance is necessary.

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

elog_get_entryA

Read one logbook entry in full: all attributes, complete body, attachments.

Args: logbook: Name of the logbook containing the entry. entry_id: Numeric message ID of the entry.

Returns the full entry record including the untruncated body text, threading info (reply_to / in_reply_to) and the canonical web URL.

ParametersJSON Schema
NameRequiredDescriptionDefault
logbookYes
entry_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

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 and discloses meaningful behavioral traits: it returns untruncated body text (a notable distinction from truncated list results), threading info (reply_to/in_reply_to), and the canonical web URL. This directly informs the agent of valuable return characteristics beyond a bare 'reads an entry.'

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?

Purpose is front-loaded in the first line, followed by a compact Args section and a concise Returns section. The structure is clean and scannable, though the Returns paragraph is slightly redundant with the opening line's mention of attributes, body, and attachments.

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 two-parameter read tool, the description is substantially complete: both parameters are explained, return value structure is disclosed, and the output schema exists to formalize the record shape. Missing only minor context like authentication prerequisites, which is typically not tool-specific for a read operation.

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 description coverage is 0%, so the description must compensate, and it does: it explains logbook as 'Name of the logbook containing the entry' and entry_id as 'Numeric message ID of the entry.' Both parameters are adequately documented in prose despite the empty schema titles, with no enums or nesting concerns.

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?

States a specific verb ('Read') and resource ('one logbook entry in full'), and lists what makes it distinct from siblings: all attributes, complete body, and attachments. The 'in full' phrasing clearly differentiates it from the list/summary tools in the sibling set like elog_get_recent_entries.

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 this is the right tool when you need a complete single entry rather than a summary or search result, but it never explicitly names alternatives or gives conditions for choosing between them. The 'in full' contrast versus elog_search and elog_get_recent_entries is implied, not stated. No exclusions or when-not-to-use guidance is given.

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

elog_get_recent_entriesA

Fetch the newest entries of a logbook, newest first.

Args: logbook: Name of the logbook to read. count: Number of recent entries to return.

Returns {"total": int, "entries": [...]} with excerpts like elog_search.

ParametersJSON Schema
NameRequiredDescriptionDefault
countNo
logbookYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.4/5.0
Behavior4/5

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

Since no annotations are provided, the description carries the full burden. It discloses the return format ('Returns {"total": int, "entries": [...]}'), the ordering ('newest first'), and references sibling behavior ('excerpts like elog_search'). This adds meaningful context beyond the schema, though it does not address read-only guarantees, pagination limits, or error conditions, leaving some room for improvement.

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 concise and well-structured. It leads with the one-sentence purpose, then lists parameters in a clear 'Args:' block, and ends with the return type. No filler or redundancy; every sentence contributes useful information. The most critical info (what it does) is front-loaded.

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?

Given the tool's simplicity (2 params, no enums, output schema exists), the description is complete. It states the purpose, parameter meanings, and the return shape, and references sibling behavior for the excerpt format. The presence of an output schema reduces the need to explain return details further, and nothing essential for a correct call is missing.

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

Parameters5/5

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

With schema description coverage at 0%, the description must compensate. It clearly defines both parameters: 'Name of the logbook to read' for logbook and 'Number of recent entries to return' for count. This provides semantics that the schema omits, fully explaining the purpose of each parameter.

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 opens with a clear action verb and resource: 'Fetch the newest entries of a logbook, newest first.' It identifies the resource (logbook entries) and the ordering (newest first), which distinguishes it from siblings like elog_search (searches by criteria) and elog_get_entry (single entry).

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 purpose implies usage ('when you want recent entries'), but there is no explicit comparison to alternatives or conditions for when not to use this tool. It does not name elog_search or elog_get_entry as alternatives, nor does it describe when they would be more appropriate. Guidance is implied rather than explicit.

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

elog_list_logbooksA

List the logbooks available on the configured ELOG server.

Returns a list of {name, description?, url} objects. The optional ELOG_LOGBOOKS environment variable restricts and orders the result.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/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 discloses the return format (list of {name, description?, url} objects) and the effect of an optional environment variable (ELOG_LOGBOOKS) that restricts and orders results. This adds meaningful behavioral context beyond a simple 'list' call, though it does not cover potential errors or auth requirements.

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 concise sentences. The first states the purpose immediately; the second provides return format and an optional configuration detail. No redundant wording, no filler, and the most important information is front-loaded.

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?

For a simple listing tool with no parameters and an output schema that likely describes the returned objects, the description is complete. It covers what it does, what it returns, and a relevant environment variable. The sibling tools are all entry-focused, so there is no missing context about when to use this tool. No output schema is shown, but the description compensates by describing the return structure.

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?

The tool has zero parameters, so the schema provides no parameter meaning. The description adds value by explaining what is returned and mentioning the ELOG_LOGBOOKS environment variable as a configuring influence. This goes beyond the empty schema and justifies a score above the baseline for no-parameter tools.

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 states a specific verb 'List' and a specific resource 'logbooks available on the configured ELOG server'. It clearly distinguishes from sibling tools (elog_search, elog_get_entry, etc.) which all operate on entries rather than logbooks. No ambiguity.

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 (when you need the list of logbooks) but does not explicitly state when to use it vs alternatives or when not to use it. Since siblings are all entry-focused, the context makes the purpose obvious, but no explicit guidance is provided.

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. 5 tool updatesv0.1.0
    • First observedelog_get_attachment
    • First observedelog_get_entry
    • First observedelog_get_recent_entries
    • First observedelog_list_logbooks
    • First observedelog_search

TDQS

A4.3/5.0

Scored across 5 tools

Disambiguation4/5

Each tool maps to a distinct operation (listing logbooks, searching, reading a single entry, browsing recent entries, fetching attachments), so confusion is unlikely. However, elog_get_recent_entries overlaps with elog_search's last_days and reverse options, making the boundary between them slightly less sharp.

Naming Consistency4/5

The elog_ prefix and verb-first style are consistent, and most tools follow a verb_noun pattern such as elog_list_logbooks, elog_get_entry, and elog_get_attachment. elog_search is the one outlier because it omits an explicit object, which is a minor deviation from the otherwise predictable pattern.

Tool Count5/5

Five tools is a well-scoped size for a read-only logbook client. Each tool covers one essential need—discovering logbooks, searching entries, reading full entries, browsing recent entries, and downloading attachments—without unnecessary redundancy or bloat.

Completeness4/5

The read-oriented surface is complete for searching, reading, and retrieving attachments from ELOG entries. The only notable gap is the absence of write or lifecycle tools such as creating, replying to, or editing entries, though this appears to be an intentional read-only scope.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    Enables discovery of HEPData records, tables, and data access with read-only operations and export links.
    9
    13 PyPI
    GPL 2.0
  • A
    license
    A
    quality
    D
    maintenance
    Read-only MCP server for exploring and searching OpenSearch clusters, enabling log analysis, index exploration, and query execution.
    8
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Read-only MCP server for Elasticsearch log querying. Enables natural language search, filtering, context retrieval, and aggregation of logs.
    -