@chapterdev/mcp-dev-studio 0.1.1 → 0.1.2
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.
- package/dist/agent/loop-skill.js +14 -3
- package/dist/cli.js +37 -2
- package/package.json +1 -1
package/dist/agent/loop-skill.js
CHANGED
|
@@ -15,9 +15,20 @@ ${p.version ? `\n<!-- Written by mcp-dev-studio ${p.version}. Update with: npx @
|
|
|
15
15
|
|
|
16
16
|
mcp-dev-studio runs saved tests against ${p.server} in real Claude Code and Codex, several times each, and records every run as an attempt. The person you're working with may have the studio open (\`npx @chapterdev/mcp-dev-studio\`); it shows each run live and the history of attempts, so leave notes that read well there.
|
|
17
17
|
|
|
18
|
+
## Start by understanding what they want
|
|
19
|
+
|
|
20
|
+
This skill can test and tune a whole server, but that's rarely the job. Begin as a collaborator, not a machine working through a checklist — ask what they're trying to do, then confirm a few things, and wait for the answers:
|
|
21
|
+
|
|
22
|
+
- **What are you trying to do?** A specific tool or skill that's misbehaving, a new one to check before it ships, a case that went wrong, or a general once-over? Scope the work to that. One flaky tool isn't a reason to rewrite every description.
|
|
23
|
+
- **Which server?** Test a **local or development** server. Never point tests at a production URL, and never read, reuse, or forge credentials to reach one (no secrets from the environment, keychains, or a cloud project). If the only server you can reach is production, stop and ask them to start a local one.
|
|
24
|
+
- **Read-only, or may tests change data?** By default, hide every tool that spends money, sends messages, or creates, changes, or deletes data (set \`hidden\` in the overrides), and tell them which you hid. Test a write tool only once they confirm the target is safe to change.
|
|
25
|
+
- **Watch it live?** Offer to open the studio so they can follow along: \`npx @chapterdev/mcp-dev-studio open\`. It opens the UI for this folder (starting it if needed) and returns, so you can keep working.
|
|
26
|
+
|
|
27
|
+
Keep it a conversation: say what you find, and check in before big or broad changes rather than reworking everything at once.
|
|
28
|
+
|
|
18
29
|
## Write tests that can fail
|
|
19
30
|
|
|
20
|
-
The loop only finds what the tests probe, and happy-path tests usually pass.
|
|
31
|
+
The loop only finds what the tests probe, and happy-path tests usually pass. For the tools and skills behind what they asked about, read the descriptions and parameters and list the weak spots you see, then write at least one test aimed at each. Note weak spots outside that scope, but raise them rather than fixing everything unasked.
|
|
21
32
|
|
|
22
33
|
- **Vague or missing parameter descriptions**: ask the way a person would, not the way the schema wants. If a parameter takes an id but doesn't say so, ask to act on the item by its name.
|
|
23
34
|
- **Bare tool descriptions**: a prompt that needs what the description leaves out, like allowed values or formats.
|
|
@@ -26,11 +37,11 @@ The loop only finds what the tests probe, and happy-path tests usually pass. Bef
|
|
|
26
37
|
|
|
27
38
|
Make the checks strict enough to catch the agent working around the flaw. A capable agent recovers from a failed call with extra lookups and still gets there, so set \`maxToolCalls\` to what a clear description would need, or have \`judge\` require no failed tool calls.
|
|
28
39
|
|
|
29
|
-
Test
|
|
40
|
+
Test in the agent you're running in — you're Claude Code or Codex, so use that one (\`--host claude-code\` or \`--host codex\`). Don't ask which; the person can ask you to compare others.
|
|
30
41
|
|
|
31
42
|
## The loop
|
|
32
43
|
|
|
33
|
-
1. **Baseline.** \`npx @chapterdev/mcp-dev-studio eval --json --host
|
|
44
|
+
1. **Baseline.** \`npx @chapterdev/mcp-dev-studio eval --json --host <the agent you're in> --note "baseline"\` (add other agents only if they ask)
|
|
34
45
|
2. **Read why it failed.** In the JSON, each failing test has \`failures\` (check, detail, how many runs) and \`transcripts\`. Open a transcript before guessing: \`events\` shows every tool call and what the agent said.
|
|
35
46
|
3. **Change one thing** that explains the failure (see "What to change").
|
|
36
47
|
4. **Rerun what failed**, saying what you changed: \`npx @chapterdev/mcp-dev-studio eval --json --failed --host <same hosts> --note "<the change, in a few words>"\`. \`sinceLastAttempt.tests\` says which tests were fixed or broke.
|
package/dist/cli.js
CHANGED
|
@@ -34,6 +34,7 @@ Usage (run with npx @chapterdev/mcp-dev-studio …)
|
|
|
34
34
|
mcp-dev-studio "node server.js" A stdio server
|
|
35
35
|
mcp-dev-studio http://localhost:3001/mcp An HTTP server (Streamable HTTP, falls back to SSE)
|
|
36
36
|
mcp-dev-studio demo Built-in messy SaaS MCP server
|
|
37
|
+
mcp-dev-studio open Open the studio for this folder (start it if needed)
|
|
37
38
|
mcp-dev-studio eval [--journey <name>] Run saved tests in real agents, print pass rates
|
|
38
39
|
mcp-dev-studio setup Teach Claude Code / Codex here to iterate with the studio
|
|
39
40
|
mcp-dev-studio proxy --stdio "<cmd>" | --url Transparent MCP proxy that records usage
|
|
@@ -59,7 +60,7 @@ Options
|
|
|
59
60
|
Keys: ANTHROPIC_API_KEY / OPENAI_API_KEY, or Settings in the UI.`;
|
|
60
61
|
async function main() {
|
|
61
62
|
const argv = process.argv.slice(2);
|
|
62
|
-
const COMMANDS = ['serve', 'eval', 'proxy', 'demo-server', 'skill', 'setup'];
|
|
63
|
+
const COMMANDS = ['serve', 'eval', 'proxy', 'demo-server', 'skill', 'setup', 'open'];
|
|
63
64
|
const command = argv[0] && COMMANDS.includes(argv[0]) ? argv.shift() : 'serve';
|
|
64
65
|
const { values, positionals } = parseArgs({
|
|
65
66
|
args: argv,
|
|
@@ -101,7 +102,7 @@ async function main() {
|
|
|
101
102
|
await import('./demo/stdio.js');
|
|
102
103
|
return;
|
|
103
104
|
}
|
|
104
|
-
if (!['serve', 'eval', 'proxy', 'skill', 'setup'].includes(command)) {
|
|
105
|
+
if (!['serve', 'eval', 'proxy', 'skill', 'setup', 'open'].includes(command)) {
|
|
105
106
|
console.error(`Unknown command "${command}".\n\n${HELP}`);
|
|
106
107
|
process.exit(2);
|
|
107
108
|
}
|
|
@@ -142,6 +143,40 @@ async function main() {
|
|
|
142
143
|
console.log(`\n Claude Code and Codex in this folder now know how to test and tune your server with mcp-dev-studio.\n Try: "test how agents use this server and fix what fails" · keep \`npx @chapterdev/mcp-dev-studio\` open to watch\n`);
|
|
143
144
|
return;
|
|
144
145
|
}
|
|
146
|
+
// ── open: make a studio for this folder appear (starting one in the background if needed) ──
|
|
147
|
+
// So an agent mid-loop can show the person the UI and keep working: this returns, the studio stays up.
|
|
148
|
+
if (command === 'open') {
|
|
149
|
+
const first = Number(values.port ?? process.env.PORT ?? 4300);
|
|
150
|
+
const studioFor = (p) => fetch(`http://127.0.0.1:${p}/api/state`, { signal: AbortSignal.timeout(800) })
|
|
151
|
+
.then((r) => r.json())
|
|
152
|
+
.then((st) => (st.project === project ? p : undefined))
|
|
153
|
+
.catch(() => undefined);
|
|
154
|
+
const find = async () => {
|
|
155
|
+
for (let p = first; p < first + 20; p++) {
|
|
156
|
+
const hit = await studioFor(p);
|
|
157
|
+
if (hit)
|
|
158
|
+
return hit;
|
|
159
|
+
}
|
|
160
|
+
return undefined;
|
|
161
|
+
};
|
|
162
|
+
let port = await find();
|
|
163
|
+
if (!port) {
|
|
164
|
+
// Start `serve` detached; it outlives this command. Pass through the same connection flags.
|
|
165
|
+
spawn(process.execPath, [process.argv[1], 'serve', ...argv.filter((a) => a !== '--no-open'), '--no-open'], { stdio: 'ignore', detached: true }).on('error', () => { }).unref();
|
|
166
|
+
for (let i = 0; i < 40 && !port; i++) {
|
|
167
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
168
|
+
port = await find();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (!port) {
|
|
172
|
+
console.error('\n Could not start the studio. Run `npx @chapterdev/mcp-dev-studio` yourself to see why.\n');
|
|
173
|
+
process.exit(1);
|
|
174
|
+
}
|
|
175
|
+
const openUrl = `http://localhost:${port}`;
|
|
176
|
+
console.log(`\n Studio open for this folder.\n\n → ${openUrl}\n`);
|
|
177
|
+
openBrowser(openUrl);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
145
180
|
/** What to connect to without asking, and why (for the startup banner). */
|
|
146
181
|
const choose = async () => {
|
|
147
182
|
if (demo)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chapterdev/mcp-dev-studio",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Test your MCP server and skills in real Claude Code and Codex, watch every run live, and let Claude iterate until they pass.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Chapter Dev Pty Ltd",
|