This directory contains templates for creating MCP (Model Context Protocol) servers with different capabilities.
The templates will be automatically found if they are in one of these locations:
./templates/: Local project directory~/.mcpt/templates/: User's home directory- Next to the executable in the installed location
To install templates to your home directory:
make templatesCreate a new MCP project with the mcp new command:
# Create a project with a tool, resource, and prompt
mcp new tool:hello_world resource:file prompt:hello
# Create a project with a specific SDK (currently only TypeScript/ts supported)
mcp new tool:hello_world --sdk=ts
# Create a project with a specific transport (stdio, sse, or http)
mcp new tool:hello_world --transport=stdio
mcp new tool:hello_world --transport=sse
mcp new tool:hello_world --transport=http- tool: Basic tool implementation template
- resource: Resource implementation template
- prompt: Prompt implementation template
- server_stdio: Server with stdio transport
- server_sse: Server with SSE transport
- server_http: Server with streamable HTTP transport
- full_server: Complete server with all three capabilities
The scaffolding creates the following structure:
my-project/
├── package.json
├── tsconfig.json
└── src/
├── index.ts
└── [component].ts
After scaffolding, run:
npm install
npm run build
npm start