@usercase/mcp 0.2.10-next.3 → 0.2.10-next.4
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/README.md +8 -0
- package/mcp/server.js +26 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,6 +67,14 @@ The number is how many people visit in total (default 5). Above 5, Claude works
|
|
|
67
67
|
|
|
68
68
|
With `unlimited` it keeps going until you press Esc. Every visit uses your Claude usage.
|
|
69
69
|
|
|
70
|
+
### Take part in a research
|
|
71
|
+
|
|
72
|
+
Give a research id from your dashboard and the people take part in it instead of exploring freely — they accept its invitation and do its tasks from the study panel, the way invited participants do. The research must be live.
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
/mcp__usercase__research https://staging.example.com 10 research=<research id>
|
|
76
|
+
```
|
|
77
|
+
|
|
70
78
|
When a visit ends, it is sent to your dashboard (**Visits**). If the upload fails, it is kept in `.usercase/outbox.jsonl` and sent with the next one.
|
|
71
79
|
|
|
72
80
|
### Sites behind a sign-in
|
package/mcp/server.js
CHANGED
|
@@ -928,6 +928,30 @@ const pathWalkRules = () => {
|
|
|
928
928
|
.trim();
|
|
929
929
|
};
|
|
930
930
|
|
|
931
|
+
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
932
|
+
|
|
933
|
+
/**
|
|
934
|
+
* 명령 인자를 이름으로 맞춘다. Claude Code 는 /mcp__usercase__research 의 인자를 띄어쓰기로 나눠 순서대로 넘긴다 —
|
|
935
|
+
* `research=<id>` 라고 써도 세 번째 자리(focus)에 "research=<id>" 로 들어가, 리서치가 아니라 초점 판으로 돌았다(10/30 라이브 bluetags).
|
|
936
|
+
* 그래서 어느 자리에 있든 `이름=값`(또는 `이름:값`)이면 그 이름으로 옮기고, research 를 받는 명령에서는 이름 없는 리서치 id(UUID)도 research 로 본다
|
|
937
|
+
*/
|
|
938
|
+
function byName(args = {}, schema = {}) {
|
|
939
|
+
const names = Object.keys(schema || {});
|
|
940
|
+
const out = {};
|
|
941
|
+
const loose = [];
|
|
942
|
+
for (const [k, raw] of Object.entries(args || {})) {
|
|
943
|
+
if (raw == null) continue;
|
|
944
|
+
const v = String(raw).trim();
|
|
945
|
+
const m = v.match(/^([a-z]+)\s*[=:]\s*(.*)$/is);
|
|
946
|
+
if (m && names.includes(m[1].toLowerCase())) out[m[1].toLowerCase()] = m[2].trim();
|
|
947
|
+
else if (names.includes("research") && UUID.test(v.replace(/^research\s+/i, ""))) out.research = v.replace(/^research\s+/i, "");
|
|
948
|
+
else loose.push([k, v]);
|
|
949
|
+
}
|
|
950
|
+
// 이름 없이 온 값은 제자리에 — 이름으로 이미 채운 자리는 덮지 않는다
|
|
951
|
+
for (const [k, v] of loose) if (!(k in out) && v !== "") out[k] = v;
|
|
952
|
+
return out;
|
|
953
|
+
}
|
|
954
|
+
|
|
931
955
|
/**
|
|
932
956
|
* 명령 지시문. 따로 쓰면 MCP 프롬프트(/mcp__usercase__research), 플러그인이면 instructions 도구(/usercase:research 스킬이 부른다)로
|
|
933
957
|
* 같은 글이 나간다
|
|
@@ -1043,12 +1067,12 @@ if (PLUGIN || CODEX || OTHER) {
|
|
|
1043
1067
|
...COMMANDS.steps.argsSchema,
|
|
1044
1068
|
},
|
|
1045
1069
|
},
|
|
1046
|
-
wrap(async ({ command, ...args }) => text(COMMANDS[command].body(args))),
|
|
1070
|
+
wrap(async ({ command, ...args }) => text(COMMANDS[command].body(byName(args, COMMANDS[command].argsSchema)))),
|
|
1047
1071
|
);
|
|
1048
1072
|
} else {
|
|
1049
1073
|
for (const [name, c] of Object.entries(COMMANDS)) {
|
|
1050
1074
|
const meta = c.argsSchema ? { description: c.description, argsSchema: c.argsSchema } : { description: c.description };
|
|
1051
|
-
server.registerPrompt(name, meta, (args = {}) => ({ messages: [{ role: "user", content: { type: "text", text: c.body(args) } }] }));
|
|
1075
|
+
server.registerPrompt(name, meta, (args = {}) => ({ messages: [{ role: "user", content: { type: "text", text: c.body(byName(args, c.argsSchema)) } }] }));
|
|
1052
1076
|
}
|
|
1053
1077
|
}
|
|
1054
1078
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usercase/mcp",
|
|
3
|
-
"version": "0.2.10-next.
|
|
3
|
+
"version": "0.2.10-next.4",
|
|
4
4
|
"description": "Virtual users that browse your website and tell you what they thought — an MCP server for Claude Code",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://usercase.io",
|