Skip to content

feat: ship MCP server in the npm package#36

Merged
AlCalzone merged 1 commit into
masterfrom
alcalzone-mcp-server-first
Jul 6, 2026
Merged

feat: ship MCP server in the npm package#36
AlCalzone merged 1 commit into
masterfrom
alcalzone-mcp-server-first

Conversation

@AlCalzone

@AlCalzone AlCalzone commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

Ships the existing MCP server (src/mcp-server.ts) in the published npm package so AI agents (e.g. GitHub Agentic Workflows with the Copilot CLI engine) can use it for tool-driven log analysis. Also adopts the reusable improvements from the tool-calling experiment in #8. The Gemini-based one-shot analysis path (CLI, library API, web UI) is unchanged.

Changes

Packaging

  • Added bin entry zwave-log-analyzer-mcpdist/mcp-server.js
  • tsconfig.node.json now compiles src/mcp-server.ts as part of build:cli
  • Added dist/mcp-server.js and dist/lib/zwave-mcp-server-core.{js,d.ts} to files
  • Fix: added dist/lib/log-query-engine.{js,d.ts} to files — it is imported by index.js but was missing from the published package
  • Moved @modelcontextprotocol/sdk from devDependencies to dependencies (bumped to ^1.26.0 to match the lockfile)
  • README: documented MCP server usage and tool list

Adopted from #8

  • Extracted the MCP server implementation into a reusable ZWaveLogMCPServerCore class; src/mcp-server.ts is now a thin stdio wrapper
  • searchLogEntries: query is now optional — filter-only searches via entryKinds, timeRange or attributeFilters are supported; calls without any filter return a descriptive error
  • Fix: getNodeSummary/getNodeCommunication now pass through the timeRange argument, which was previously silently dropped by the server
  • Fix: removed the import.meta.url main-module guard, which broke execution through npx/bin symlinks

The browser/Gemini tool-calling parts of #8 (EventTarget transport, Gemini client rework) were intentionally not adopted.

Usage

npx --package=@zwave-js/log-analyzer zwave-log-analyzer-mcp

Verification

  • npm run build:cli produces dist/mcp-server.js with shebang; lint passes
  • End-to-end stdio test: initialize, tools/list (8 tools), loadLogFile, filter-only searchLogEntries, and the no-filter error path all behave correctly
  • npm pack --dry-run includes all required files

No release is triggered by this PR.

Adds a zwave-log-analyzer-mcp bin entry, builds dist/mcp-server.js as part
of build:cli, includes it in the published files, and moves
@modelcontextprotocol/sdk to dependencies. The Gemini-based analysis path
is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@AlCalzone AlCalzone changed the title feat: ship MCP server in the npm package feat!: ship MCP server, remove Gemini-based analysis Jul 6, 2026
@AlCalzone
AlCalzone force-pushed the alcalzone-mcp-server-first branch from 16f056a to a773eac Compare July 6, 2026 20:16
@AlCalzone AlCalzone changed the title feat!: ship MCP server, remove Gemini-based analysis feat: ship MCP server in the npm package Jul 6, 2026
@AlCalzone
AlCalzone merged commit 8ad572c into master Jul 6, 2026
8 checks passed
@AlCalzone
AlCalzone deleted the alcalzone-mcp-server-first branch July 6, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant