- Home
- MCP servers
- MCP Server Boilerplate
MCP Server Boilerplate
- javascript
0
GitHub Stars
javascript
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
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.
How to use
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.
How to install
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/boilerplate
Option 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 start
Additional setup and notes
Installation 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.
Project configuration and environment
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:
DATABASE_URL=your-database-url```
## Development workflow
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 start
## Publishing updates
When 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 release
## Tools you can add
Two 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.
## Available tools
### hello-world
A simple tool that returns a greeting, demonstrating parameter handling and basic response structure.
### get-mcp-docs
A tool that fetches or returns MCP documentation content to help users discover capabilities.