supercodemode 0.1.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.
- supercodemode-0.1.0/LICENSE +183 -0
- supercodemode-0.1.0/PKG-INFO +439 -0
- supercodemode-0.1.0/README.md +415 -0
- supercodemode-0.1.0/pyproject.toml +43 -0
- supercodemode-0.1.0/setup.cfg +4 -0
- supercodemode-0.1.0/supercodemode/__init__.py +5 -0
- supercodemode-0.1.0/supercodemode/cli.py +199 -0
- supercodemode-0.1.0/supercodemode/common.py +61 -0
- supercodemode-0.1.0/supercodemode/doctor.py +208 -0
- supercodemode-0.1.0/supercodemode/engine.py +369 -0
- supercodemode-0.1.0/supercodemode/env.py +9 -0
- supercodemode-0.1.0/supercodemode/executors.py +271 -0
- supercodemode-0.1.0/supercodemode/gepa_compat/__init__.py +3 -0
- supercodemode-0.1.0/supercodemode/gepa_compat/code_mode_adapter.py +306 -0
- supercodemode-0.1.0/supercodemode/io_utils.py +69 -0
- supercodemode-0.1.0/supercodemode/mcp_client_demo.py +58 -0
- supercodemode-0.1.0/supercodemode/observability.py +356 -0
- supercodemode-0.1.0/supercodemode/runners.py +636 -0
- supercodemode-0.1.0/supercodemode/servers/demo_mcp_server.py +50 -0
- supercodemode-0.1.0/supercodemode.egg-info/PKG-INFO +439 -0
- supercodemode-0.1.0/supercodemode.egg-info/SOURCES.txt +23 -0
- supercodemode-0.1.0/supercodemode.egg-info/dependency_links.txt +1 -0
- supercodemode-0.1.0/supercodemode.egg-info/entry_points.txt +2 -0
- supercodemode-0.1.0/supercodemode.egg-info/requires.txt +16 -0
- supercodemode-0.1.0/supercodemode.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
|
13
|
+
owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities
|
|
16
|
+
that control, are controlled by, or are under common control with that entity.
|
|
17
|
+
For the purposes of this definition, "control" means (i) the power, direct or
|
|
18
|
+
indirect, to cause the direction or management of such entity, whether by
|
|
19
|
+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
20
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
21
|
+
|
|
22
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
23
|
+
permissions granted by this License.
|
|
24
|
+
|
|
25
|
+
"Source" form shall mean the preferred form for making modifications, including
|
|
26
|
+
but not limited to software source code, documentation source, and configuration
|
|
27
|
+
files.
|
|
28
|
+
|
|
29
|
+
"Object" form shall mean any form resulting from mechanical transformation or
|
|
30
|
+
translation of a Source form, including but not limited to compiled object code,
|
|
31
|
+
generated documentation, and conversions to other media types.
|
|
32
|
+
|
|
33
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made
|
|
34
|
+
available under the License, as indicated by a copyright notice that is included
|
|
35
|
+
in or attached to the work (an example is provided in the Appendix below).
|
|
36
|
+
|
|
37
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
|
38
|
+
is based on (or derived from) the Work and for which the editorial revisions,
|
|
39
|
+
annotations, elaborations, or other modifications represent, as a whole, an
|
|
40
|
+
original work of authorship. For the purposes of this License, Derivative Works
|
|
41
|
+
shall not include works that remain separable from, or merely link (or bind by
|
|
42
|
+
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean any work of authorship, including the original version
|
|
45
|
+
of the Work and any modifications or additions to that Work or Derivative Works
|
|
46
|
+
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
|
47
|
+
by the copyright owner or by an individual or Legal Entity authorized to submit
|
|
48
|
+
on behalf of the copyright owner. For the purposes of this definition,
|
|
49
|
+
"submitted" means any form of electronic, verbal, or written communication sent
|
|
50
|
+
to the Licensor or its representatives, including but not limited to
|
|
51
|
+
communication on electronic mailing lists, source code control systems, and
|
|
52
|
+
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
|
53
|
+
the purpose of discussing and improving the Work, but excluding communication
|
|
54
|
+
that is conspicuously marked or otherwise designated in writing by the copyright
|
|
55
|
+
owner as "Not a Contribution."
|
|
56
|
+
|
|
57
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
|
58
|
+
of whom a Contribution has been received by Licensor and subsequently
|
|
59
|
+
incorporated within the Work.
|
|
60
|
+
|
|
61
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
62
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
63
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
64
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
65
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
66
|
+
Object form.
|
|
67
|
+
|
|
68
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License,
|
|
69
|
+
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
|
|
70
|
+
no-charge, royalty-free, irrevocable (except as stated in this section) patent
|
|
71
|
+
license to make, have made, use, offer to sell, sell, import, and otherwise
|
|
72
|
+
transfer the Work, where such license applies only to those patent claims
|
|
73
|
+
licensable by such Contributor that are necessarily infringed by their
|
|
74
|
+
Contribution(s) alone or by combination of their Contribution(s) with the Work
|
|
75
|
+
to which such Contribution(s) was submitted. If You institute patent litigation
|
|
76
|
+
against any entity (including a cross-claim or counterclaim in a lawsuit)
|
|
77
|
+
alleging that the Work or a Contribution incorporated within the Work
|
|
78
|
+
constitutes direct or contributory patent infringement, then any patent licenses
|
|
79
|
+
granted to You under this License for that Work shall terminate as of the date
|
|
80
|
+
such litigation is filed.
|
|
81
|
+
|
|
82
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
83
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
84
|
+
Source or Object form, provided that You meet the following conditions:
|
|
85
|
+
|
|
86
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy of
|
|
87
|
+
this License; and
|
|
88
|
+
|
|
89
|
+
(b) You must cause any modified files to carry prominent notices stating that
|
|
90
|
+
You changed the files; and
|
|
91
|
+
|
|
92
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
93
|
+
distribute, all copyright, patent, trademark, and attribution notices from the
|
|
94
|
+
Source form of the Work, excluding those notices that do not pertain to any part
|
|
95
|
+
of the Derivative Works; and
|
|
96
|
+
|
|
97
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then
|
|
98
|
+
any Derivative Works that You distribute must include a readable copy of the
|
|
99
|
+
attribution notices contained within such NOTICE file, excluding those notices
|
|
100
|
+
that do not pertain to any part of the Derivative Works, in at least one of the
|
|
101
|
+
following places: within a NOTICE text file distributed as part of the
|
|
102
|
+
Derivative Works; within the Source form or documentation, if provided along
|
|
103
|
+
with the Derivative Works; or, within a display generated by the Derivative
|
|
104
|
+
Works, if and wherever such third-party notices normally appear. The contents of
|
|
105
|
+
the NOTICE file are for informational purposes only and do not modify the
|
|
106
|
+
License. You may add Your own attribution notices within Derivative Works that
|
|
107
|
+
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
|
108
|
+
provided that such additional attribution notices cannot be construed as
|
|
109
|
+
modifying the License.
|
|
110
|
+
|
|
111
|
+
You may add Your own copyright statement to Your modifications and may provide
|
|
112
|
+
additional or different license terms and conditions for use, reproduction, or
|
|
113
|
+
distribution of Your modifications, or for any such Derivative Works as a whole,
|
|
114
|
+
provided Your use, reproduction, and distribution of the Work otherwise complies
|
|
115
|
+
with the conditions stated in this License.
|
|
116
|
+
|
|
117
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
118
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
119
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
120
|
+
additional terms or conditions. Notwithstanding the above, nothing herein shall
|
|
121
|
+
supersede or modify the terms of any separate license agreement you may have
|
|
122
|
+
executed with Licensor regarding such Contributions.
|
|
123
|
+
|
|
124
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
125
|
+
trademarks, service marks, or product names of the Licensor, except as required
|
|
126
|
+
for reasonable and customary use in describing the origin of the Work and
|
|
127
|
+
reproducing the content of the NOTICE file.
|
|
128
|
+
|
|
129
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
130
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
131
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
132
|
+
KIND, either express or implied, including, without limitation, any warranties
|
|
133
|
+
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
134
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
135
|
+
appropriateness of using or redistributing the Work and assume any risks
|
|
136
|
+
associated with Your exercise of permissions under this License.
|
|
137
|
+
|
|
138
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
139
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
140
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to in
|
|
141
|
+
writing, shall any Contributor be liable to You for damages, including any
|
|
142
|
+
direct, indirect, special, incidental, or consequential damages of any
|
|
143
|
+
character arising as a result of this License or out of the use or inability to
|
|
144
|
+
use the Work (including but not limited to damages for loss of goodwill,
|
|
145
|
+
work stoppage, computer failure or malfunction, or any and all other commercial
|
|
146
|
+
damages or losses), even if such Contributor has been advised of the possibility
|
|
147
|
+
of such damages.
|
|
148
|
+
|
|
149
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
|
150
|
+
Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
151
|
+
acceptance of support, warranty, indemnity, or other liability obligations
|
|
152
|
+
and/or rights consistent with this License. However, in accepting such
|
|
153
|
+
obligations, You may act only on Your own behalf and on Your sole
|
|
154
|
+
responsibility, not on behalf of any other Contributor, and only if You agree to
|
|
155
|
+
indemnify, defend, and hold each Contributor harmless for any liability incurred
|
|
156
|
+
by, or claims asserted against, such Contributor by reason of your accepting any
|
|
157
|
+
such warranty or additional liability.
|
|
158
|
+
|
|
159
|
+
END OF TERMS AND CONDITIONS
|
|
160
|
+
|
|
161
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
162
|
+
|
|
163
|
+
To apply the Apache License to your work, attach the following boilerplate
|
|
164
|
+
notice, with the fields enclosed by brackets "[]" replaced with your own
|
|
165
|
+
identifying information. (Don't include the brackets!) The text should be
|
|
166
|
+
enclosed in the appropriate comment syntax for the file format. We also
|
|
167
|
+
recommend that a file or class name and description of purpose be included on the
|
|
168
|
+
same "printed page" as the copyright notice for easier identification within
|
|
169
|
+
third-party archives.
|
|
170
|
+
|
|
171
|
+
Copyright 2026 SuperCodeMode Contributors
|
|
172
|
+
|
|
173
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
174
|
+
you may not use this file except in compliance with the License.
|
|
175
|
+
You may obtain a copy of the License at
|
|
176
|
+
|
|
177
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
178
|
+
|
|
179
|
+
Unless required by applicable law or agreed to in writing, software
|
|
180
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
181
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
182
|
+
See the License for the specific language governing permissions and
|
|
183
|
+
limitations under the License.
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: supercodemode
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Super Code Mode: MCP/Cloudflare adapters and GEPA optimization harness
|
|
5
|
+
Author-email: Shashi Jagtap <shashi@super-agentic.ai>
|
|
6
|
+
Maintainer-email: Shashi Jagtap <shashi@super-agentic.ai>
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: gepa
|
|
11
|
+
Requires-Dist: mcp
|
|
12
|
+
Provides-Extra: dev
|
|
13
|
+
Provides-Extra: monty
|
|
14
|
+
Requires-Dist: pydantic-monty; extra == "monty"
|
|
15
|
+
Provides-Extra: observability
|
|
16
|
+
Requires-Dist: opentelemetry-api; extra == "observability"
|
|
17
|
+
Requires-Dist: opentelemetry-sdk; extra == "observability"
|
|
18
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http; extra == "observability"
|
|
19
|
+
Requires-Dist: logfire; extra == "observability"
|
|
20
|
+
Requires-Dist: mlflow; extra == "observability"
|
|
21
|
+
Requires-Dist: langsmith; extra == "observability"
|
|
22
|
+
Requires-Dist: langfuse; extra == "observability"
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# Super Code Mode (`supercodemode`)
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<img src="https://raw.githubusercontent.com/SuperagenticAI/supercodemode/main/assets/supercodemode.png" alt="SuperCodeMode" width="220">
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
[](https://pypi.org/project/supercodemode/)
|
|
32
|
+
[](https://pypi.org/project/supercodemode/)
|
|
33
|
+
[](LICENSE)
|
|
34
|
+
[](https://github.com/SuperagenticAI/supercodemode/actions/workflows/ci.yml)
|
|
35
|
+
[](https://github.com/SuperagenticAI/supercodemode/actions/workflows/deploy-docs.yml)
|
|
36
|
+
[](https://superagenticai.github.io/supercodemode/)
|
|
37
|
+
|
|
38
|
+
SuperCodeMode is a Python CLI and demo harness for optimizing Code Mode style
|
|
39
|
+
client behavior in MCP workflows with GEPA.
|
|
40
|
+
|
|
41
|
+
It focuses on improving the text and routing policy around a small tool surface
|
|
42
|
+
(typically discovery + execution), so agents make better tool choices and
|
|
43
|
+
produce more reliable results.
|
|
44
|
+
|
|
45
|
+
## What This Project Solves
|
|
46
|
+
|
|
47
|
+
Many tool systems fail because the client logic is weak even when the tools are
|
|
48
|
+
good.
|
|
49
|
+
|
|
50
|
+
Typical failures:
|
|
51
|
+
|
|
52
|
+
- execution tool is used too early
|
|
53
|
+
- discovery step is skipped
|
|
54
|
+
- execution instructions are vague
|
|
55
|
+
- final answers are noisy or inconsistent
|
|
56
|
+
|
|
57
|
+
SuperCodeMode gives you a repeatable GEPA-driven optimization loop to improve
|
|
58
|
+
those behaviors.
|
|
59
|
+
|
|
60
|
+
## Who This Is For
|
|
61
|
+
|
|
62
|
+
- Cloudflare Code Mode MCP users
|
|
63
|
+
- MCP users running discovery + execution style tool patterns
|
|
64
|
+
- platform engineers and evaluation teams
|
|
65
|
+
- teams experimenting with Code Mode style agent behavior before changing server code
|
|
66
|
+
|
|
67
|
+
## What Is Included
|
|
68
|
+
|
|
69
|
+
- MCP stdio runner for local workflows
|
|
70
|
+
- MCP streamable HTTP runner for direct Cloudflare MCP
|
|
71
|
+
- HTTP bridge runner for custom runtime bridges
|
|
72
|
+
- local, Docker, and Monty execution backends in the demo MCP server
|
|
73
|
+
- `scm doctor` preflight checks
|
|
74
|
+
- artifact saving for showcase/optimization runs
|
|
75
|
+
- observability output (JSONL and OTLP)
|
|
76
|
+
|
|
77
|
+
## What "Code Mode" Means Here
|
|
78
|
+
|
|
79
|
+
Code Mode here means a code-first MCP orchestration pattern where the model uses
|
|
80
|
+
a small tool surface and generates code for multi-step work.
|
|
81
|
+
|
|
82
|
+
Background:
|
|
83
|
+
|
|
84
|
+
- Cloudflare Code Mode MCP blog: https://blog.cloudflare.com/code-mode-mcp/
|
|
85
|
+
- UTCP Code Mode implementation: https://github.com/universal-tool-calling-protocol/code-mode
|
|
86
|
+
|
|
87
|
+
## Install
|
|
88
|
+
|
|
89
|
+
From PyPI:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pip install supercodemode
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
With `uv` (tool install, recommended for CLI usage):
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
uv tool install supercodemode
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
With `uv` (current environment):
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
uv pip install supercodemode
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Optional Monty executor backend:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pip install "supercodemode[monty]"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
With `uv`:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
uv pip install "supercodemode[monty]"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Optional observability integrations (LangSmith, Logfire, MLflow, Langfuse):
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
pip install "supercodemode[observability]"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
With `uv`:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
uv pip install "supercodemode[observability]"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Then verify install:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
scm --help
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
For local development:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
pip install -e .
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
With `uv`:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
uv pip install -e .
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Quick Start
|
|
150
|
+
|
|
151
|
+
Check your environment:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
scm doctor
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Run a Cloudflare MCP showcase (defaults to `https://mcp.cloudflare.com/mcp`):
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
scm showcase --runner mcp-http
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Run a local MCP showcase (demo server over stdio):
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
scm showcase --runner mcp-stdio
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
If Cloudflare MCP requires auth in your environment:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
scm showcase --runner mcp-http --auth-bearer "$CODEMODE_TOKEN"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## What You Can Optimize
|
|
176
|
+
|
|
177
|
+
SuperCodeMode uses GEPA to optimize Code Mode client-side text such as:
|
|
178
|
+
|
|
179
|
+
- system prompt text
|
|
180
|
+
- Code Mode description / routing guidance
|
|
181
|
+
- tool alias mappings
|
|
182
|
+
- tool description overrides
|
|
183
|
+
|
|
184
|
+
This improves client behavior without requiring server/runtime code changes.
|
|
185
|
+
|
|
186
|
+
## How It Works (High Level)
|
|
187
|
+
|
|
188
|
+
SuperCodeMode demonstrates a GEPA-centric adapter approach where:
|
|
189
|
+
|
|
190
|
+
1. GEPA optimizes client text policy
|
|
191
|
+
2. runners execute tools on MCP or HTTP runtimes
|
|
192
|
+
3. the same optimization logic can be reused across local and remote transports
|
|
193
|
+
|
|
194
|
+
This keeps GEPA optimization logic separate from runtime transport details.
|
|
195
|
+
|
|
196
|
+
## Common Commands
|
|
197
|
+
|
|
198
|
+
### Preflight
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
scm doctor
|
|
202
|
+
scm doctor --json
|
|
203
|
+
scm doctor --strict
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Showcase runs (baseline vs tuned)
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
scm showcase --runner mcp-http
|
|
210
|
+
scm showcase --runner mcp-stdio
|
|
211
|
+
scm showcase --runner mcp-stdio --executor-backend monty
|
|
212
|
+
scm showcase --runner mcp-stdio --executor-backend docker
|
|
213
|
+
scm showcase --runner http --endpoint http://localhost:8080/run-codemode
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Note: `showcase` is an active CLI command. The removed `showcase/` directory was
|
|
217
|
+
an older repo layout, not the `scm showcase` command.
|
|
218
|
+
|
|
219
|
+
### Optimization runs
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
scm optimize --runner mcp-http --max-metric-calls 10
|
|
223
|
+
scm optimize --runner mcp-stdio --max-metric-calls 10
|
|
224
|
+
scm optimize --runner mcp-stdio --executor-backend monty --max-metric-calls 10
|
|
225
|
+
scm optimize --runner mcp-stdio --executor-backend docker --max-metric-calls 10
|
|
226
|
+
scm optimize --runner http --endpoint http://localhost:8080/run-codemode --max-metric-calls 10
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Save artifacts:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
scm showcase --runner mcp-stdio --save-artifact
|
|
233
|
+
scm optimize --runner mcp-http --max-metric-calls 10 --save-artifact
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
When `--save-artifact` is enabled, SuperCodeMode also writes compact summary files:
|
|
237
|
+
|
|
238
|
+
- showcase: `comparison_summary`, `baseline_run_summary`, `tuned_run_summary`
|
|
239
|
+
- optimize: `run_summary`
|
|
240
|
+
- benchmark: `benchmark_summary` + per-variant `run_summary`
|
|
241
|
+
|
|
242
|
+
### Direct MCP connectivity checks
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
scm mcp-client
|
|
246
|
+
scm mcp-client --executor-backend monty
|
|
247
|
+
scm mcp-client --executor-backend docker
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Strategy benchmark (tool-call vs Code Mode)
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
scm benchmark --runner mcp-stdio
|
|
254
|
+
scm benchmark --runner mcp-stdio --executor-backend monty
|
|
255
|
+
scm benchmark --runner mcp-http
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
This compares three policy profiles on the same runner/dataset:
|
|
259
|
+
|
|
260
|
+
- `tool_call` (naive execution-first policy)
|
|
261
|
+
- `codemode_baseline`
|
|
262
|
+
- `codemode_optimized`
|
|
263
|
+
|
|
264
|
+
## Examples
|
|
265
|
+
|
|
266
|
+
All runnable examples are under `examples/`.
|
|
267
|
+
|
|
268
|
+
Recommended starting points:
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
python examples/showcase_mcp_cloudflare.py
|
|
272
|
+
python examples/showcase_mcp_stdio.py
|
|
273
|
+
python examples/optimize_mcp_cloudflare.py --max-metric-calls 10
|
|
274
|
+
python examples/optimize_mcp_stdio.py --max-metric-calls 10
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Real LLM optimization demo (Gemini, low-cost settings):
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
export GOOGLE_API_KEY=your_key_here
|
|
281
|
+
python examples/optimize_gemini_flash.py --max-metric-calls 4
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Full example list:
|
|
285
|
+
|
|
286
|
+
- Examples README (GitHub): https://github.com/SuperagenticAI/supercodemode/blob/main/examples/README.md
|
|
287
|
+
- Examples guide (Docs): https://superagenticai.github.io/supercodemode/guides/examples/
|
|
288
|
+
|
|
289
|
+
## Cloudflare MCP Notes
|
|
290
|
+
|
|
291
|
+
- `mcp-http` runner defaults to `https://mcp.cloudflare.com/mcp`
|
|
292
|
+
- Cloudflare MCP may require auth for your usage:
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
scm showcase --runner mcp-http --auth-bearer "$CODEMODE_TOKEN"
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
- Demo scoring can show `0.5` even when integration works if Cloudflare returns
|
|
299
|
+
structured JSON for `search` and the metric expects a literal keyword match
|
|
300
|
+
|
|
301
|
+
In that case, the primary success signal is:
|
|
302
|
+
|
|
303
|
+
- case 1 selects `search`
|
|
304
|
+
- case 2 selects `execute`
|
|
305
|
+
- case 2 returns `42`
|
|
306
|
+
|
|
307
|
+
## Local, Docker, and Monty Execution
|
|
308
|
+
|
|
309
|
+
Use Monty for a Python-native sandboxed execution path in demo MCP flows:
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
scm showcase --runner mcp-stdio --executor-backend monty
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
Requirements:
|
|
316
|
+
|
|
317
|
+
- install `pydantic-monty` (or `pip install "supercodemode[monty]"`)
|
|
318
|
+
|
|
319
|
+
Use Docker for safer local code execution in demo MCP flows:
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
scm showcase --runner mcp-stdio --executor-backend docker
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Requirements:
|
|
326
|
+
|
|
327
|
+
- Docker daemon running
|
|
328
|
+
- your user can run `docker run`
|
|
329
|
+
|
|
330
|
+
## Observability
|
|
331
|
+
|
|
332
|
+
JSONL:
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
scm --obs-backend jsonl --obs-jsonl-path artifacts/obs.jsonl showcase --runner mcp-stdio
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
OTLP:
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
scm --obs-backend otlp --obs-otlp-endpoint http://localhost:4318/v1/traces showcase --runner mcp-stdio
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Optional SDK backends (same event schema, best-effort adapters):
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
scm --obs-backend logfire showcase --runner mcp-stdio
|
|
348
|
+
scm --obs-backend mlflow showcase --runner mcp-stdio
|
|
349
|
+
scm --obs-backend langsmith showcase --runner mcp-stdio
|
|
350
|
+
scm --obs-backend langfuse showcase --runner mcp-stdio
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Install optional integrations:
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
pip install "supercodemode[observability]"
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Environment variables (alternative to CLI flags):
|
|
360
|
+
|
|
361
|
+
- `SCM_OBS_BACKEND=none|jsonl|otlp|logfire|mlflow|langsmith|langfuse`
|
|
362
|
+
- `SCM_OBS_JSONL_PATH=artifacts/obs.jsonl`
|
|
363
|
+
- `SCM_OBS_OTLP_ENDPOINT=http://localhost:4318/v1/traces`
|
|
364
|
+
- `SCM_RUN_ID=demo-run-001`
|
|
365
|
+
- `SCM_OBS_DATASET_NAME=two_tool_dataset` (optional)
|
|
366
|
+
- `SCM_OBS_TAGS_JSON='{"env":"dev","team":"research"}'` (optional)
|
|
367
|
+
|
|
368
|
+
Event payloads include GEPA/Code Mode run fields such as selected tool, tool call
|
|
369
|
+
count, score, and error state, and the saved summary artifacts provide compact
|
|
370
|
+
rollups for comparisons and quick benchmarking.
|
|
371
|
+
|
|
372
|
+
CLI commands also stamp command context into events (for example `cli_command`,
|
|
373
|
+
`cli_runner`, and `cli_executor_backend`) to make JSONL/OTLP filtering easier.
|
|
374
|
+
|
|
375
|
+
Benchmark and run summaries also include:
|
|
376
|
+
|
|
377
|
+
- runtime capability hints (for example local vs docker vs monty constraints)
|
|
378
|
+
- error taxonomy rollups (`error_categories`) for quick failure analysis
|
|
379
|
+
|
|
380
|
+
## Relationship to GEPA
|
|
381
|
+
|
|
382
|
+
This repo is the end-to-end GEPA optimization demo and experimentation harness
|
|
383
|
+
for the GEPA Code Mode adapter work (examples, CLI, docs, local/docker/monty
|
|
384
|
+
execution, observability).
|
|
385
|
+
|
|
386
|
+
GEPA docs (main site): https://gepa-ai.github.io/gepa/
|
|
387
|
+
|
|
388
|
+
GEPA PR (status may change):
|
|
389
|
+
|
|
390
|
+
- `https://github.com/gepa-ai/gepa/pull/225`
|
|
391
|
+
|
|
392
|
+
Whether the adapter lands in GEPA mainline now or later, SuperCodeMode can be
|
|
393
|
+
used directly for GEPA-based optimization of Code Mode behavior.
|
|
394
|
+
|
|
395
|
+
## What Is Not Included by Default
|
|
396
|
+
|
|
397
|
+
- automatic server code mutation
|
|
398
|
+
- automatic deploy pipelines for MCP servers
|
|
399
|
+
- provider-specific server-side optimization logic
|
|
400
|
+
|
|
401
|
+
This project is focused on client-side behavior optimization and runnable demos.
|
|
402
|
+
|
|
403
|
+
## Documentation
|
|
404
|
+
|
|
405
|
+
- Docs homepage: https://superagenticai.github.io/supercodemode/
|
|
406
|
+
- Getting started: https://superagenticai.github.io/supercodemode/getting-started/
|
|
407
|
+
- Examples and guides: https://superagenticai.github.io/supercodemode/guides/
|
|
408
|
+
- CLI reference: https://superagenticai.github.io/supercodemode/reference/cli/
|
|
409
|
+
- Operations: https://superagenticai.github.io/supercodemode/operations/
|
|
410
|
+
|
|
411
|
+
Run docs locally:
|
|
412
|
+
|
|
413
|
+
```bash
|
|
414
|
+
mkdocs serve
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
Build docs:
|
|
418
|
+
|
|
419
|
+
```bash
|
|
420
|
+
mkdocs build
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
## Development Notes
|
|
424
|
+
|
|
425
|
+
- `scm` uses installed `gepa` and `mcp` from your environment
|
|
426
|
+
- a vendored GEPA contribution snapshot exists in `vendor/gepa_new_files`
|
|
427
|
+
- refresh vendor snapshot with:
|
|
428
|
+
- `GEPA_SOURCE_DIR=/path/to/gepa ./scripts/sync_gepa_vendor.sh`
|
|
429
|
+
|
|
430
|
+
## Release (Maintainers)
|
|
431
|
+
|
|
432
|
+
Build and publish with `uv`:
|
|
433
|
+
|
|
434
|
+
```bash
|
|
435
|
+
uv build
|
|
436
|
+
uv publish
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
If publishing to PyPI, make sure your credentials/token are configured for `uv publish`.
|