بنقرة واحدة
create-a2a-mcp
"> **Trigger phrases**: "create MCP", "scaffold MCP server", "add MCP to agent", "
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
"> **Trigger phrases**: "create MCP", "scaffold MCP server", "add MCP to agent", "
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
The God Agent — single entry point that autonomously routes, dispatches, and synthesizes work across the entire 126-agent OpenSIN fleet. Zero human intervention. Maximum parallelism.
4 business growth agent skills and plugins for Claude Code, Codex, Gemini CLI, Cursor, OpenClaw. Customer success (health scoring, churn), sales engineer (RFP), revenue operations (pipeline, GTM), contract & proposal writer. Python tools (stdlib-only).
10 C-level advisory agent skills and plugins for Claude Code, Codex, Gemini CLI, Cursor, OpenClaw. CEO, CTO, COO, CPO, CMO, CFO, CRO, CISO, CHRO, Executive Mentor. Multi-role board meetings, strategy routing, structured recommendations. For founders needing executive-level decision support.
25 advanced engineering agent skills and plugins for Claude Code, Codex, Gemini CLI, Cursor, OpenClaw. Agent design, RAG, MCP servers, CI/CD, database design, observability, security auditing, release management, platform ops.
Curate Claude Code's auto-memory into durable project knowledge. Analyze MEMORY.md for patterns, promote proven learnings to CLAUDE.md and .claude/rules/, extract recurring solutions into reusable skills. Use when: (1) reviewing what Claude has learned about your project, (2) graduating a pattern from notes to enforced rules, (3) turning a debugging solution into a skill, (4) checking memory health and capacity.
23 engineering agent skills and plugins for Claude Code, Codex, Gemini CLI, Cursor, OpenClaw, and 6 more tools. Architecture, frontend, backend, QA, DevOps, security, AI/ML, data engineering, Playwright, Stripe, AWS, MS365. 30+ Python tools (stdlib-only).
| name | create-a2a-mcp |
| description | "> **Trigger phrases**: "create MCP", "scaffold MCP server", "add MCP to agent", " |
Trigger phrases: "create MCP", "scaffold MCP server", "add MCP to agent", "create-a2a-mcp", "/create-a2a-mcp" Works standalone AND as an integration hook from
/create-a2a.
Scaffold a complete, production-ready MCP (Model Context Protocol) server surface for any A2A agent or standalone project. Generates all required files, registers in opencode.json, and validates the result.
| Scenario | How |
|---|---|
| Building a new A2A agent | /create-a2a calls this skill automatically after base scaffold |
| Adding MCP to an existing agent | Call this skill directly on the agent root |
| Creating a standalone MCP server | Call this skill with a target directory |
<agent-root>/
├── src/mcp-server.ts # MCP server with registerTool() pattern
├── mcp-config.json # MCP config for local consumers
├── clients/opencode-mcp.json # OpenCode client config
└── (cli.ts patched) # serve-mcp command added if missing
Plus optionally:
~/.config/opencode/opencode.json/Users/jeremy/dev/SIN-Solver/bin/sin-<slug>| Asset | Path |
|---|---|
| Template MCP server | /Users/jeremy/dev/SIN-Solver/a2a/template-repo/A2A-SIN-Agent-Template/src/mcp-server.ts |
| Template mcp-config | /Users/jeremy/dev/SIN-Solver/a2a/template-repo/A2A-SIN-Agent-Template/mcp-config.json |
| Template client config | /Users/jeremy/dev/SIN-Solver/a2a/template-repo/A2A-SIN-Agent-Template/clients/opencode-mcp.json |
| Template CLI | /Users/jeremy/dev/SIN-Solver/a2a/template-repo/A2A-SIN-Agent-Template/src/cli.ts |
| Global opencode config | /Users/jeremy/.config/opencode/opencode.json |
| SIN-Solver bin dir | /Users/jeremy/dev/SIN-Solver/bin/ |
| Shared lib | scripts/_mcp-lib.mjs (this skill) |
| Script | Purpose | Usage |
|---|---|---|
scripts/_mcp-lib.mjs | Shared helpers (arg parsing, slug normalization, file I/O) | Imported by other scripts |
scripts/mcp-scaffold.mjs | Generate all MCP files from tool definitions | node mcp-scaffold.mjs --agent-root <path> --slug <name> --tools '<json>' |
scripts/mcp-register-global.mjs | Register MCP in global opencode.json | node mcp-register-global.mjs --slug <name> --agent-root <path> [--bin-wrapper] |
scripts/mcp-verify.mjs | Validate MCP setup completeness | node mcp-verify.mjs --agent-root <path> --slug <name> |
Collect from user or from /create-a2a handoff:
| Parameter | Required | Description |
|---|---|---|
agent-root | ✅ | Absolute path to agent/project root |
slug | ✅ | MCP slug (e.g. sin-research, sin-server) |
namespace | ❌ | Tool namespace prefix (defaults to slug with - → _) |
tools | ❌ | JSON array of tool definitions (see format below) |
register-global | ❌ | Register in opencode.json (default: true) |
bin-wrapper | ❌ | Create bin wrapper in SIN-Solver/bin/ (default: false) |
env-vars | ❌ | JSON object of environment variables for MCP config |
SCRIPTS=~/.config/opencode/skills/create-a2a-mcp/scripts
node $SCRIPTS/mcp-scaffold.mjs \
--agent-root /path/to/agent \
--slug sin-myagent \
--tools '[{"name":"do_thing","description":"Does a thing","params":{"input":"string"},"action":"myagent.do_thing"}]'
This generates:
src/mcp-server.ts — Full MCP server with all tools registered via McpServer.registerTool()mcp-config.json — Local MCP configclients/opencode-mcp.json — OpenCode client configsrc/cli.ts to include serve-mcp command if missingnode $SCRIPTS/mcp-register-global.mjs \
--slug sin-myagent \
--agent-root /path/to/agent \
--bin-wrapper
node $SCRIPTS/mcp-verify.mjs \
--agent-root /path/to/agent \
--slug sin-myagent
Expected output: all checks green.
npm --prefix <agent-root> run build
echo '{}' | node <agent-root>/dist/src/cli.js serve-mcp
# Should start without errors and respond to MCP protocol
Each tool in the --tools JSON array:
{
"name": "do_thing",
"description": "Does a specific thing",
"params": {
"input": "string",
"count": "number?",
"confirm": "boolean?"
},
"action": "myagent.do_thing"
}
Type mapping:
string → z.string() (required)string? → z.string().optional() (optional)number → z.number() (required)number? → z.number().optional() (optional)boolean → z.boolean() (required)boolean? → z.boolean().optional() (optional)array → z.array(z.string()) (required)array? → z.array(z.string()).optional() (optional)Every MCP server gets these baseline tools automatically:
<namespace>_help — Describe available agent actions<namespace>_health — Check base agent readiness<namespace>_onboarding_status — Read onboarding state<namespace>_onboarding_save — Persist onboarding state (requires confirm=true)When called from /create-a2a, the handoff contract is:
{
"agent-root": "/absolute/path/to/agent",
"slug": "sin-agentname",
"namespace": "sin_agentname",
"tools": [...],
"register-global": true,
"bin-wrapper": true,
"env-vars": { "KEY": "value" }
}
The /create-a2a SKILL.md should include this step after base scaffold:
### MCP Surface Generation
After scaffolding the base agent, invoke skill `create-a2a-mcp` to generate the MCP server surface.
Pass the agent-root, slug, and domain-specific tool definitions.
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { z } from 'zod';
const server = new McpServer({ name: 'sin-myagent', version: '0.1.0' });
server.registerTool('sin_myagent_help',
{ description: 'Describe available actions.' },
async () => ({
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
})
);
const transport = new StdioServerTransport();
await server.connect(transport);
| Mode | When | Config |
|---|---|---|
| stdio | Local agents, opencode CLI | Default. Always use for A2A agents. |
| streamable-http | Remote/cloud agents | Only if agent runs on remote VM |
| SSE | Legacy | DEPRECATED. Never use for new agents. |
❌ Template name drift — always replace template-a2a-sin-agent with actual slug
❌ Missing serve-mcp in CLI — breaks opencode integration
❌ Business logic in mcp-server.ts — keep it thin, delegate to runtime.ts
❌ Hardcoded paths in mcp-config.json — use relative paths for portability
❌ SSE transport for new projects — use stdio or streamable-http
❌ Shared mutable server state across clients — fresh handler per call
src/mcp-server.ts exists with all tools registeredmcp-config.json exists with correct slugclients/opencode-mcp.json exists with correct slugsrc/cli.ts has serve-mcp commandtemplate-a2a-sin-agent references)npm run build succeedsserve-mcp starts without errors