How privkeyio/evolve-mcp works
evolve-mcp is a local-first MCP server for agent self-improvement. An MCP client invokes tools on the server; cycle requests are managed by shared state and run through evolution, where prompts are generated, safety-checked, and evaluated for fitness. Clients can also directly generate and inspect variants, evaluate fitness, validate safety, and collect or analyze metrics. The graph preserves these distinct capabilities and the shared state layer. Relationships follow shown calls or README claims; some engine integrations are documented but their call sites were not excerpted.
Main entry points: server.py MCP tools and resources · state.py Cycle and variant state · engine.py Evolution orchestration · variants.py Mutation and crossover
Components 12
MCP Interface
- MCP tools and resources
mcp_server/server.py - MCP serialization
mcp_server/serializers.py - MCP errors
mcp_server/errors.py - Command-line interface
evolve_core/cli.py
Evolution
- Evolution orchestration
evolution/engine.py - Mutation and crossover
evolution/variants.py - Fitness evaluation
evolution/fitness.py - Evolution data contracts
evolution/interfaces.py
Quality and Monitoring
- Safety validation
evolve_core/safety.py - Metrics analysis
monitoring/metrics.py
Shared State
- Cycle and variant state
mcp_server/state.py
Other components
- MCP client
Connections 18
- MCP client → MCP tools and resources: invokes tools
README.md - MCP tools and resources → Cycle and variant state: manages cycles
mcp_server/server.py - MCP tools and resources → MCP serialization: serializes results
mcp_server/server.py - MCP tools and resources → MCP errors: handles errors
mcp_server/server.py - Cycle and variant state → Evolution orchestration: starts cycle
mcp_server/state.py - Cycle and variant state → Mutation and crossover: provides generator
mcp_server/state.py - Cycle and variant state → Fitness evaluation: provides evaluator
mcp_server/state.py - Cycle and variant state → Safety validation: provides validator
mcp_server/state.py - Cycle and variant state → Metrics analysis: provides collector
mcp_server/state.py - Evolution orchestration → Safety validation: validates variants
evolution/engine.py - Evolution orchestration → Mutation and crossover: generates variants
- Evolution orchestration → Fitness evaluation: evaluates fitness
- MCP tools and resources → Mutation and crossover: generates variants
README.md - MCP tools and resources → Fitness evaluation: evaluates fitness
mcp_server/server.py - MCP tools and resources → Safety validation: checks safety
mcp_server/server.py - MCP tools and resources → Metrics analysis: requests metrics
README.md - Command-line interface → Fitness evaluation: uses evaluator
evolve_core/cli.py - Evolution data contracts → Mutation and crossover: defines contracts
evolution/variants.py