home / mcp / mcp server boilerplate mcp server
Provides a boilerplate MCP server with two example tools, TypeScript support, and multi-client installation scripts.
Configuration
View docs{
"mcpServers": {
"boosclues-mcp-creator": {
"command": "npx",
"args": [
"-y",
"@r-mcp/boilerplate",
"@latest"
],
"env": {
"API_KEY": "YOUR_API_KEY",
"DATABASE_URL": "postgres://user:pass@host/db"
}
}
}
}You create MCP (Model Context Protocol) servers to expose tools, resources, and prompts that AI assistants can call. This boilerplate gives you a clean, TypeScript-based foundation to quickly build an MCP server that can integrate with Claude Desktop, Cursor, Claude Code, Gemini, and other MCP-compatible assistants.
Use an MCP client to connect to your server and start calling your tools. You can run the server locally during development or deploy it so clients connect remotely. The production setup uses a ready-made command that fetches and runs the boilerplate from npm, while the local development flow runs your built code directly for fast iteration.
Prerequisites you need before installing:
- Node.js (recommended v18+)
- npm or pnpm for package management
- A code editor for editing TypeScript files (optional but helpful)Option 1 β Use the published package (recommended)
Run the server directly with npx
```
npx @r-mcp/boilerplateOption 2 β Customize and develop
Clone the boilerplate, install dependencies, build, and run
```
git clone <your-repo-url>
cd mcp-server-boilerplate
# Install dependencies
pnpm install
# Build the project
pnpm run build
# Start the server
pnpm startInstallation scripts are provided to install the server across MCP clients. You can install to all clients or target specific ones. Running these scripts builds the project, configures clients to use the latest MCP package, and includes environment variables from a local .env.local when present.
Environment variables can be defined in a local .env.local file. They are automatically included in MCP server configurations during installation.
Example environment variables you might use:
``
API_KEY=your-api-key
DATABASE_URL=your-database-url
``
During development you can modify the server logic in the source files, build, and test locally. The typical flow is to edit source, run the build step, and start the server to verify behavior with a client.
# Build the TypeScript project
pnpm run build
# Start the server for local testing
pnpm startWhen you are ready to publish your customized MCP server, you can run a release workflow that builds the project, bumps the version, commits changes, and publishes to npm.
pnpm run releaseTwo example tools are included to illustrate how you expose functionality to MCP clients: a simple greeting tool and a documentation helper. You can add more tools by following the server toolkitβs API for tool creation.
A simple tool that returns a greeting, demonstrating parameter handling and basic response structure.
A tool that fetches or returns MCP documentation content to help users discover capabilities.