Skip to content

feat: drop self-hosted mcp servers and tool labels overwrite - #81

Merged
galuszkm merged 2 commits into
mainfrom
feat/mg/drop-hosted-mcp-server
Aug 15, 2026
Merged

feat: drop self-hosted mcp servers and tool labels overwrite#81
galuszkm merged 2 commits into
mainfrom
feat/mg/drop-hosted-mcp-server

Conversation

@galuszkm

Copy link
Copy Markdown
Member

Description

Two related refactors that shrink the public surface and fix behaviour that was silently wrong.
Net: ~1.5k lines removed.

1. Drop self-hosted MCP servers, collapse resolution into load()

strands-compose acted as both an MCP client and an MCP server host.
Hosting was a second responsibility that duplicated what the MCP SDK already does, so mcp_servers:, MCPServerDef, server: on clients, create_mcp_server, and MCPLifecycle are gone.
We now support only stdio (client spawns the subprocess) or an already-running remote server.

Resolution also had two entry points doing the same work: resolve_infra / ResolvedInfra / load_session are collapsed into load().
Models and MCP clients are built inside each load() call, which makes every call a fully isolated session instead of sharing process-wide infra. strands-compose load is now synchronous and reports what it wired.

Fixed along the way: transport auto-detection for url:, the ANSI renderer reading a non-existent message key on ERROR events, and strands-compose check printing session: None for built-in session providers (which only populate provider).

2. Drop tool_labels, close silent gaps in loading and rendering

tool_labels let YAML rename a tool for display. Display naming is a renderer concern, and the auto-generated "Delegating work to agent: X" labels hid the actual tool name the LLM invoked — the one thing a reader of the stream needs.
Removed from the agent schema, EventPublisher, and make_event_queue; the renderer now always shows the real name.

Fixed:

  • INTERRUPT events reached the ANSI renderer and produced no output, so a run waiting on human input looked hung.
  • Directory tool specs (./tools/) used a flat glob despite docs promising recursion. Now walks the tree and skips segments starting with _ or ., so __pycache__/ and .venv/ are never imported.
  • A Swarm's or Graph's entry_name was not counted as a node reference by the orchestration planner, so a nested orchestration used only as the entry could be built after its parent.
  • resolve_conversation_manager raised bare ValueError; now ConfigurationError, matching every other resolver.

Related Issues

N/A

Type of Change

  • Breaking change

YAML / API Impact

Breaking in both YAML and Python. No deprecation shims.

YAML keys removed — configs using them now fail schema validation:

  • mcp_servers: (top level)
  • server: on an mcp_clients: entry
  • tool_labels: on an agent

Python exports removed from strands_compose:

  • MCPServerDef, create_mcp_server, MCPLifecycle
  • ResolvedInfra, resolve_infra, load_session
  • tool_labels= parameter on EventPublisher and make_event_queue

Behaviour changes for code that still compiles:

  • load() is the single entry point and builds models + MCP clients per call, so each call is an isolated session. Callers that relied on shared infra across sessions must restructure.
  • strands-compose load is synchronous.
  • Directory tool specs now load nested subdirectories, so an agent may pick up more tools than before.

Minimum strands-agents is now >=1.52.0.

Testing

How have you tested the change?

  • I ran uv run just check (lint + type check)
  • I ran uv run just test for overall testing
  • I added or updated tests that prove my fix is effective or my feature works
  • I verified existing examples in examples/ still work

Coverage gate raised to 80%. Suite pruned of tests asserting framework behaviour or
duplicating coverage; added a parametrized test that fails if any EventType lacks a
renderer handler, and directory-recursion tests including same-stem files in sibling
subdirectories.

Checklist

  • I have read the CONTRIBUTING document
  • I have updated the documentation accordingly
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…oad()

- remove `mcp_servers:`, `MCPServerDef`, and `server:` on MCP clients - we support only stdio or already running remote servers
- remove `MCPLifecycle`
- collapse `resolve_infra`, `ResolvedInfra`, and `load_session` into `load`
- build models and MCP clients inside every `load()` call, making each call a fully isolated session
- make `strands-compose load` synchronous and have it report what was wired
- fix transport auto-detection for `url:`
- fix the ANSI renderer reading a non-existent `message` key on ERROR events
- fix `strands-compose check` reporting `session: None` for built-in session providers, which only populate `provider`
- raise the coverage gate to 80% and update docs, examples, and skills
- remove `tool_labels:` from agents, `EventPublisher`, and `make_event_queue`
- render INTERRUPT events instead of dropping them
- load directory tools recursively, skipping `_`- and `.`-prefixed path segments
- treat a Swarm's or Graph's `entry_name` as a node reference
- raise `ConfigurationError` from the conversation-manager resolver
- flush the queue each turn in the streaming example 12
- prune tests that asserted framework behaviour or duplicated coverage
- refresh stale docs (directory scanning, swarm/graph session limits, chapter nav, task list)
@galuszkm galuszkm changed the title Feat/mg/drop hosted mcp server feat: drop self-hosted mcp servers and tool labels overwrite Aug 15, 2026
@galuszkm
galuszkm merged commit 823bc46 into main Aug 15, 2026
9 checks passed
@galuszkm
galuszkm deleted the feat/mg/drop-hosted-mcp-server branch August 15, 2026 21:22
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