Model Context Protocol Template
STDIOA starter template for building your own Model Context Protocol server.
A starter template for building your own Model Context Protocol server.
A starter template for building your own Model Context Protocol (MCP) server. This template provides the basic structure and setup needed to create custom MCPs that can be used with Cursor or Claude Desktop.
mcp-server-template/
├── index.ts # Main server implementation
├── package.json # Project dependencies
├── tsconfig.json # TypeScript configuration
└── build/ # Compiled JavaScript output
git clone [your-repo-url] my-mcp-server cd my-mcp-server
pnpm install
pnpm run build
This will generate the /build/index.js
file - your compiled MCP server script.
node ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js
Add the following MCP config to your Claude Desktop configuration:
{ "mcpServers": { "your-mcp-name": { "command": "node", "args": ["ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js"] } } }
The template includes a sample tool implementation in index.ts
. To create your own MCP:
index.ts
:const server = new McpServer({ name: "your-mcp-name", version: "0.0.1", });
server.tool()
method:server.tool( "your-tool-name", "Your tool description", { // Define your tool's parameters using Zod schema parameter: z.string().describe("Parameter description"), }, async ({ parameter }) => { // Implement your tool's logic here return { content: [ { type: "text", text: "Your tool's response", }, ], }; } );
npm run build
Feel free to submit issues and enhancement requests!
MIT