MCP 生成
- 作者仓库星标 0
- 作者仓库 skills-registry
NoUI MCP Server Lifecycle
Manage generated FastMCP servers and connect them to Claude Code. Servers are generated by /noui-record-workflow and live under workbench/mcp_servers/<app_slug>/<server_id>/.
All commands run from the noui/ directory using .venv/bin/python cli/main.py.
Prerequisite: At least one server must exist under workbench/mcp_servers/. Run /noui-record-workflow first if none exist.
How requests are executed: by default, each tool opens a WebSocket to Tabby's CDP endpoint and runs fetch(..., {credentials: 'include'}) inside the authenticated browser. A live Tabby session with the target site open is required at invocation time. See /noui-record-workflow → How Execution Works for the full explanation and the --execution-mode http escape hatch.
Critical Rules (Never Violate)
- ALWAYS run
mcp listfirst to get the exactserver_idbefore any other command - NEVER edit
server.pyormanifest.jsondirectly — regenerate by re-runningworkflow export --as mcp - When adding to
~/.claude.json, ALWAYS use the absolute path to.venv/bin/python— not the systempythonorpython3 - ALWAYS restart Claude Code after editing
~/.claude.json— the config is read at startup - You do not need to run
mcp startseparately when using the~/.claude.jsonstdio config — Claude Code launches the process automatically
Every generated server folder includes an API.md file — a human-readable API reference for all tools. Read it to understand a server's tools without inspecting tools.json or operation files. Refresh it with mcp docs <server_id> after any edit to tools.json.
Step 1 — List Available Servers
.venv/bin/python cli/main.py mcp list
Output:
MCP servers:
SERVER ID APP TOOLS STATUS
-----------------------------------------------------------------------
hubspot-create-contact-abc12345 HubSpot 3 stopped
jsonplaceholder-test-3ab1cc83 Jsonplaceholder Test 2 running (PID 46929)
Note the server_id of the server you want to manage.
Step 2 — Start a Server
.venv/bin/python cli/main.py mcp start <server_id>
Spawns the server process in the background. Logs go to:
workbench/mcp_servers/<app_slug>/<server_id>/.mcp-<server_id>.log
MCP stdio servers exit immediately when there is no connected client — this is expected. The server is not meant to run continuously standalone; it is launched on-demand by the client.
Step 3 — Check Server Status
.venv/bin/python cli/main.py mcp status <server_id>
For servers that use CDP (Akamai-protected sites like Expedia), status also shows browser session health:
CDP : ✓ reachable (localhost:9222) ← worker is running
CDP : ✗ not reachable (localhost:9222) ← run: noui tabby session ensure
Step 4 — Stop a Server
.venv/bin/python cli/main.py mcp stop <server_id>
Sends SIGTERM and clears the PID file.
Step 5 — Connect to Claude Code
Add the server to ~/.claude.json under mcpServers. Claude Code launches the server process automatically via command + args.
{
"mcpServers": {
"<server_id>": {
"type": "stdio",
"command": "/absolute/path/to/noui/.venv/bin/python",
"args": [
"/absolute/path/to/noui/workbench/mcp_servers/<app_slug>/<server_id>/server.py"
]
}
}
}
Concrete example (replace paths with your actual noui directory):
{
"mcpServers": {
"jsonplaceholder-test-3ab1cc83": {
"type": "stdio",
"command": "/home/gabriel/Documents/adopt/noui/.venv/bin/python",
"args": [
"/home/gabriel/Documents/adopt/noui/workbench/mcp_servers/jsonplaceholder-test/jsonplaceholder-test-3ab1cc83/server.py"
]
}
}
}
After saving, restart Claude Code. The tools defined in the server will be available in Claude Code's tool list. You can verify by running /noui-generate-mcp in Claude Code.
Decision Flow
Start
│
├─ Need to see what servers exist?
│ └─ Step 1: mcp list
│
├─ Auth not working / not sure if server is ready?
│ ├─ mcp verify <server_id> → PASS / NEEDS_SECRET / REPAIR_APPLIED
│ └─ mcp diagnose-auth <server_id> → full breakdown with repair suggestions
│
├─ Need to run a server standalone (test/debug)?
│ ├─ Step 2: mcp start <server_id>
│ ├─ Step 3: mcp status <server_id>
│ └─ Step 4: mcp stop <server_id>
│
└─ Need to use tools from Claude Code?
└─ Step 5: add to ~/.claude.json → restart Claude Code
└─ Verify: /mcp in Claude Code shows the server
CLI Command Reference
| Command | Purpose |
|---|---|
.venv/bin/python cli/main.py mcp list |
List all generated servers with running status |
.venv/bin/python cli/main.py mcp start <server_id> |
Start a server process in the background |
.venv/bin/python cli/main.py mcp stop <server_id> |
Stop a running server process |
.venv/bin/python cli/main.py mcp status <server_id> |
Show running state, tool count, manifest path, and CDP reachability (for browser-based servers) |
.venv/bin/python cli/main.py mcp docs <server_id> |
Regenerate API.md from current tools.json |
.venv/bin/python cli/main.py mcp docs <server_id> --check |
Exit non-zero if API.md is stale (for CI / agent validation) |
.venv/bin/python cli/main.py mcp verify <server_id> |
Run AuthVerifier — reports PASS / REPAIR_APPLIED / NEEDS_SECRET / UNSUPPORTED |
.venv/bin/python cli/main.py mcp diagnose-auth <server_id> |
Full auth diagnosis: strategy, env var status, per-step verification, repair suggestions |
Troubleshooting
| Symptom | Fix |
|---|---|
mcp list shows no servers |
No workflows exported yet — run /noui-record-workflow first |
MCP server '<id>' not found |
Run mcp list to get the exact server_id string |
| Server crashes immediately | Check .mcp-<server_id>.log in the server dir for Python errors |
| Stale PID (shows running but is not) | mcp stop <server_id> clears stale PID; then mcp start again |
| Claude Code does not see tools after adding to config | Confirm absolute paths are correct; restart Claude Code; run /noui-generate-mcp to verify connection |
server.py not found error |
Re-run workflow export --as mcp for that session to regenerate the server |
| Auth errors at runtime (authenticated server) | Run mcp diagnose-auth <server_id> — shows missing env vars and repair steps |
NEEDS_SECRET <VAR> from verify |
Set <VAR>=<value> in noui/.env and re-run mcp verify <server_id> |
Server is v1 (no auth_plan.json) |
Re-export with workflow export --as mcp ... --profile-slug <slug> --verify to upgrade to v2 |
| Tool fails with "All connection attempts failed" | CDP-based server needs browser session — run mcp status <server_id> to check CDP, then noui tabby session ensure |
| Tabby session shows HEALTHY but tools still fail | Worker crashed but DB state is stale — run noui tabby session ensure (auto-detects and restarts dead workers) |
Exported server has profile_slug: null |
No --profile-slug was passed at export time — re-export: workflow export --as mcp <session_id> --profile-slug <slug> |
<!-- tomevault:4.0:skill_md:2026-05-23 -->Source: adoptai/noui — distributed by TomeVault.
- 流狐分类
- AI 智能
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 检测到的网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Output: Note the serverid of the server you want to manage.
Spawns the server process in the background. Logs go to: MCP stdio servers exit immediately when there is no connected client — this is expected. The server is not meant to run continuously standalone; it is launched on-demand by the client.
For servers that use CDP (Akamai-protected sites like Expedia), status also shows browser session health:
Sends SIGTERM and clears the PID file.
Add the server to ~/.claude.json under mcpServers. Claude Code launches the server process automatically via command + args. Concrete example (replace paths with your actual noui directory): After saving, restart Claude Code. The tools defined in the server…
# NoUI MCP Server Lifecycle
Manage generated FastMCP servers and connect them to Claude Code. Servers are generated by `/noui-record-workflow` and live under `workbench/mcp_servers/<app_slug>/<server_id>/`.
All commands run from the `noui/` directory using `.venv/bin/python cli/main.py`.
**Prerequisite:** At least one server must exist under `workbench/mcp_servers/`. Run `/noui-record-workflow` first if none exist.
**How requests are executed:** by default, each tool opens a WebSocket to Tabby's CDP endpoint and runs `fetch(..., {credentials: 'include'})` inside the authenticated browser. A live Tabby session with the target site open is required at invocation time. See `/noui-record-workflow` → *How Execution Works* for the full explanation and the `--execution-mode http` escape hatch.
---
## Critical Rules (Never Violate)
- **ALWAYS** run `mcp list` first to get the exact `server_id` before any other command
- **NEVER** edit `server.py` or `manifest.json` directly — regenerate by re-running `workflow export --as mcp`
- When adding to `~/.claude.json`, **ALWAYS** use the absolute path to `.venv/bin/python` — not the system `python` or `python3`
- **ALWAYS** restart Claude Code after editing `~/.claude.json` — the config is read at startup
- You do **not** need to run `mcp start` separately when using the `~/.claude.json` stdio config — Claude Code launches the process automatically
Every generated server folder includes an **`API.md`** file — a human-readable API reference for all tools. Read it to understand a server's tools without inspecting `tools.json` or operation files. Refresh it with `mcp docs <server_id>` after any edit to `tools.json`.
---
## Step 1 — List Available Servers
```bash
.venv/bin/python cli/main.py mcp list
```
Output:
```
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Critical Rules (Never Violate) → Step 1 — List Available Servers → Step 2 — Start a Server → Step 3 — Check Server Status → Step 4 — Stop a Server → Step 5 — Connect to Claude Code
要点 -> Prerequisite · How requests are executed · ALWAYS · NEVER · not · API.md · Concrete example · restart Claude Code
文件/命令 -> /noui-record-workflow · workbench/mcpservers/<appslug>/<serverid>/ · noui/ · .venv/bin/python cli/main.py · workbench/mcpservers/ · fetch(..., {credentials: 'include'}) · --execution-mode http · mcp list
内容 SHA-256 -> 975a9e9cb68a
方法与流程
适用与边界
原文中的明确线索
/noui-record-workflow、workbench/mcpservers/<appslug>/<serverid>/、noui/、.venv/bin/python cli/main.py、workbench/mcpservers/、fetch(..., {credentials: 'include'})、--execution-mode http、mcp list