Mcp builder

From squadcodercom/squadcoder · View interactive version

Mcp builder is an AI agent skill from the GitHub repository squadcodercom/squadcoder. Design and build a production MCP (Model Context Protocol) server: pick stdio vs HTTP transport, define tools/resources/prompts with strict input schemas, handle auth and secrets safely, and ship it. Covers Node/TypeScript and Python SDKs, error handling, and how to register it in an opencode/Claude

How to use this skill

Skill file

MCP Builder — ship a production Model Context Protocol server

Build an MCP server that an agent can safely call. Optimize for small, well-typed tools and a

tight security surface — an MCP tool is remote code execution by another name.

Step 0 — scope it

what's needed. Fewer, sharper tools beat many fuzzy ones.

HTTP** for a hosted/shared server. Don't expose stdio servers on a network.

Step 1 — scaffold (reuse the official SDK, don't hand-roll the protocol)

TypeScript/Node (@modelcontextprotocol/sdk):

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: "my-mcp", version: "1.0.0" })

server.tool(
  "get_thing",
  "Fetch a thing by id. Read-only.",
  { id: z.string().describe("the thing id") },
  async ({ id }) => ({ content: [{ type: "text", text: await fetchThing(id) }] }),
)

await server.connect(new StdioServerTransport())

Python (mcp package) mirrors this with FastMCP + @mcp.tool().

Step 2 — design each tool well

Step 3 — security (do this, not later)

escape the project root). Parameterize any DB/query tool — never string-concat user input.

Step 4 — test

Step 5 — register it

opencode/SquadCoder squadcoder.json (or .mcp.json):

"mcp": {
  "my-mcp": {
    "type": "local",
    "command": ["npx", "-y", "my-mcp-server"],
    "enabled": true,          // key-required servers ship enabled:false until configured
    "environment": { "MY_API_KEY": "${MY_API_KEY}" }
  }
}

Document required env vars and whether it ships enabled or disabled.

Checklist before shipping

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.