Purpose: template-mcp-server is a CLI tool template for quickly getting started building your own MCP (Model Context Protocol) server, implemented based on the FastMCP framework, with the goal of simplifying the initial setup of MCP services.
Main capabilities: The template includes basic server setup using FastMCP, supports both stdio and HTTP transport options; provides structures for defining MCP tools, resources, and prompts; includes TypeScript configuration; and provides development scripts and configuration. Its features include: based on the FastMCP framework to simplify implementation, dual transport support (stdio or HTTP), full TypeScript type safety support, and extensibility (easy to add custom tools, resources, and prompts).
Usage: After creating the project, first install dependencies using your preferred package manager, such as npm install, yarn, pnpm install, or bun install. To start the server, use npm start for stdio mode and npm run start:http for HTTP mode; for development mode with auto-reload, use npm run dev for stdio and npm run dev:http for HTTP. Note that the default scripts in package.json use Bun as the runtime (for example, bun run src/index.ts). If you prefer another package manager or runtime, you can modify the scripts in package.json to use Node.js or another runtime.
Transport description: stdio transport (command-line mode) runs on the local machine, is automatically managed by Cursor, communicates directly through stdout, is accessible only locally, and is suitable for personal development and tools; SSE transport (HTTP Web mode) can run locally or remotely, is managed and run by the user, communicates over the network, can be shared across machines, and is suitable for team collaboration and shared tools. The HTTP server runs on port 3001 by default and can be changed by setting the PORT environment variable.
Connection method: To connect to the MCP server from Cursor, open Cursor settings, go to Features, find the MCP Servers section, and click to add a new MCP server. In stdio mode, the type is command, and the command is the path to the server executable (such as npm start); in SSE mode, the type is url, and the URL is http://localhost:3001/sse。也可在项目根目录创建 .cursor/mcp.json file for more portable configuration, or create a global configuration in ~/.cursor/mcp.json. command-type entries run the server in stdio mode, while url-type entries connect to the HTTP server via SSE transport; environment variables can be provided through the env field; when connecting via SSE using FastMCP, you need to use the full URL including the /sse path. FastMCP also provides built-in tools for testing the server.
Use cases: Suitable for developers who need to quickly build their own MCP server, use command-line tools in a local personal development environment, or share tools within a team and access them over the network.
Limitations and additions: The materials do not provide the specific names of built-in test commands, a complete list of environment variables, specific code examples for custom tools and resources, or more licensing details beyond the MIT License; this content is not currently provided.