agentsclimarketplace

Create a2a mcp

Skill OpenSIN-AI/OpenSIN-Skills/operations/agent-creation/create-a2a-mcp

> **Trigger phrases**: "create MCP", "scaffold MCP server", "add MCP to agent",From its SKILL.md

Install
npx -y skills add OpenSIN-AI/OpenSIN-Skills --skill create-a2a-mcp

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

8.1 KB, ~2.1k tokens by cl100k_base, as published. Nobody here has run it

/create-a2a-mcp — Scaffold MCP Servers for A2A Agents

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.

Purpose

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.

When to Use

ScenarioHow
Building a new A2A agent/create-a2a calls this skill automatically after base scaffold
Adding MCP to an existing agentCall this skill directly on the agent root
Creating a standalone MCP serverCall this skill with a target directory

What Gets Scaffolded

<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:

  • Global registration in ~/.config/opencode/opencode.json
  • Bin wrapper at /Users/jeremy/dev/SIN-Solver/bin/sin-<slug>

SSOT Paths

AssetPath
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 libscripts/_mcp-lib.mjs (this skill)

Built-in Scripts

ScriptPurposeUsage
scripts/_mcp-lib.mjsShared helpers (arg parsing, slug normalization, file I/O)Imported by other scripts
scripts/mcp-scaffold.mjsGenerate all MCP files from tool definitionsnode mcp-scaffold.mjs --agent-root <path> --slug <name> --tools '<json>'
scripts/mcp-register-global.mjsRegister MCP in global opencode.jsonnode mcp-register-global.mjs --slug <name> --agent-root <path> [--bin-wrapper]
scripts/mcp-verify.mjsValidate MCP setup completenessnode mcp-verify.mjs --agent-root <path> --slug <name>

Workflow

Step 0 — Gather Input

Collect from user or from /create-a2a handoff:

ParameterRequiredDescription
agent-rootAbsolute path to agent/project root
slugMCP slug (e.g. sin-research, sin-server)
namespaceTool namespace prefix (defaults to slug with -_)
toolsJSON array of tool definitions (see format below)
register-globalRegister in opencode.json (default: true)
bin-wrapperCreate bin wrapper in SIN-Solver/bin/ (default: false)
env-varsJSON object of environment variables for MCP config

Step 1 — Run Scaffold

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 config
  • clients/opencode-mcp.json — OpenCode client config
  • Patches src/cli.ts to include serve-mcp command if missing

Step 2 — Register Globally (Optional)

node $SCRIPTS/mcp-register-global.mjs \
  --slug sin-myagent \
  --agent-root /path/to/agent \
  --bin-wrapper

Step 3 — Verify

node $SCRIPTS/mcp-verify.mjs \
  --agent-root /path/to/agent \
  --slug sin-myagent

Expected output: all checks green.

Step 4 — Build & Smoke Test

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

Tool Definition Format

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:

  • stringz.string() (required)
  • string?z.string().optional() (optional)
  • numberz.number() (required)
  • number?z.number().optional() (optional)
  • booleanz.boolean() (required)
  • boolean?z.boolean().optional() (optional)
  • arrayz.array(z.string()) (required)
  • array?z.array(z.string()).optional() (optional)

Default Tools (Always Generated)

Every MCP server gets these baseline tools automatically:

  1. <namespace>_help — Describe available agent actions
  2. <namespace>_health — Check base agent readiness
  3. <namespace>_onboarding_status — Read onboarding state
  4. <namespace>_onboarding_save — Persist onboarding state (requires confirm=true)

Integration with /create-a2a

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.

MCP Server Pattern Reference

Production Pattern (McpServer.registerTool — PREFERRED)

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);

Transport Modes

ModeWhenConfig
stdioLocal agents, opencode CLIDefault. Always use for A2A agents.
streamable-httpRemote/cloud agentsOnly if agent runs on remote VM
SSELegacyDEPRECATED. Never use for new agents.

Anti-Patterns

❌ 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

Checklist

  • src/mcp-server.ts exists with all tools registered
  • mcp-config.json exists with correct slug
  • clients/opencode-mcp.json exists with correct slug
  • src/cli.ts has serve-mcp command
  • No template name drift (no template-a2a-sin-agent references)
  • Global opencode.json registration (if requested)
  • Bin wrapper created (if requested)
  • npm run build succeeds
  • serve-mcp starts without errors
  • All default tools respond (help, health, onboarding)

Related Skills

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Gives 0 of the 12 instructions most mcp tooling skills give in ~2.1k tokens

Counted across 638 of the 750 authors here whose files we hold, read 2026-08-07

  • Create ten complex or independent read-only evaluation questionsin 69 of 638, across 15 files
  • Test servers using MCP Inspectorin 61 of 638, across 19 files
  • Provide actionable error messages with specific next stepsin 54 of 638, across 12 files
  • Prioritize comprehensive API coverage over specific workflows or workflow toolsin 54 of 638, across 12 files
  • Use TypeScript and Streamable HTTP for remote servers or clientsin 54 of 638, across 8 files
  • Define structured output schemas where possiblein 50 of 638, across 8 files
  • Use Zod or Pydantic for input schemasin 47 of 638, across 5 files
  • Fetch MCP specification pages with markdown suffixin 46 of 638, across 4 files
  • Load framework documentation using WebFetchin 45 of 638, across 3 files
  • Verify each evaluation answer independentlyin 45 of 638, across 3 files
  • Implement API client with authentication and paginationin 45 of 638, across 3 files
  • Define input schemas with validationin 27 of 638, across 9 files

Said here and by no other author read

  • gather required parameters before scaffolding
  • run the mcp scaffold script
  • register the server globally if requested
  • execute a build and smoke test
  • keep business logic out of mcp-server
  • use relative paths in mcp-config

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 326,790. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.