AI角色创建平台
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"promptx": {
"args": [
"-y",
"@promptx/mcp-server"
],
"command": "npx"
}
}
}
可用工具 (6 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
discover 1 个参数
Discover available AI roles and tools ## What It Does Lists all activatable roles and callable tools, grouped by source: - **📦 System**: Built-in PromptX roles/tools - **🏗️ Project**: Project-specific (requires `project` tool to bind first) - **👤 User**: User-created custom resources - **🎭 RoleX V2**: Lifecycle-managed roles ## When to Use - First time in a project — see what's available - Need a specialist but unsure which role to activate - Looking for the right tool for a task - After creating new roles/tools — discover freshly registered resources ## Tips - In a project context, run `project` first to bind the directory, then `discover` - Use the returned role IDs with `action` to activate - Tools include manual links — learn before using ## Focus Parameter - `all` (default): Show everything - `roles`: Only activatable roles - `tools`: Only available tools
该工具无需必填参数,直接调用即可
action 23 个参数 需填 1 项
Role activation & lifecycle management - load role knowledge, memory and capabilities ## Core Features **V1 Roles (DPML)**: Load role config (persona, principles, knowledge), display memory network. **V2 Roles (RoleX)**: Full lifecycle management (born → want → plan → todo → synthesize). On activate, version is auto-detected: V2 takes priority, falls back to V1 if not found. Use `version` parameter to force a specific version: `"v1"` for DPML, `"v2"` for RoleX. ## Cognitive Cycle 1. See task → `recall(role, null)` scan full memory landscape 2. Multi-round `recall` → drill down by picking keywords from the network 3. Compose answer → combine memory + pretrained knowledge 4. `remember` → persist new knowledge, expand the network ## Built-in Roles | ID | Name | Responsibility | |---|---|---| | luban | 鲁班 | ToolX tool development | | nuwa | 女娲 | AI role creation | | sean | Sean | Product decisions | | writer | Writer | Professional writing | | dayu | 大禹 | Role migration & org management | > System roles require exact ID match. Use `discover` to list all available roles. ## Examples **V1 activate role:** ```json { "role": "luban" } ``` **V2 create role:** ```json { "operation": "born", "role": "_", "name": "my-dev", "source": "Feature: ..." } ``` **V2 activate role:** ```json { "operation": "activate", "role": "my-dev" } ``` **V2 create goal:** ```json { "operation": "want", "role": "_", "name": "build-api", "source": "Feature: ..." } ``` **V2 check focus:** ```json { "operation": "focus", "role": "_" } ``` **V2 finish task / achieve goal:** ```json // finish 操作会创建 encounter 节点,ID 格式为 {task-id}-finished { "operation": "finish", "role": "_", "name": "task-id", "encounter": "遇到的问题和经历..." } { "operation": "achieve", "role": "_", "experience": "learned..." } ``` **V2 complete learning cycle (want → plan → reflect → realize → master → synthesize):** ```json // 完整认知循环流程(基于实际测试验证): // 1. 创建目标 { "operation": "want", "role": "_", "name": "improve-process", "source": "Feature: 改进流程\n 作为产品经理..." } // 2. 制定计划(必须传入 id 参数!) { "operation": "plan", "role": "_", "source": "Feature: 分析问题\n Scenario: 调研...", "id": "analysis-plan" } // 3. 反思 - 创建经验(可跳过 encounter,直接创建) { "operation": "reflect", "role": "_", "encounters": [], // 空数组 = 直接创建 experience,无需预定义 encounter "experience": "Feature: 需求变更管理经验\n 在项目管理中发现...\n\n Scenario: 问题表现\n Then 需求反复修改导致延误\n And 团队理解不一致产生返工", "id": "exp-1" // 自定义 ID,用于后续引用 } // 4. 领悟 - 提炼原则(必须基于已存在的 experience) { "operation": "realize", "role": "_", "experiences": ["exp-1"], // 必须是已存在的 experience ID 数组(复数!) "principle": "Feature: 需求变更管理原则\n Scenario: 预防原则\n Then 预防胜于控制\n And 充分的需求调研", "id": "principle-1" } // 5. 沉淀 - 创建标准流程 { "operation": "master", "role": "_", "procedure": "Feature: 需求变更管理SOP\n Background:\n Given 需求变更是常态\n\n Scenario: 变更申请阶段\n When 收到变更请求\n Then 记录变更内容\n And 评估影响范围", "id": "sop-1" } // 6. 传授 - 向其他角色传授知识 { "operation": "synthesize", "role": "开发工程师", // 目标角色(接收知识的角色) "name": "需求变更管理", "source": "Feature: 需求变更管理 - 开发视角\n Scenario: 配合要点\n Then 及时反馈技术可行性", "type": "knowledge" } // 7. 遗忘 - 清理过时知识(可选) { "operation": "forget", "role": "_", "nodeId": "outdated-knowledge-id" } ``` **V2 learning cycle - 关键要点:** ``` ✅ Gherkin 格式必填: experience/principle/procedure/source 都必须使用 Gherkin 格式 ✅ Feature 开头: 必须以 "Feature: 标题" 开头,包含描述 ✅ Scenario 结构: 使用 Scenario/Background 定义场景,内部使用 Then/And/Given/When ✅ 空数组可用: reflect 时 encounters: [] 可直接创建 experience,无需预定义 encounter ✅ ID 数组必填: realize 的 experiences 必须是已存在的 experience ID 数组(复数) ✅ 角色注意: synthesize 的 role 是目标角色(接收知识的角色),不是当前角色 🚨 CRITICAL - plan 操作必须传入 id 参数: plan 操作如果不传入 id 参数,focused_plan_id 不会被设置, 导致后续 todo 操作失败并报错 "No focused plan. Call plan first." ❌ 错误: { "operation": "plan", "role": "_", "source": "..." } ✅ 正确: { "operation": "plan", "role": "_", "source": "...", "id": "my-plan" } ``` **V2 alternative: 基于任务完成的认知循环:** ```json // 如果想基于实际任务经历: // 1. 完成任务 → 自动创建 encounter (ID: {task-id}-finished) { "operation": "finish", "role": "_", "name": "task-1", "encounter": "遇到的问题..." } // 2. 反思 encounter → 创建 experience { "operation": "reflect", "role": "_", "encounters": ["task-1-finished"], "experience": "Feature: ...", "id": "exp-1" } // 3-6. 后续步骤同上 ``` **V2 synthesize (teach knowledge to a role):** ```json // synthesize 直接指定目标角色,无需先 activate { "operation": "synthesize", "role": "target-role", "name": "domain-knowledge", "source": "Feature: ...", "type": "knowledge" } ``` **Organization: view directory:** ```json { "operation": "directory", "role": "_" } ``` **Organization: found org & hire role:** ```json { "operation": "found", "role": "_", "name": "my-team", "source": "Feature: ..." } { "operation": "hire", "role": "_", "name": "my-dev", "org": "my-team" } ``` **Organization: establish position & appoint:** ```json // ⚠️ 关键:职位名必须是"角色名+岗位"格式,appoint 的 position 必须与 establish 的 name 完全一致 { "operation": "establish", "role": "_", "name": "技术负责人岗位", "source": "Feature: ...", "org": "my-team" } { "operation": "appoint", "role": "_", "name": "my-dev", "position": "技术负责人岗位", "org": "my-team" } { "operation": "charge", "role": "_", "position": "技术负责人岗位", "content": "Feature: ..." } { "operation": "require", "role": "_", "position": "lead", "skill": "leadership" } { "operation": "abolish", "role": "_", "position": "lead" } ``` **Individual lifecycle:** ```json { "operation": "retire", "role": "_", "individual": "my-dev" } { "operation": "rehire", "role": "_", "individual": "my-dev" } { "operation": "die", "role": "_", "individual": "my-dev" } { "operation": "train", "role": "_", "individual": "my-dev", "skillId": "coding", "content": "Feature: ..." } ``` **Organization management:** ```json { "operation": "charter", "role": "_", "org": "my-team", "content": "Feature: ..." } { "operation": "dissolve", "role": "_", "org": "my-team" } ``` ## On-Demand Resource Loading (V1 Roles) By default, only **personality** (persona + thought patterns) is loaded to save context. Use `roleResources` to load additional sections **before** you need them: - **Before executing tools or tasks** → load `principle` first to get workflow, methodology and execution standards - **When facing unfamiliar professional questions** → load `knowledge` first to get domain expertise - **When you need full role capabilities at once** → load `all` ```json { "role": "nuwa", "roleResources": "principle" } { "role": "nuwa", "roleResources": "knowledge" } { "role": "nuwa", "roleResources": "all" } ``` ## Guidelines - Choose the right role for the task; suggest switching when out of scope - Act as the activated role, maintain its professional traits - Use `discover` first when a role is not found
必填参数:role
project 2 个参数
Bind the current IDE project directory ## What It Does Registers the IDE workspace root so PromptX can discover project-level roles and tools. ## When to Use Call this when the IDE has a project open, **before** running `discover`. ## Important - Use the IDE's workspace root path, not a subdirectory - Do not guess or infer the project path from file paths - Without binding: only system-level and user-level resources are available ## Example ``` IDE opens /Users/name/MyProject → bind /Users/name/MyProject (correct) → bind /Users/name/MyProject/src (wrong — don't use subdirectories) ```
该工具无需必填参数,直接调用即可
recall 3 个参数 需填 1 项
Retrieve memories from a role's semantic network ## MANDATORY: Recall at Conversation Start **CRITICAL RULE**: When a role is active, you MUST call recall BEFORE answering the user's first message. This is not optional — skipping recall means losing all accumulated knowledge. ``` Step 1: recall(role, null) → DMN scan, see full memory landscape Step 2: recall(role, "relevant-kw") → drill into topic-specific memories Step 3: Answer using recalled context ``` > Without recall, every conversation starts from zero. With recall, you build on past experience. ## Workflow 1. **DMN scan** — `recall(role, null)` → see the full memory landscape (hub nodes) 2. **Drill down** — pick keywords from the network → `recall(role, "keyword")` → get details 3. **Repeat** — follow new keywords in each result until you have enough context > Always start with DMN (null query) to see what exists. Never guess keywords. ## When to Recall - **Conversation start** (MANDATORY) — always recall before first response - **New topic introduced** — recall related memories before answering - **User asks about past context** — recall to find previous discussions - **Before making decisions** — check if past experience is relevant - **Mid-conversation** — when you realize a topic connects to past knowledge ## Query Parameter - `null` → **DMN mode** (recommended entry point): activates hub nodes, shows full network - Single keyword: `"PromptX"` → spread from that node - Multiple keywords: `"PromptX testing fix"` → multi-center activation ## Mode Parameter - `balanced` (default): balance precision and association - `focused`: precise lookup, frequent memories first - `creative`: broad association, distant connections ## Examples **DMN full scan (always do this first):** ```json { "role": "luban", "query": null } ``` **Keyword drill-down:** ```json { "role": "luban", "query": "PromptX testing", "mode": "focused" } ```
必填参数:role
remember 2 个参数 需填 2 项
Save knowledge to a role's memory network ## MANDATORY: Remember Before Conversation Ends **CRITICAL RULE**: Before a conversation ends, you MUST call remember to save key insights. Every conversation without remember = knowledge lost forever. **Trigger signals for remember:** - User says "thanks" / "bye" / conversation naturally wrapping up - You just solved a problem or answered a complex question - You learned something new about the user's project/preferences - Recall returned empty — you MUST fill the gap after answering - Every 5-7 rounds of deep discussion — save intermediate insights > Think of remember as "saving your game". No save = start over next time. ## When to Use - **Conversation ending** (MANDATORY) — save all key insights before goodbye - After answering a question — save key insights - After multi-round recall — summarize findings - Learned something new — persist it - Solved a problem — record the solution - Recall returned empty — fill the gap - User corrected you — save the correction - Discovered user preferences — save them ## Engram Types | Type | Use For | Example | |---|---|---| | ATOMIC | Facts, entities, concrete info | "Redis default port is 6379" | | LINK | Relationships, connections | "Database uses connection pool for management" | | PATTERN | Processes, methodologies | "Login → select item → checkout" | ## What to Save (Checklist) - Key facts and decisions made during conversation - User preferences and project context - Problems solved and solutions found - Corrections and clarifications - Patterns and workflows discovered - Important relationships between concepts ## Occam's Razor Principle Strip content to minimum essential words. For each word ask: does removing it change the meaning? If not, remove it. ## Examples ```json { "role": "luban", "engrams": [{ "content": "Redis default port is 6379", "schema": "Redis port 6379", "strength": 0.7, "type": "ATOMIC" }] } ``` ```json { "role": "luban", "engrams": [{ "content": "Login then select items then pay", "schema": "login select-item pay", "strength": 0.8, "type": "PATTERN" }] } ```
必填参数:role、engrams
toolx 1 个参数 需填 1 项
ToolX runtime — load and execute PromptX ecosystem tools ## What It Does Universal interface for calling PromptX tools (file ops, PDF reading, role creation, etc.). Input is a YAML document specifying the tool, mode, and parameters. ## Modes | Mode | Purpose | |---|---| | manual | Read tool documentation (**always do this first**) | | execute | Run the tool with parameters | | configure | Set environment variables for a tool | | log | View tool execution logs | | dryrun | Preview without executing | ## Examples **Read tool manual (do this first):** ```yaml tool: tool://filesystem mode: manual ``` **Execute with parameters:** ```yaml tool: tool://pdf-reader mode: execute parameters: path: /path/to/file.pdf action: extract ``` **Configure tool:** ```yaml tool: tool://my-tool mode: configure parameters: API_KEY: sk-xxx123 ``` ## Built-in Tools - **tool://filesystem** — File operations (read/write/list/delete) - **tool://pdf-reader** — Extract text from PDFs - **tool://excel-tool** — Read/write Excel files - **tool://word-tool** — Read/write Word documents - **tool://role-creator** — Create AI roles (女娲/Nuwa) - **tool://tool-creator** — Create new tools (鲁班/Luban) ## Rules - YAML must start with `tool: tool://name` - Always read `manual` before first use of any tool - Do NOT use `@` prefix (system handles it internally) - Use `discover` to see all available tools
必填参数:yaml
服务介绍
AI角色创建和智能工具开发平台,能够将AI转化为行业专家,适用于自然对话和专业场景。