Skip to content

feat(workflow-executor): include mcpServerId + mcpServerName in MCP step logs (PRD-418)#1616

Merged
christophebrun-forest merged 2 commits into
feat/prd-214-server-step-mapperfrom
feature/prd-418-workflow-executor-include-mcpserverid-servername-in-mcp-step
Jun 2, 2026
Merged

feat(workflow-executor): include mcpServerId + mcpServerName in MCP step logs (PRD-418)#1616
christophebrun-forest merged 2 commits into
feat/prd-214-server-step-mapperfrom
feature/prd-418-workflow-executor-include-mcpserverid-servername-in-mcp-step

Conversation

@christophebrun-forest
Copy link
Copy Markdown
Member

@christophebrun-forest christophebrun-forest commented Jun 1, 2026

What

Adds two fields to every MCP step execution log line so operators can unambiguously identify which MCP server a log entry refers to when several are configured:

  • mcpServerId — DB id of the targeted MCP server (canonical).
  • mcpServerName — human-readable name (the Record key from getMcpServerConfigs()).

How

  • BaseStepExecutor — new getExtraLogContext() hook (default {}) merged into logCtx, so all step log lines (started/completed, errors, timeouts) pick up extra fields. Base class stays free of step-specific knowledge.
  • McpStepExecutor — overrides getExtraLogContext() to return { mcpServerId, mcpServerName }.
  • RemoteToolFetcher.fetch() — now resolves serverName from the scoped config Record key and returns { tools, serverName }; diagnostic log lines (not advertised…, failed to load tools) also carry mcpServerName.
  • StepExecutorFactory — forwards serverName to the McpStepExecutor constructor.

mcpServerId is canonical; mcpServerName is the human-readable label (not guaranteed unique at the DB level — a user MCP can collide with a Forest connector). Logging both is what makes the entry unambiguous.

Tests

  • remote-tool-fetcher: new { tools, serverName } shape, serverName resolution, mcpServerName in diagnostic logs.
  • mcp-step-executor: Step execution started/completed lines include mcpServerId + mcpServerName; undefined when unresolved.
  • runner: end-to-end forwarding of serverName to the executor.

Full suite: 836/836 green, lint clean, build OK.

fixes PRD-418

🤖 Generated with Claude Code

Note

Include mcpServerId and mcpServerName in MCP step executor log lines

  • RemoteToolFetcher.fetch() now returns FetchRemoteToolsResult ({ tools, mcpServerName? }) instead of RemoteTool[], resolving mcpServerName from the scoped config record key.
  • BaseStepExecutor adds a protected getExtraLogContext() hook so subclasses can inject type-specific fields into every log line.
  • McpStepExecutor overrides getExtraLogContext() to include mcpServerId and mcpServerName, and StepExecutorFactory passes the resolved name through on construction.
  • Behavioral Change: callers of fetchRemoteTools must now destructure { tools, mcpServerName } from the result instead of using it directly as an array.

Macroscope summarized 98bce7b.

@linear
Copy link
Copy Markdown

linear Bot commented Jun 1, 2026

PRD-418

@qltysh
Copy link
Copy Markdown

qltysh Bot commented Jun 1, 2026

4 new issues

Tool Category Rule Count
qlty Structure Function with many parameters (count = 5): create 3
qlty Structure Function with many returns (count = 8): create 1

@qltysh
Copy link
Copy Markdown

qltysh Bot commented Jun 1, 2026

Qlty


Coverage Impact

Unable to calculate total coverage change because base branch coverage was not found.

Modified Files with Diff Coverage (4)

RatingFile% DiffUncovered Line #s
New Coverage rating: A
packages/workflow-executor/src/executors/step-executor-factory.ts100.0%
New Coverage rating: A
packages/workflow-executor/src/remote-tool-fetcher.ts100.0%
New Coverage rating: A
packages/workflow-executor/src/executors/base-step-executor.ts100.0%
New Coverage rating: A
packages/workflow-executor/src/executors/mcp-step-executor.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

christophebrun-forest added a commit that referenced this pull request Jun 2, 2026
…rt log context

Address review on PR #1616:
- unify naming on `mcpServerName` across RemoteToolFetcher, factory and McpStepExecutor
- factory test asserts the executor's getExtraLogContext() output instead of reading a private field

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@matthv matthv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

christophebrun-forest and others added 2 commits June 2, 2026 11:20
…tep logs (PRD-418)

Adds a getExtraLogContext() hook on BaseStepExecutor (default {}) merged into
logCtx, overridden by McpStepExecutor to stamp every MCP step log line with
mcpServerId and mcpServerName. RemoteToolFetcher.fetch() now resolves the
serverName from the scoped config Record key and returns { tools, serverName },
forwarded to the executor via StepExecutorFactory. Diagnostic log lines in the
fetcher also carry mcpServerName.

fixes PRD-418

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rt log context

Address review on PR #1616:
- unify naming on `mcpServerName` across RemoteToolFetcher, factory and McpStepExecutor
- factory test asserts the executor's getExtraLogContext() output instead of reading a private field

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@christophebrun-forest christophebrun-forest force-pushed the feature/prd-418-workflow-executor-include-mcpserverid-servername-in-mcp-step branch from b6cfb71 to 98bce7b Compare June 2, 2026 09:21
@christophebrun-forest christophebrun-forest merged commit 82dd057 into feat/prd-214-server-step-mapper Jun 2, 2026
26 checks passed
@christophebrun-forest christophebrun-forest deleted the feature/prd-418-workflow-executor-include-mcpserverid-servername-in-mcp-step branch June 2, 2026 09:26
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.

2 participants