agentic-mcp-solver 4.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentic_mcp_solver-4.2.0/.gitignore +89 -0
- agentic_mcp_solver-4.2.0/CHANGELOG.md +128 -0
- agentic_mcp_solver-4.2.0/INSTALL.md +218 -0
- agentic_mcp_solver-4.2.0/LICENSE +21 -0
- agentic_mcp_solver-4.2.0/PKG-INFO +318 -0
- agentic_mcp_solver-4.2.0/README.md +280 -0
- agentic_mcp_solver-4.2.0/minion/.gitignore +9 -0
- agentic_mcp_solver-4.2.0/minion/CHANGELOG.md +34 -0
- agentic_mcp_solver-4.2.0/minion/LICENSE +21 -0
- agentic_mcp_solver-4.2.0/minion/README.md +143 -0
- agentic_mcp_solver-4.2.0/minion/e2e_tests/__init__.py +0 -0
- agentic_mcp_solver-4.2.0/minion/e2e_tests/runs/mcp_ipython/config.json +16 -0
- agentic_mcp_solver-4.2.0/minion/e2e_tests/runs/mcp_ipython/task.md +1 -0
- agentic_mcp_solver-4.2.0/minion/e2e_tests/runs/multi_step/config.json +6 -0
- agentic_mcp_solver-4.2.0/minion/e2e_tests/runs/multi_step/task.md +1 -0
- agentic_mcp_solver-4.2.0/minion/e2e_tests/runs/no_tools/config.json +6 -0
- agentic_mcp_solver-4.2.0/minion/e2e_tests/runs/no_tools/task.md +1 -0
- agentic_mcp_solver-4.2.0/minion/e2e_tests/runs/simple_add/config.json +6 -0
- agentic_mcp_solver-4.2.0/minion/e2e_tests/runs/simple_add/task.md +1 -0
- agentic_mcp_solver-4.2.0/minion/e2e_tests/test_e2e.py +174 -0
- agentic_mcp_solver-4.2.0/minion/e2e_tests/test_problems_e2e.py +141 -0
- agentic_mcp_solver-4.2.0/minion/pyproject.toml +64 -0
- agentic_mcp_solver-4.2.0/minion/src/mcp_minion/__init__.py +29 -0
- agentic_mcp_solver-4.2.0/minion/src/mcp_minion/agent.py +593 -0
- agentic_mcp_solver-4.2.0/minion/src/mcp_minion/artifacts.py +81 -0
- agentic_mcp_solver-4.2.0/minion/src/mcp_minion/cli.py +433 -0
- agentic_mcp_solver-4.2.0/minion/src/mcp_minion/logging.py +178 -0
- agentic_mcp_solver-4.2.0/minion/src/mcp_minion/mcp_client.py +360 -0
- agentic_mcp_solver-4.2.0/minion/src/mcp_minion/test_mcp_server.py +133 -0
- agentic_mcp_solver-4.2.0/minion/src/mcp_minion/tools.py +153 -0
- agentic_mcp_solver-4.2.0/minion/tests/__init__.py +0 -0
- agentic_mcp_solver-4.2.0/minion/tests/test_agent.py +312 -0
- agentic_mcp_solver-4.2.0/minion/tests/test_artifacts.py +81 -0
- agentic_mcp_solver-4.2.0/minion/tests/test_cli.py +488 -0
- agentic_mcp_solver-4.2.0/minion/tests/test_kernel.py +124 -0
- agentic_mcp_solver-4.2.0/minion/tests/test_logging.py +128 -0
- agentic_mcp_solver-4.2.0/minion/tests/test_mcp_client.py +170 -0
- agentic_mcp_solver-4.2.0/minion/tests/test_system_prompt.py +61 -0
- agentic_mcp_solver-4.2.0/minion/tests/test_tools.py +139 -0
- agentic_mcp_solver-4.2.0/pyproject.toml +99 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/__init__.py +20 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/agent/__init__.py +1 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/agent/cli.py +496 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/agent/harness.py +258 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/agent/mcp_server.py +508 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/agent/runfolder.py +159 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/helpers/__init__.py +7 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/helpers/maxsat.py +79 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/helpers/pysat.py +346 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/helpers/z3.py +213 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/templates/__init__.py +22 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/templates/clingo.md +1305 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/templates/cpmpy.md +124 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/templates/didp.md +270 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/templates/maxsat.md +192 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/templates/pysat.md +186 -0
- agentic_mcp_solver-4.2.0/src/mcp_solver/templates/z3.md +165 -0
- agentic_mcp_solver-4.2.0/tests/README.md +54 -0
- agentic_mcp_solver-4.2.0/tests/__init__.py +3 -0
- agentic_mcp_solver-4.2.0/tests/problems/clingo/birds_fly.md +57 -0
- agentic_mcp_solver-4.2.0/tests/problems/clingo/birds_fly_ground_truth.py +108 -0
- agentic_mcp_solver-4.2.0/tests/problems/clingo/company_controls.md +30 -0
- agentic_mcp_solver-4.2.0/tests/problems/clingo/company_controls_ground_truth.py +99 -0
- agentic_mcp_solver-4.2.0/tests/problems/clingo/package_status_unsat.md +16 -0
- agentic_mcp_solver-4.2.0/tests/problems/clingo/package_status_unsat_ground_truth.py +47 -0
- agentic_mcp_solver-4.2.0/tests/problems/clingo/party_invitation.md +21 -0
- agentic_mcp_solver-4.2.0/tests/problems/clingo/party_invitation_ground_truth.py +59 -0
- agentic_mcp_solver-4.2.0/tests/problems/clingo/shift_assignment.md +55 -0
- agentic_mcp_solver-4.2.0/tests/problems/clingo/shift_assignment_ground_truth.py +153 -0
- agentic_mcp_solver-4.2.0/tests/problems/clingo/test.md +10 -0
- agentic_mcp_solver-4.2.0/tests/problems/cpmpy/carpet_cutting.md +58 -0
- agentic_mcp_solver-4.2.0/tests/problems/cpmpy/carpet_cutting_ground_truth.py +165 -0
- agentic_mcp_solver-4.2.0/tests/problems/cpmpy/tsp.md +37 -0
- agentic_mcp_solver-4.2.0/tests/problems/cpmpy/tsp_ground_truth.py +96 -0
- agentic_mcp_solver-4.2.0/tests/problems/cpmpy/university_scheduling.md +60 -0
- agentic_mcp_solver-4.2.0/tests/problems/cpmpy/university_scheduling_ground_truth.py +236 -0
- agentic_mcp_solver-4.2.0/tests/problems/cpmpy/university_scheduling_unsat.md +50 -0
- agentic_mcp_solver-4.2.0/tests/problems/cpmpy/university_scheduling_unsat_ground_truth.py +50 -0
- agentic_mcp_solver-4.2.0/tests/problems/cpmpy/zebra.md +34 -0
- agentic_mcp_solver-4.2.0/tests/problems/cpmpy/zebra_ground_truth.py +139 -0
- agentic_mcp_solver-4.2.0/tests/problems/didp/knapsack.md +37 -0
- agentic_mcp_solver-4.2.0/tests/problems/didp/knapsack_ground_truth.py +114 -0
- agentic_mcp_solver-4.2.0/tests/problems/didp/talent_scheduling.md +56 -0
- agentic_mcp_solver-4.2.0/tests/problems/didp/talent_scheduling_ground_truth.py +146 -0
- agentic_mcp_solver-4.2.0/tests/problems/didp/tardiness.md +44 -0
- agentic_mcp_solver-4.2.0/tests/problems/didp/tardiness_ground_truth.py +125 -0
- agentic_mcp_solver-4.2.0/tests/problems/didp/tsptw.md +73 -0
- agentic_mcp_solver-4.2.0/tests/problems/didp/tsptw_ground_truth.py +155 -0
- agentic_mcp_solver-4.2.0/tests/problems/maxsat/equipment_purchase.md +39 -0
- agentic_mcp_solver-4.2.0/tests/problems/maxsat/equipment_purchase_ground_truth.py +107 -0
- agentic_mcp_solver-4.2.0/tests/problems/maxsat/network_monitoring.md +60 -0
- agentic_mcp_solver-4.2.0/tests/problems/maxsat/network_monitoring_ground_truth.py +138 -0
- agentic_mcp_solver-4.2.0/tests/problems/maxsat/package_selection.md +46 -0
- agentic_mcp_solver-4.2.0/tests/problems/maxsat/package_selection_ground_truth.py +115 -0
- agentic_mcp_solver-4.2.0/tests/problems/maxsat/task_assignment.md +42 -0
- agentic_mcp_solver-4.2.0/tests/problems/maxsat/task_assignment_ground_truth.py +93 -0
- agentic_mcp_solver-4.2.0/tests/problems/maxsat/test.md +18 -0
- agentic_mcp_solver-4.2.0/tests/problems/maxsat/workshop_scheduling_unsat.md +46 -0
- agentic_mcp_solver-4.2.0/tests/problems/maxsat/workshop_scheduling_unsat_ground_truth.py +110 -0
- agentic_mcp_solver-4.2.0/tests/problems/pysat/equitable_coloring_hajos.md +28 -0
- agentic_mcp_solver-4.2.0/tests/problems/pysat/equitable_coloring_hajos_ground_truth.py +119 -0
- agentic_mcp_solver-4.2.0/tests/problems/pysat/furniture_arrangement.md +20 -0
- agentic_mcp_solver-4.2.0/tests/problems/pysat/furniture_arrangement_ground_truth.py +74 -0
- agentic_mcp_solver-4.2.0/tests/problems/pysat/n_queens.md +13 -0
- agentic_mcp_solver-4.2.0/tests/problems/pysat/n_queens_ground_truth.py +67 -0
- agentic_mcp_solver-4.2.0/tests/problems/pysat/no_three_in_line_5x5.md +60 -0
- agentic_mcp_solver-4.2.0/tests/problems/pysat/no_three_in_line_5x5_ground_truth.py +75 -0
- agentic_mcp_solver-4.2.0/tests/problems/pysat/petersen_12_coloring_unsat.md +19 -0
- agentic_mcp_solver-4.2.0/tests/problems/pysat/petersen_12_coloring_unsat_ground_truth.py +158 -0
- agentic_mcp_solver-4.2.0/tests/problems/pysat/sudoku_16x16.md +15 -0
- agentic_mcp_solver-4.2.0/tests/problems/pysat/sudoku_16x16_ground_truth.py +102 -0
- agentic_mcp_solver-4.2.0/tests/problems/pysat/test.md +5 -0
- agentic_mcp_solver-4.2.0/tests/problems/z3/array_property_verifier.md +23 -0
- agentic_mcp_solver-4.2.0/tests/problems/z3/array_property_verifier_ground_truth.py +77 -0
- agentic_mcp_solver-4.2.0/tests/problems/z3/bounded_sum_unsat.md +25 -0
- agentic_mcp_solver-4.2.0/tests/problems/z3/bounded_sum_unsat_ground_truth.py +111 -0
- agentic_mcp_solver-4.2.0/tests/problems/z3/cryptarithmetic.md +38 -0
- agentic_mcp_solver-4.2.0/tests/problems/z3/cryptarithmetic_ground_truth.py +99 -0
- agentic_mcp_solver-4.2.0/tests/problems/z3/processor_verification.md +55 -0
- agentic_mcp_solver-4.2.0/tests/problems/z3/processor_verification_ground_truth.py +99 -0
- agentic_mcp_solver-4.2.0/tests/problems/z3/sos_induction.md +39 -0
- agentic_mcp_solver-4.2.0/tests/problems/z3/sos_induction_ground_truth.py +61 -0
- agentic_mcp_solver-4.2.0/tests/problems/z3/test.md +6 -0
- agentic_mcp_solver-4.2.0/tests/unit/test_cli.py +411 -0
- agentic_mcp_solver-4.2.0/tests/unit/test_didp_backend.py +50 -0
- agentic_mcp_solver-4.2.0/tests/unit/test_helpers_maxsat.py +102 -0
- agentic_mcp_solver-4.2.0/tests/unit/test_helpers_pysat.py +312 -0
- agentic_mcp_solver-4.2.0/tests/unit/test_helpers_z3.py +181 -0
- agentic_mcp_solver-4.2.0/tests/unit/test_mcp_server.py +376 -0
- agentic_mcp_solver-4.2.0/tests/unit/test_runfolder.py +57 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
MANIFEST
|
|
23
|
+
|
|
24
|
+
# Virtual Environments
|
|
25
|
+
.env
|
|
26
|
+
.venv
|
|
27
|
+
env/
|
|
28
|
+
venv/
|
|
29
|
+
ENV/
|
|
30
|
+
env.bak/
|
|
31
|
+
venv.bak/
|
|
32
|
+
.uv/
|
|
33
|
+
|
|
34
|
+
# Logs and databases
|
|
35
|
+
*.log
|
|
36
|
+
*.sqlite3
|
|
37
|
+
*.sqlite3-journal
|
|
38
|
+
|
|
39
|
+
# IDE specific files
|
|
40
|
+
.idea/
|
|
41
|
+
.vscode/
|
|
42
|
+
*.swp
|
|
43
|
+
*.swo
|
|
44
|
+
.cursor/
|
|
45
|
+
|
|
46
|
+
# OS specific files
|
|
47
|
+
.DS_Store
|
|
48
|
+
.DS_Store?
|
|
49
|
+
._*
|
|
50
|
+
.Spotlight-V100
|
|
51
|
+
.Trashes
|
|
52
|
+
ehthumbs.db
|
|
53
|
+
Thumbs.db
|
|
54
|
+
|
|
55
|
+
# Project specific files
|
|
56
|
+
mcp_solver.log
|
|
57
|
+
uv.lock
|
|
58
|
+
mcp-solver.txt
|
|
59
|
+
tests/results/
|
|
60
|
+
CLAUDE.md
|
|
61
|
+
CLAUDE-TEST.md
|
|
62
|
+
docs/
|
|
63
|
+
tmp/
|
|
64
|
+
.mcp.json
|
|
65
|
+
LM_STUDIO_IMPLEMENTATION.md
|
|
66
|
+
local/
|
|
67
|
+
tester-report.md
|
|
68
|
+
testers_report.md
|
|
69
|
+
fix-analysis-script.patch
|
|
70
|
+
|
|
71
|
+
# Distribution / packaging
|
|
72
|
+
dist/
|
|
73
|
+
*.egg-info/
|
|
74
|
+
|
|
75
|
+
# Unit test / coverage reports
|
|
76
|
+
htmlcov/
|
|
77
|
+
.tox/
|
|
78
|
+
.nox/
|
|
79
|
+
.coverage
|
|
80
|
+
.coverage.*
|
|
81
|
+
.cache
|
|
82
|
+
nosetests.xml
|
|
83
|
+
coverage.xml
|
|
84
|
+
*.cover
|
|
85
|
+
*.py,cover
|
|
86
|
+
.hypothesis/
|
|
87
|
+
.pytest_cache/
|
|
88
|
+
cover/ docs/
|
|
89
|
+
bench_results/
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
### [4.2.0] - 2026-11-13
|
|
4
|
+
|
|
5
|
+
- **Major Change:** Published on PyPI as `agentic-mcp-solver`, since the name
|
|
6
|
+
`mcp-solver` is held by an unrelated upload (PEP 541 request pending). The
|
|
7
|
+
import package and the commands keep their names. Solve kernels fetch the
|
|
8
|
+
helper library as `agentic-mcp-solver==<version>`.
|
|
9
|
+
- **New Feature:** Supports the MCP Python SDK 2.x alongside 1.x
|
|
10
|
+
(`mcp>=1.25,<3`); requires agentic-python-coder 3.4.4 and mcp-minion 0.2.2.
|
|
11
|
+
Resource errors (for example an unknown solver) now raise `ResourceError`,
|
|
12
|
+
so their text reaches the client under mcp 2.x.
|
|
13
|
+
- **Behavior Change:** The didp backend requires didppy 0.11.1 or later
|
|
14
|
+
(`>=0.11.1,<0.12`).
|
|
15
|
+
|
|
16
|
+
### [4.1.0] - 2026-07-22
|
|
17
|
+
|
|
18
|
+
- **New Feature:** DIDP backend (domain-independent dynamic programming via
|
|
19
|
+
didppy): state-based modeling with dual-bound and dominance safety rules in
|
|
20
|
+
the template, plus four benchmark problems (knapsack, talent scheduling,
|
|
21
|
+
weighted tardiness, TSPTW) with in-validator exact oracles. The bundled
|
|
22
|
+
benchmark now spans 30 problems across six backends.
|
|
23
|
+
|
|
24
|
+
### [4.0.0] - 2026-07-14
|
|
25
|
+
|
|
26
|
+
- **Major Change:** Complete re-architecture. The solving LLM now writes, runs,
|
|
27
|
+
and verifies a real solver program in a persistent IPython kernel (the kernel
|
|
28
|
+
server of agentic-python-coder) instead of editing a model item by item
|
|
29
|
+
through protocol tools. The final program is submitted through a
|
|
30
|
+
syntax-checked gate (`submit_code`), persisted, and re-executed to produce
|
|
31
|
+
the solution JSON.
|
|
32
|
+
- **Major Change:** The MCP server (`mcp-solver-serve`) is a solver toolkit for
|
|
33
|
+
the host LLM — it runs no LLM and needs no API key: `select_backend` sets up
|
|
34
|
+
a kernel with the solver library, helpers, and modeling instructions; kernel
|
|
35
|
+
tools and `submit_code` do the rest.
|
|
36
|
+
- **Major Change:** MiniZinc mode retired; CPMpy added. Backends are now
|
|
37
|
+
PySAT, MaxSAT, Z3, CPMpy, and Clingo. The v3 MCP server lives on unchanged
|
|
38
|
+
on the `v3` branch.
|
|
39
|
+
- **New Feature:** `mcp-solver` CLI and `mcp-solver-bench` benchmark harness,
|
|
40
|
+
driven by the bundled **mcp-minion** ReAct agent (also published separately
|
|
41
|
+
on PyPI) via OpenRouter.
|
|
42
|
+
- **New Feature:** Dependency-free helper library (`mcp_solver.helpers`)
|
|
43
|
+
injected into solve-time kernels via `uv run --with`.
|
|
44
|
+
- **Improvement:** Every shipped test problem carries an output-format contract
|
|
45
|
+
and a semantic ground-truth validator; validated end-to-end on the bundled
|
|
46
|
+
26-problem benchmark and externally on CP-Bench and ASP-Bench.
|
|
47
|
+
- **Note:** Not yet installable from PyPI: the name `mcp-solver` is held by an
|
|
48
|
+
unrelated third-party upload of stale v2.0.0 code, and PyPI blocks
|
|
49
|
+
confusably similar names; a PEP 541 name-transfer request is pending. The
|
|
50
|
+
companion agent **mcp-minion** is on PyPI.
|
|
51
|
+
|
|
52
|
+
### [3.4.0] - 2025-09-13
|
|
53
|
+
|
|
54
|
+
- **New Feature:** Complete Answer Set Programming (ASP) mode implementation with Clingo solver (contributed by Luis Angel Rodriguez Reiners)
|
|
55
|
+
- Full ASP syntax support including facts, rules, constraints, and choice rules
|
|
56
|
+
- Support for optimization statements (#maximize, #minimize) and weak constraints
|
|
57
|
+
- Enhanced error handling with detailed validation messages
|
|
58
|
+
- Six comprehensive test problems demonstrating ASP capabilities
|
|
59
|
+
|
|
60
|
+
### [3.3.0] - 2025-06-10
|
|
61
|
+
|
|
62
|
+
- **New Feature:** Added MaxSAT as a 4th mode for weighted optimization problems using RC2 solver
|
|
63
|
+
- **Improvement:** Implemented exact token counting with callback handlers for better usage tracking
|
|
64
|
+
- **Update:** Replaced Black with Ruff for code formatting and linting
|
|
65
|
+
- **Improvement:** Enhanced MaxSAT and Z3 instructions with clearer guidance and examples
|
|
66
|
+
- **Fix:** Resolved error handling issues in PySAT/MaxSAT to preserve UNSAT status correctly
|
|
67
|
+
- **Update:** Added MaxSAT test infrastructure and aligned test problems with experiment6
|
|
68
|
+
- **Improvement:** Added cardinality constraint templates and helper functions for MaxSAT
|
|
69
|
+
|
|
70
|
+
### [3.2.0] - 2025-05-11
|
|
71
|
+
|
|
72
|
+
- **Improvement:** Simplified model specification by removing internal model code shortcuts (MC1, MC2, etc.)
|
|
73
|
+
- **Improvement:** Updated client to use direct model codes (AT:claude-3-7-sonnet-20250219, etc.) for better clarity
|
|
74
|
+
- **Update:** Enhanced documentation for model code formats in README.md and INSTALL.md
|
|
75
|
+
- **Update:** Added support for LM Studio local models
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### [3.1.0] - 2025-04-03
|
|
80
|
+
|
|
81
|
+
- **Improvement:** Enhanced test client with additional features for better usability and testing workflows.
|
|
82
|
+
- **Improvement:** Improved solution export for Z3 mode, providing better data representation and accessibility.
|
|
83
|
+
- **Update:** Enhanced installation documentation with more detailed setup notes and requirements
|
|
84
|
+
|
|
85
|
+
### [3.0.0] - 2025-03-28
|
|
86
|
+
|
|
87
|
+
- **Major Change:** Added PySAT mode and Z3 mode, expanding the supported constraint programming paradigms.
|
|
88
|
+
- **Major Change:** Added a standalone test client for easier testing and demonstration.
|
|
89
|
+
- **Major Change:** Lite mode is now the default mode. The additional tools have been removed from the default configuration.
|
|
90
|
+
- **Update:** The server now advertises only a reduced set of tools by default (clear_model, add_item, replace_item, delete_item, and solve_model).
|
|
91
|
+
|
|
92
|
+
### [2.3.0] - 2025-02-28
|
|
93
|
+
|
|
94
|
+
- **New Feature:** Introduced Lite Mode for the MCP Solver. When run with the `--lite` flag, the server advertises only a reduced set of tools (clear_model, add_item, replace_item, delete_item, and solve_model).
|
|
95
|
+
- **New Feature:** In Lite Mode, the `solve_model` tool returns only the status (and the solution if SAT) without additional metadata.
|
|
96
|
+
- **New Feature:** Mode-specific instruction prompts are used: `instructions_prompt_mzn.md` for MiniZinc, `instructions_prompt_pysat.md` for PySAT, and `instructions_prompt_z3.md` for Z3.
|
|
97
|
+
|
|
98
|
+
### [2.2.0] - 2025-02-15
|
|
99
|
+
|
|
100
|
+
- **New Feature:** Integrated static prompt endpoints (`prompts/list` and `prompts/get`) to advertise MCP prompt templates ("quick_prompt" and "detailed_prompt") without requiring any arguments.
|
|
101
|
+
- **New Feature:** Advertised detailed tool capabilities by adding descriptive metadata for each tool in the server's capabilities declaration.
|
|
102
|
+
- **Improvement:** Enhanced error reporting for tool endpoints with improved logging and standardized error responses.
|
|
103
|
+
- **Update:** Refactored server initialization to explicitly log the declared capabilities for greater transparency and easier debugging.
|
|
104
|
+
|
|
105
|
+
### [2.1.0] - 2025-02-09
|
|
106
|
+
|
|
107
|
+
- **Update:** Change minimum Python requirement to 3.11+ (to support `asyncio.timeout`).
|
|
108
|
+
- **Update:** Bump dependency on `mcp` to version 1.2.0 or later.
|
|
109
|
+
- **Improvement:** Update tool handler messages so that "delete_item" and "replace_item" commands correctly report the operation performed.
|
|
110
|
+
- **Update:** Miscellaneous documentation and cleanup.
|
|
111
|
+
|
|
112
|
+
### [2.0.0] - 2024-12-29
|
|
113
|
+
|
|
114
|
+
- Major change: Use item-based editing.
|
|
115
|
+
|
|
116
|
+
### [1.0.0] - 2024-12-21
|
|
117
|
+
|
|
118
|
+
- Major change: Use line-based model editing.
|
|
119
|
+
- Makes parameter handling obsolete.
|
|
120
|
+
- Added dynamic knowledge base handling.
|
|
121
|
+
|
|
122
|
+
### [0.2.1] - 2024-12-16
|
|
123
|
+
|
|
124
|
+
- Changed parameter handling.
|
|
125
|
+
|
|
126
|
+
### [0.2.0] - 2024-12-15
|
|
127
|
+
|
|
128
|
+
- Initial release.
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# MCP Solver Installation
|
|
2
|
+
|
|
3
|
+
MCP Solver v4 lets an LLM write and run real solver programs in a
|
|
4
|
+
persistent IPython kernel (the kernel server of
|
|
5
|
+
[agentic-python-coder](https://github.com/szeider/agentic-python-coder)).
|
|
6
|
+
The solving LLM is either your MCP host (Claude Desktop/Code, Cursor —
|
|
7
|
+
via `mcp-solver-serve`) or the bundled [mcp-minion](minion/) agent (via the
|
|
8
|
+
`mcp-solver` CLI). This guide covers prerequisites, the install variants,
|
|
9
|
+
verification, and common problems.
|
|
10
|
+
|
|
11
|
+
> **The PyPI package is called `agentic-mcp-solver`.** The PyPI name
|
|
12
|
+
> `mcp-solver` is held by a third-party upload of stale v2.0.0 code, and a
|
|
13
|
+
> [PEP 541](https://peps.python.org/pep-0541/) name-transfer request is
|
|
14
|
+
> pending. Do not install `mcp-solver` from PyPI. The import package
|
|
15
|
+
> (`mcp_solver`) and the commands keep their names.
|
|
16
|
+
|
|
17
|
+
> **Platform note.** v4 has so far been tested on macOS only. The Windows and
|
|
18
|
+
> Linux instructions below carry over from v3 and have not yet been
|
|
19
|
+
> re-verified under v4; an update will follow.
|
|
20
|
+
|
|
21
|
+
> Looking for the v3 MCP server (MiniZinc/PySAT/MaxSAT/Z3/ASP)? It lives on the
|
|
22
|
+
> **`v3`** branch, which keeps its own setup instructions.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Prerequisites
|
|
27
|
+
|
|
28
|
+
### Python 3.13 or 3.14
|
|
29
|
+
|
|
30
|
+
MCP Solver v4 requires Python 3.13 or 3.14. Python 3.15 does not work yet:
|
|
31
|
+
the solver kernels run on the same Python version as the server, and ortools
|
|
32
|
+
(needed by cpmpy) and python-sat publish no 3.15 wheels yet. uv picks a
|
|
33
|
+
supported version automatically from `pyproject.toml`, even when its own
|
|
34
|
+
default is 3.15.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# macOS (Homebrew)
|
|
38
|
+
brew install python@3.13
|
|
39
|
+
|
|
40
|
+
# Windows
|
|
41
|
+
winget install --id Python.Python.3.13
|
|
42
|
+
|
|
43
|
+
# Linux: install via your distribution or pyenv
|
|
44
|
+
python3.13 --version
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### uv
|
|
48
|
+
|
|
49
|
+
[uv](https://docs.astral.sh/uv/) is a hard runtime requirement, not just a
|
|
50
|
+
convenience: solver libraries and the MCP Solver helper library are supplied at
|
|
51
|
+
solve time via `uv run --with`, never pip-installed into your environment.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Verify:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
uv --version
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### OpenRouter API key (CLI path only)
|
|
64
|
+
|
|
65
|
+
The MCP server needs no API key — the host brings its own model. A key is
|
|
66
|
+
required only for the `mcp-solver` CLI and the benchmark harness, whose
|
|
67
|
+
bundled mcp-minion agent calls models through
|
|
68
|
+
[OpenRouter](https://openrouter.ai). Store the key in one of the places the
|
|
69
|
+
CLI looks:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
mkdir -p ~/.config/coder
|
|
73
|
+
echo 'OPENROUTER_API_KEY="sk-or-v1-..."' > ~/.config/coder/.env
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`OPENROUTER_API_KEY` in the environment works too, as does `~/.mcp-minion`
|
|
77
|
+
(the standalone mcp-minion CLI's location). One key serves everything.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Install
|
|
82
|
+
|
|
83
|
+
### Clone + editable (development)
|
|
84
|
+
|
|
85
|
+
The `[agent]` extra pulls in `mcp-minion` (the agent loop) and
|
|
86
|
+
`agentic-python-coder` (the IPython kernel MCP server and model aliases); the
|
|
87
|
+
bare `agentic-mcp-solver` package is only the dependency-free helper library and
|
|
88
|
+
cannot solve anything on its own.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
git clone https://github.com/szeider/mcp-solver.git
|
|
92
|
+
cd mcp-solver
|
|
93
|
+
uv venv # Python 3.13 or 3.14, per pyproject.toml
|
|
94
|
+
uv pip install -e ".[agent]" # product layer
|
|
95
|
+
uv pip install -e ".[agent,test]" # + benchmark harness and unit tests
|
|
96
|
+
# uv pip install -e ".[all]" # everything, including dev tools
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
An editable install runs in **dev mode**: the CLI auto-detects the source
|
|
100
|
+
checkout and takes both the helper library and the solver templates straight
|
|
101
|
+
from it (printing one provenance line to stderr), so nothing extra is needed to
|
|
102
|
+
run a solve. Use `--dev PATH` (or `MCP_SOLVER_DEV`) to point at a checkout
|
|
103
|
+
explicitly, or `--no-dev` to force the published (PyPI-pinned) helpers.
|
|
104
|
+
|
|
105
|
+
### From PyPI
|
|
106
|
+
|
|
107
|
+
`uv tool install --python 3.14 "agentic-mcp-solver[agent]"` installs the
|
|
108
|
+
`mcp-solver` CLI and the `mcp-solver-serve` MCP server, with no clone
|
|
109
|
+
required; the MCP server also runs without any install:
|
|
110
|
+
`uvx --python 3.14 --from "agentic-mcp-solver[agent]" mcp-solver-serve`.
|
|
111
|
+
|
|
112
|
+
The individual extras are:
|
|
113
|
+
|
|
114
|
+
| Extra | Contents |
|
|
115
|
+
| --------- | -------------------------------------------------------------- |
|
|
116
|
+
| `[agent]` | Product layer: CLI, templates, mcp-minion agent, kernel server |
|
|
117
|
+
| `[test]` | Solver libraries (python-sat, z3-solver, cpmpy, clingo, didppy) + pytest |
|
|
118
|
+
| `[dev]` | ruff |
|
|
119
|
+
| `[all]` | `[agent]` + `[test]` + `[dev]` |
|
|
120
|
+
|
|
121
|
+
### Using the local version (no PyPI involved)
|
|
122
|
+
|
|
123
|
+
The checkout is fully self-sufficient — development and testing never wait on
|
|
124
|
+
a PyPI release. Everything resolves locally: `mcp-minion` comes from the
|
|
125
|
+
`minion/` workspace member, and dev mode injects the helper library and
|
|
126
|
+
templates straight from the checkout (auto-detected; also available
|
|
127
|
+
explicitly as `--dev PATH` or `MCP_SOLVER_DEV=/path`).
|
|
128
|
+
|
|
129
|
+
Run the CLI or the benchmark harness from anywhere by pointing `uv` at the
|
|
130
|
+
checkout:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
uv run --project /path/to/mcp-solver --extra agent mcp-solver z3 "task ..."
|
|
134
|
+
uv run --project /path/to/mcp-solver --extra agent --extra test mcp-solver-bench pysat
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Use the local MCP server in an MCP host (Claude Desktop, Claude Code, Cursor)
|
|
138
|
+
with this configuration:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"mcpServers": {
|
|
143
|
+
"mcp-solver": {
|
|
144
|
+
"command": "uv",
|
|
145
|
+
"args": ["run", "--project", "/path/to/mcp-solver", "--extra", "agent", "mcp-solver-serve"]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
This is the supported development path alongside the PyPI release: `--dev`
|
|
152
|
+
always wins over the PyPI pin.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Verify
|
|
157
|
+
|
|
158
|
+
Check the CLI is available:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
mcp-solver --help
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Run your first solve (canonical example shipped in the repo):
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
mcp-solver pysat --problem tests/problems/pysat/n_queens.md
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
You should see per-step progress on stderr, a compact stats line, and the
|
|
171
|
+
solution JSON on stdout. The submitted solver program (`n_queens_code.py`) and
|
|
172
|
+
a run log (`run_*.json`) appear in the working directory.
|
|
173
|
+
|
|
174
|
+
For a full end-to-end check across all backends, run the benchmark harness:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
mcp-solver-bench pysat --runs 1
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Troubleshooting
|
|
183
|
+
|
|
184
|
+
**`mcp-solver: the agent layer is not installed`**
|
|
185
|
+
You installed the bare package without the product layer. Install the `[agent]`
|
|
186
|
+
extra: `uv pip install "agentic-mcp-solver[agent]"`, or
|
|
187
|
+
`uv pip install -e ".[agent]"` from a checkout (see [Install](#install)).
|
|
188
|
+
|
|
189
|
+
**`the ipython_mcp server does not provide submit_code`** (CLI) or
|
|
190
|
+
**`the ipython_mcp engine is unavailable or lacks submit_code`** (server)
|
|
191
|
+
Your installed `agentic-python-coder` is older than 3.4.3, or missing from
|
|
192
|
+
the environment the server runs in. Upgrade it:
|
|
193
|
+
`uv pip install "agentic-python-coder>=3.4.3"` (or `-e` from a checkout).
|
|
194
|
+
|
|
195
|
+
**`uv: command not found` (or the solve fails to start a kernel).**
|
|
196
|
+
uv is missing from your PATH. Install it (see Prerequisites) and make sure its
|
|
197
|
+
install directory (usually `~/.local/bin`) is on your `PATH`. uv is mandatory —
|
|
198
|
+
solver libraries are injected through `uv run --with`.
|
|
199
|
+
|
|
200
|
+
**`mcp-solver: no OpenRouter API key found.`**
|
|
201
|
+
The key is not being located. Either export `OPENROUTER_API_KEY` in your shell,
|
|
202
|
+
or put it in `~/.config/coder/.env` as `OPENROUTER_API_KEY="..."`. The `.env`
|
|
203
|
+
file is read even when the environment variable is unset, so the file alone is
|
|
204
|
+
enough. The same key drives both MCP Solver and the underlying engine.
|
|
205
|
+
|
|
206
|
+
**`mcp-solver: problem file not found: <path>`**
|
|
207
|
+
The path passed to `--problem` does not exist. Check the spelling and that you
|
|
208
|
+
are running from the repo root (the shipped problems live under
|
|
209
|
+
`tests/problems/<solver>/`).
|
|
210
|
+
|
|
211
|
+
**Wrong Python version.**
|
|
212
|
+
v4 needs Python 3.13 or 3.14. Check the checkout's environment with
|
|
213
|
+
`.venv/bin/python --version`. If it shows 3.15 (for example after an explicit
|
|
214
|
+
`uv venv --python 3.15`), recreate it with `uv venv --python 3.14`.
|
|
215
|
+
|
|
216
|
+
For kernel-server details and the bundled model aliases, see the
|
|
217
|
+
[agentic-python-coder README](https://github.com/szeider/agentic-python-coder);
|
|
218
|
+
for the agent loop itself, see [minion/README.md](minion/README.md).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Stefan Szeider
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|