About Typescript Boilerplate
Typescript Boilerplate is an MCP server published by andradehenrique in the Developer Tools category: typeScript MCP server boilerplate — official SDK, no wrapper framework.
The repository has 3 stars and 0 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
git clone https://github.com/andradehenrique/mcp-typescript-boilerplateThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Typescript Boilerplate
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
5 checks have not been run yet.
README
MCP TypeScript Boilerplate
A comprehensive TypeScript boilerplate for creating Model Context Protocol (MCP) servers with support for stdio, SSE, and HTTP transports.
🚀 Features
- Multiple Transport Support: stdio, Server-Sent Events (SSE), and HTTP
- TypeScript: Full type safety and modern development experience
- Modular Architecture: Clean separation of tools, utilities, and server logic
- Structured Logging: Built-in logger with configurable levels
- Generic API Client: Reusable HTTP client with interceptors and error handling
- Tool Factory: Streamlined tool creation with validation and error handling
- Development Ready: Hot reload, linting, formatting, and type checking
🛠️ Getting Started
Prerequisites
- Node.js >= v18.0.0
- MCP Client (Cursor, VS Code, Claude Desktop, etc.)
Local Development
-
Clone and install:
git clone https://github.com/andradehenrique/mcp-typescript-boilerplate.git cd mcp-typescript-boilerplate npm install -
Build the project:
npm run build -
Run in different modes:
# Stdio mode (default) npm run start:stdio # HTTP server mode npm run start:http # Development with hot reload npm run dev
MCP Client Configuration
For Local Development
Configure your MCP client to use the built server directly:
{
"mcpServers": {
"mcp-typescript-boilerplate": {
"command": "node",
"args": ["/path/to/mcp-typescript-boilerplate/build/index.js"],
"env": {
"API_BASE_URL": "https://your-api-server.com/api",
"API_TOKEN": "your-api-token"
}
}
}
}
Using tsx for Development
{
"mcpServers": {
"mcp-typescript-boilerplate": {
"command": "npx",
"args": ["tsx", "/path/to/mcp-typescript-boilerplate/src/index.ts"],
"env": {
"API_BASE_URL": "https://your-api-server.com/api",
"API_TOKEN": "your-api-token"
}
}
}
}
Docker Support
-
Build and run:
docker build -t mcp-typescript-boilerplate . docker-compose up -
HTTP mode:
docker run -p 3000:3000 -e MCP_TRANSPORT=http mcp-typescript-boilerplate
Environment Variables
API_BASE_URL: Your API server base URL (optional)API_TOKEN: Your API authentication token (optional)API_TIMEOUT: Request timeout in milliseconds (default: 30000)MCP_TRANSPORT: Transport mode - stdio, http, or sse (default: stdio)HTTP_PORT: HTTP server port (default: 3000)
📚 Available Tools
This boilerplate includes 3 example tools:
hello-world- Simple greeting toolcalculate-sum- Number calculation examplemake-api-call- External API integration example
For detailed tool information, see TOOLS.md.
🏗️ Architecture
src/
├── index.ts # Entry point with transport selection
├── server.ts # MCP server setup and tool registration
├── http-server.ts # HTTP/SSE server implementation
├── mcp/
│ └── tools/
│ ├── index.ts # Tool exports
│ ├── toolFactory.ts # Tool creation utilities
│ └── example/ # Example tools
├── types/ # TypeScript type definitions
└── utils/ # Shared utilities
├── apiClient.ts # HTTP client
├── clientConfig.ts # Configuration
├── logger.ts # Logging utilities
└── responseFormatter.ts # Response formatting
🔧 Creating Tools
Use the provided toolFactory for easy tool creation:
import { z } from "zod";
import { createTool } from "../toolFactory.js";
import { ResponseFormatter } from "../../utils/responseFormatter.js";
export const myTool = createTool({
name: "my-tool",
description: "My custom tool",
schema: z.object({
input: z.string().describe("Input parameter"),
}),
handler: async (input) => {
// Your logic here
return ResponseFormatter.success("Success", { result: input });
},
});
Add to src/mcp/tools/index.ts:
import { myTool } from "./myTool.js";
export const allTools = [
myTool,
// ... other tools
];
📝 Available Scripts
npm run build- Build the projectnpm run dev- Development with hot reloadnpm run start:stdio- Start in stdio modenpm run start:http- Start HTTP servernpm run lint- Run ESLintnpm run format- Format code with Prettiernpm run type-check- Type checkingnpm run clean- Clean build directory
🔧 Testing
Test with MCP Inspector:
npx @modelcontextprotocol/inspector node build/index.js
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
See CONTRIBUTING.md for details.
🔗 Resources
📄 License
This project is licensed under the MIT License.
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.