Skip to content

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

Open
christophebrun-forest wants to merge 1 commit into
feat/prd-214-server-step-mapperfrom
feature/prd-418-workflow-executor-include-mcpserverid-servername-in-mcp-step
Open

feat(workflow-executor): include mcpServerId + mcpServerName in MCP step logs (PRD-418)#1616
christophebrun-forest wants to merge 1 commit 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 context

  • Adds a getExtraLogContext() hook to BaseStepExecutor so subclasses can inject type-specific fields into all log entries produced by the executor.
  • McpStepExecutor overrides this hook to include mcpServerId (from the step definition) and mcpServerName (passed via constructor).
  • RemoteToolFetcher.fetch() now returns { tools, serverName } instead of a plain array, resolving serverName from the scoped config key and propagating it through warnings and errors.
  • StepExecutorFactory passes serverName from the fetch result to McpStepExecutor.
  • Risk: callers providing a fetchRemoteTools callback to StepExecutorFactory.create must update their return type to FetchRemoteToolsResult.

Macroscope summarized 9a91d69.

…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>
@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.

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