UAT: SkillMcpSource domain model missing MCP connection fields — transport, command, args, url, headers are dropped during skill registration #2412

Open
opened 2026-04-03 17:38:57 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/skill-mcp-source-connection-fields
  • Commit Message: fix(skills): add transport/command/args/url/headers fields to SkillMcpSource domain model and preserve them in SkillService
  • Milestone: v3.5.0
  • Parent Epic: #397

Description

When a skill with MCP servers is registered via agents skill add, the MCP server connection information is silently dropped. The SkillMcpSource domain model only stores server (name), tools, and env — it does not store transport, command, args, url, or headers. These fields are required to actually connect to MCP servers.

What Was Tested

  • Code analysis of src/cleveragents/domain/models/core/skill.py SkillMcpSource class
  • Code analysis of src/cleveragents/application/services/skill_service.py _schema_to_skill_dict() method
  • Runtime test confirming the data loss

Expected Behavior (from spec)

The spec shows MCP servers with transport, command, args, env, url, and headers fields. These are required for the system to connect to MCP servers and discover/invoke their tools. After registration, the skill should retain all connection information.

Actual Behavior

config = SkillConfigSchema.from_yaml('''
name: local/test
description: Test
mcp_servers:
  - name: github
    transport: stdio
    command: npx
    args:
      - "-y"
      - "@modelcontextprotocol/server-github"
    env:
      GITHUB_TOKEN: "my-token"
''')

svc = SkillService()
svc.add_skill(config)
skill = svc.get_skill('local/test')
print(skill.mcp_servers[0])
# SkillMcpSource(server='github', tools=None, env=None)
# transport, command, args are ALL MISSING

Code Locations

  1. src/cleveragents/domain/models/core/skill.py, SkillMcpSource class — only has server, tools, env fields
  2. src/cleveragents/application/services/skill_service.py, _schema_to_skill_dict() — only copies server (name) and tool_filter.include as tools

Impact

  • MCP servers registered as part of skills cannot be connected to — the connection info is lost
  • agents skill refresh cannot sync MCP tools because transport/command/url are unknown
  • The skill appears registered but is non-functional for MCP-backed tools

Steps to Reproduce

  1. Create a skill YAML with an MCP server that has transport: stdio and command: npx
  2. Register it via SkillService.add_skill()
  3. Retrieve the skill and check skill.mcp_servers[0]transport, command, args will all be None/missing

Subtasks

  • Add transport, command, args, url, and headers fields to the SkillMcpSource domain model in src/cleveragents/domain/models/core/skill.py
  • Update _schema_to_skill_dict() in src/cleveragents/application/services/skill_service.py to copy all MCP connection fields (transport, command, args, url, headers) when mapping schema → domain dict
  • Ensure SkillMcpSource fields are statically typed and pass nox -e typecheck (Pyright)
  • Write Behave unit tests (in features/) covering round-trip preservation of all MCP connection fields through SkillService.add_skill()get_skill()
  • Write Behave unit tests for edge cases: missing optional fields (url, headers) default to None without error
  • Update any Robot Framework integration tests in robot/ that exercise skill registration with MCP servers
  • Verify nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e integration_tests, and nox -e coverage_report all pass

Definition of Done

  • SkillMcpSource domain model contains all six connection fields: server, transport, command, args, url, headers, and env
  • SkillService._schema_to_skill_dict() preserves all MCP connection fields without data loss
  • Round-trip test passes: a skill registered with full MCP server config can be retrieved with all fields intact
  • agents skill refresh can use the stored transport/command/url to connect to MCP servers
  • All Behave unit tests pass (nox -e unit_tests)
  • All Robot Framework integration tests pass (nox -e integration_tests)
  • All nox stages pass
  • Coverage >= 97%
  • Commit pushed to fix/skill-mcp-source-connection-fields with message: fix(skills): add transport/command/args/url/headers fields to SkillMcpSource domain model and preserve them in SkillService
  • PR merged and this issue closed

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/skill-mcp-source-connection-fields` - **Commit Message**: `fix(skills): add transport/command/args/url/headers fields to SkillMcpSource domain model and preserve them in SkillService` - **Milestone**: v3.5.0 - **Parent Epic**: #397 ## Description When a skill with MCP servers is registered via `agents skill add`, the MCP server connection information is silently dropped. The `SkillMcpSource` domain model only stores `server` (name), `tools`, and `env` — it does not store `transport`, `command`, `args`, `url`, or `headers`. These fields are required to actually connect to MCP servers. ### What Was Tested - Code analysis of `src/cleveragents/domain/models/core/skill.py` `SkillMcpSource` class - Code analysis of `src/cleveragents/application/services/skill_service.py` `_schema_to_skill_dict()` method - Runtime test confirming the data loss ### Expected Behavior (from spec) The spec shows MCP servers with `transport`, `command`, `args`, `env`, `url`, and `headers` fields. These are required for the system to connect to MCP servers and discover/invoke their tools. After registration, the skill should retain all connection information. ### Actual Behavior ```python config = SkillConfigSchema.from_yaml(''' name: local/test description: Test mcp_servers: - name: github transport: stdio command: npx args: - "-y" - "@modelcontextprotocol/server-github" env: GITHUB_TOKEN: "my-token" ''') svc = SkillService() svc.add_skill(config) skill = svc.get_skill('local/test') print(skill.mcp_servers[0]) # SkillMcpSource(server='github', tools=None, env=None) # transport, command, args are ALL MISSING ``` ### Code Locations 1. `src/cleveragents/domain/models/core/skill.py`, `SkillMcpSource` class — only has `server`, `tools`, `env` fields 2. `src/cleveragents/application/services/skill_service.py`, `_schema_to_skill_dict()` — only copies `server` (name) and `tool_filter.include` as `tools` ### Impact - MCP servers registered as part of skills cannot be connected to — the connection info is lost - `agents skill refresh` cannot sync MCP tools because transport/command/url are unknown - The skill appears registered but is non-functional for MCP-backed tools ### Steps to Reproduce 1. Create a skill YAML with an MCP server that has `transport: stdio` and `command: npx` 2. Register it via `SkillService.add_skill()` 3. Retrieve the skill and check `skill.mcp_servers[0]` — `transport`, `command`, `args` will all be `None`/missing ## Subtasks - [ ] Add `transport`, `command`, `args`, `url`, and `headers` fields to the `SkillMcpSource` domain model in `src/cleveragents/domain/models/core/skill.py` - [ ] Update `_schema_to_skill_dict()` in `src/cleveragents/application/services/skill_service.py` to copy all MCP connection fields (`transport`, `command`, `args`, `url`, `headers`) when mapping schema → domain dict - [ ] Ensure `SkillMcpSource` fields are statically typed and pass `nox -e typecheck` (Pyright) - [ ] Write Behave unit tests (in `features/`) covering round-trip preservation of all MCP connection fields through `SkillService.add_skill()` → `get_skill()` - [ ] Write Behave unit tests for edge cases: missing optional fields (`url`, `headers`) default to `None` without error - [ ] Update any Robot Framework integration tests in `robot/` that exercise skill registration with MCP servers - [ ] Verify `nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e integration_tests`, and `nox -e coverage_report` all pass ## Definition of Done - [ ] `SkillMcpSource` domain model contains all six connection fields: `server`, `transport`, `command`, `args`, `url`, `headers`, and `env` - [ ] `SkillService._schema_to_skill_dict()` preserves all MCP connection fields without data loss - [ ] Round-trip test passes: a skill registered with full MCP server config can be retrieved with all fields intact - [ ] `agents skill refresh` can use the stored `transport`/`command`/`url` to connect to MCP servers - [ ] All Behave unit tests pass (`nox -e unit_tests`) - [ ] All Robot Framework integration tests pass (`nox -e integration_tests`) - [ ] All nox stages pass - [ ] Coverage >= 97% - [ ] Commit pushed to `fix/skill-mcp-source-connection-fields` with message: `fix(skills): add transport/command/args/url/headers fields to SkillMcpSource domain model and preserve them in SkillService` - [ ] PR merged and this issue closed --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.5.0 milestone 2026-04-03 17:39:05 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — MCP connection fields being silently dropped means skills with MCP servers cannot actually connect to their servers after registration. This is a data loss bug that breaks MCP-based skill functionality.
  • Milestone: v3.5.0 (as specified in issue metadata)
  • MoSCoW: Must Have — Without MCP connection fields, skills that depend on MCP servers are non-functional. This directly blocks the skill registration pipeline.
  • Parent Epic: #397 (Server & Autonomy Infrastructure)

The issue is well-described with clear domain model analysis and a definition of done. Valid and actionable.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: High — MCP connection fields being silently dropped means skills with MCP servers cannot actually connect to their servers after registration. This is a data loss bug that breaks MCP-based skill functionality. - **Milestone**: v3.5.0 (as specified in issue metadata) - **MoSCoW**: Must Have — Without MCP connection fields, skills that depend on MCP servers are non-functional. This directly blocks the skill registration pipeline. - **Parent Epic**: #397 (Server & Autonomy Infrastructure) The issue is well-described with clear domain model analysis and a definition of done. Valid and actionable. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#397 Epic: Server & Autonomy Infrastructure
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#2412
No description provided.