github Arthur-Ficial/apfel v0.7.1
v0.7.1 - Native MCP Support

latest releases: v1.8.0, v1.7.2, v1.7.1...
3 months ago

Native MCP Client Support

apfel now natively speaks the Model Context Protocol. Attach tool servers with --mcp:

apfel --mcp ./mcp/calculator/server.py "What is 15 times 27?"
# tool: multiply({"a": 15, "b": 27}) = 405
# 15 times 27 is 405.

What's new

  • --mcp <path> flag - attach MCP tool servers (repeatable). Works in all three modes: CLI, server, chat.
  • Auto-discovery - tools are discovered via MCP tools/list at startup
  • Auto-execution - tool calls are detected, executed via the MCP server, and results fed back to the model
  • Zero overhead - no --mcp = exactly as before, no extra tokens, no code path changes
  • Server mode - apfel --serve --mcp ./calc.py auto-injects tools when clients don't send their own
  • Ships with calculator MCP - mcp/calculator/server.py gives the model math abilities

Architecture

  • Sources/Core/MCPProtocol.swift - JSON-RPC 2.0 protocol handling (pure Swift, unit-testable)
  • Sources/MCPClient.swift - MCPConnection (subprocess management) + MCPManager (actor)
  • 13 new MCP protocol unit tests
  • 118 total unit tests + 87 integration tests pass

Examples

# CLI - one command, answer out
apfel --mcp ./mcp/calculator/server.py "What is 2 to the power of 10?"
# tool: power({"base": 2, "exponent": 10}) = 1024
# 2 to the power of 10 is 1024.

# Server - tools auto-available
apfel --serve --mcp ./mcp/calculator/server.py

# Multiple servers
apfel --mcp ./calc.py --mcp ./weather.py "What is sqrt(2025)?"

# No --mcp = zero changes
apfel "Hello"

See docs/mcp-calculator.md for full documentation.

Don't miss a new apfel release

NewReleases is sending notifications on new releases.