A comprehensive template for creating Model Context Protocol (MCP) servers using TypeScript and Vite, tested with Bun's built-in test runner. Built for Bun; the published server runs on Node.
# Scaffold a new server
bunx @mrbrunowolff/minimal-mcp-server create my-mcp-server
# Navigate to your project
cd my-mcp-server
# Start developing
bun run devgit clone https://github.com/MrBrunoWolff/minimal-mcp-server.git
cd minimal-mcp-server
bun install- π TypeScript - Full type safety and modern JavaScript features
- β‘ Vite - Fast build tool and development server
- π§ͺ
bun test- Built-in test runner, no test framework to install - π Bun - Ultra-fast JavaScript runtime (npm compatible)
- π§ oxlint & Prettier - Code linting and formatting
- π¦ Ready to publish - Pre-configured for npm publishing
- π― MCP SDK - Built on the official Model Context Protocol SDK
- π οΈ CLI Tool - One-command project creation
- π Complete Documentation - Getting started guide and examples
- β 15+ Tests - Comprehensive test coverage
my-mcp-server/
βββ src/
β βββ index.ts # Main entry point
β βββ server.ts # MCP server setup
β βββ tools/ # Your MCP tools
β β βββ example.ts # Example text processing tool
β β βββ math.ts # Mathematical calculations tool
β βββ types/ # TypeScript type definitions
βββ tests/ # Comprehensive test suite
βββ docs/ # Documentation
βββ examples/ # Usage examples
βββ dist/ # Built output
# Development (with hot reload)
bun run dev # Start dev server
# Testing
bun test # Run tests
bun test --watch # Watch mode
bun test --coverage # With coverage
# Building
bun run build # Build for production
bun run type-check # TypeScript type checking
# Code Quality
bun run lint # Lint code
bun run format # Format code
bun run lint:fix # Auto-fix linting issues
# Server Testing
bun run test:server # Test server functionality
bun run start # Start built server// Process text with various operations
{
"name": "process_text",
"arguments": {
"text": "Hello World",
"operation": "reverse"
}
}
// Returns: "dlroW olleH"// Perform calculations
{
"name": "calculate",
"arguments": {
"expression": "2 + 3 * 4"
}
}
// Returns: 14Add this to your Claude Desktop configuration:
{
"mcpServers": {
"my-mcp-server": {
"command": "node",
"args": ["/path/to/your/project/dist/index.js"],
"env": {}
}
}
}When you create a new project with this template:
- Complete MCP Server: Ready to run with example tools
- TypeScript Setup: Modern configuration with type safety
- Development Environment: Hot reload, testing, linting
- Example Tools: Text processing and math calculations
- Test Suite: 15+ comprehensive tests
- Build System: Optimized Vite configuration
- Documentation: Getting started guide and API docs
- Claude Integration: Ready-to-use configuration examples
# Build and test
bun run build
bun test
bun run lint
# Update package.json with your details
# - name: your-mcp-server-name
# - description: your server description
# - author: your name
# - repository: your repository URL# Login to npm
npm login
# Publish
npm publish# Test creating a project with your package
bunx your-package-name create test-project
cd test-project
bun run devTo keep your MCP server up to date:
# Pull latest changes from template
git remote add template https://github.com/MrBrunoWolff/minimal-mcp-server.git
git fetch template
git merge template/mainBefore publishing your MCP server:
- Tests Pass: All 15+ tests should pass
- Build Works:
bun run buildcompletes without errors - Linting Clean:
bun run lintpasses - Types Valid:
bun run type-checkpasses - Package Name: Choose unique name on npm
- Documentation: Update README with your server details
- Repository: Push to GitHub/GitLab
- Version: Follow semantic versioning
Contributions are welcome! Please see our Contributing Guide for details.
MIT License - see LICENSE file for details.
- Issues: GitHub Issues
- Documentation: Getting Started Guide
- Examples: Example Configurations
- Battle-tested: 15+ comprehensive tests
- Modern Stack: TypeScript + Vite + Bun (runtime, package manager and test runner)
- Developer Experience: Hot reload, type safety, linting
- Production Ready: Optimized builds, CI/CD pipeline
- Community: Open source with active maintenance
- Fast Setup: One command to create new projects
Happy coding! π Start building your MCP server in seconds with modern TypeScript tooling.