Create a new MCP server — clarify purpose, choose transport, scaffold, implement, test, and register
Skill metadata: version "1.1"; license MIT; tags [mcp, server, tool, integration, scaffold]; compatibility ">=2.0"; recommended tools [codebase, editFiles, runCommands].
Build a new Model Context Protocol (MCP) server from scratch. This skill walks through the full lifecycle: clarifying the server's purpose, choosing transport, scaffolding, implementing tools/resources, testing, and registering the server in .vscode/mcp.json.
Ask the user:
| Transport | When to use | Trade-offs |
|---|---|---|
| stdio (recommended) | Local servers, same machine as VS Code | Simplest setup, no network config, most secure |
| SSE | Remote servers, shared team servers | Requires HTTPS in production, more complex deployment |
| Streamable HTTP | New servers targeting latest MCP spec | Newest transport, best for stateless operations |
Default to stdio unless the user has a specific reason for a remote transport.
Choose the implementation language based on the project's primary stack.
Python (this project):
mkdir -p .mcp-servers/<server-name>
cd .mcp-servers/<server-name>
uv init && uv add mcp
TypeScript/JavaScript (alternative):
mkdir -p .mcp-servers/<server-name>
cd .mcp-servers/<server-name>
npm init -y
npm install @modelcontextprotocol/sdk zod
npm install --save-dev tsx typescript @types/node
For each tool identified in Step 1:
Rules:
npx @modelcontextprotocol/inspector python .mcp-servers/<server-name>/main.py
Verify:
.vscode/mcp.jsonAdd the server to the project's MCP configuration:
{
"<server-name>": {
"type": "stdio",
"command": "uv",
"args": ["run", "python", ".mcp-servers/<server-name>/main.py"],
"env": {
"API_KEY": "${env:SERVER_NAME_API_KEY}"
}
}
}
.github/copilot-instructions.mdinitialize request.vscode/mcp.json is valid JSON with the new server entry