Skip to content

release: v0.17.1 — MCP Client/Server integration#25

Merged
johnnichev merged 3 commits intomainfrom
feat/mcp-client-server
Mar 22, 2026
Merged

release: v0.17.1 — MCP Client/Server integration#25
johnnichev merged 3 commits intomainfrom
feat/mcp-client-server

Conversation

@johnnichev
Copy link
Copy Markdown
Owner

Selectools v0.17.1 — MCP Client/Server

Connect to any MCP-compatible tool server and expose selectools tools as MCP servers.

Highlights

  • MCPClient — stdio + HTTP transport, circuit breaker, retry with backoff, tool caching
  • MultiMCPClient — multiple servers, graceful degradation, name prefixing
  • MCPServer — expose @tool functions as MCP server
  • mcp_tools() — one-liner context manager
  • Schema bridge — bidirectional MCP ↔ Tool conversion
  • pip install selectools[mcp] optional dependency
  • 33 MCP tests + 2 examples + full docs
  • Verified E2E with real Anthropic API

Competitive advantages

  • Circuit breaker (LangChain has none)
  • Graceful degradation (LangChain crashes if one server dies)
  • Sync + async API (competitors are async-only)
  • MCP server mode (OpenAI doesn't have this)
  • All selectools features work on MCP tools automatically

Test plan

  • 1929 tests pass (full suite)
  • E2E verified with real Anthropic API + MCP
  • All pre-commit hooks pass
  • MkDocs build clean

New selectools.mcp package:

- MCPClient: connect to MCP servers via stdio or Streamable HTTP,
  auto-discover tools, circuit breaker, retry with backoff, tool caching
- MultiMCPClient: manage multiple servers with graceful degradation,
  name prefixing, collision detection
- MCPServer: expose @tool functions as MCP-compliant server
- mcp_tools(): one-liner context manager for tool discovery
- Bridge: bidirectional MCP <> selectools Tool schema conversion
- Background event loop for sync usage
- MCPServerConfig with validation
- MCPError, MCPConnectionError, MCPToolError exceptions
- pip install selectools[mcp] optional dependency
- Tool._skip_validation for MCP-sourced tools

Verified round-trip: selectools @tool -> MCPServer -> MCPClient -> Tool

33 new tests. Total: 1939.
MCP tool function is now async (was sync with background loop wrapper).
This allows agent.arun() and EvalSuite.arun() to await MCP calls
directly without deadlocking on nested event loops.

Verified E2E with real Anthropic API:
- Agent.arun() + MCP tools: working
- EvalSuite.arun() on MCP-powered agent: working
- Direct MCPClient.call_tool(): working
- MCPServer exposing selectools tools: working
MCP module + docs + examples + version bump + count fixes:
- docs/modules/MCP.md — full module documentation
- examples/41_mcp_client.py, 42_mcp_server.py
- mkdocs.yml nav updated with Integration section
- CHANGELOG.md v0.17.1 entry
- README: What's New, install section, feature table
- ROADMAP: v0.17.1 marked complete
- CLAUDE.md: roadmap updated
- Version: 0.17.0 → 0.17.1
- Counts: 1993 tests, 42 examples, 26 module docs

Verified E2E with real Anthropic API + MCP servers.
@johnnichev johnnichev merged commit 2f2c460 into main Mar 22, 2026
@johnnichev johnnichev deleted the feat/mcp-client-server branch March 22, 2026 21:05
johnnichev added a commit that referenced this pull request Mar 24, 2026
Agent core observers (6 fixes):
- astream() cancellation/budget paths now build proper results with
  trace steps and async observer events (#14)
- arun() fires async observers for cancel/budget/max-iter (#15)
- _aexecute_tools_parallel fires async observer events (#16)
- _aexecute_tools_parallel tracks tool_usage/tool_tokens (#17)
- _acheck_policy fires async on_policy_decision observer (#10M)
- astream() max-iter path fires async on_run_end (#12M)

Tools + providers (7 fixes):
- Anthropic empty content list guard (#19)
- Bool rejected for int/float params (#20)
- ToolRegistry.tool() has screen_output/terminal/requires_approval (#21)
- MultiMCPClient list_all_tools() copies tools before prefixing (#22)
- Streamable-http 3-tuple unpacking robust handling (#23)
- _serialize_result returns "" for None (#24)
- StructuredOutputEvaluator handles __slots__ (#45)

RAG (6 fixes):
- SQLiteVectorStore search documented limitation (#25)
- InMemoryVectorStore max_documents warning (#26)
- Pinecone metadata.get instead of .pop (#27)
- ContextualChunker None content guard (#28)
- Filter overfetch: top_k*4 when filter present (#29)
- OpenAI embed_texts batching at 2048 (#30)

Memory (5 fixes):
- FileKnowledgeStore reads under lock (#32)
- SQLiteSessionStore WAL mode (#33)
- SQLiteKnowledgeStore indexes on query columns (#34)
- query() LIMIT after TTL filter (#35)
- Redis save() category update in pipeline (#36)

Evals (4 fixes):
- 16 LLM evaluators fail on unparseable score (#37)
- XSS fix: textContent instead of innerHTML (#38)
- Donut SVG 360° arc: two semicircles (#39)
- Suite completed counter under threading.Lock (#46)

Security (5 fixes):
- REWRITE/WARN guardrails tracked in trace (#40)
- SSN regex requires consistent separators (#41)
- Topic guardrail Unicode normalization (#42)
- Coherence usage tracked in agent costs (#43)
- Coherence fail_closed option (#44)

Full suite: 2013 passed.
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