Skip to main content
Glama
mcp-boilerplate

mcp-boilerplate

🧩 MCP Server Template Boilerplate

Production-ready MCP server starter with TypeScript, realistic examples, and Claude Desktop integration.

npm version License: MIT CI


A production-ready boilerplate for building Model Context Protocol (MCP) servers using TypeScript and Node.js.

Features

  • TypeScript pre-configured for modern module resolution (NodeNext)

  • tsup configured for lightning-fast builds

  • Clean MCP SDK setup using StdioServerTransport

  • Example Tool (web_fetch) — fetches URLs and returns content as a resource

  • Example Resource (file://read) — reads local files securely

  • Claude Desktop integration guide

Quick Start

Installation

git clone https://github.com/agiulucom42-del/mcp-boilerplate.git
cd mcp-boilerplate
npm install
npm run build

Run the server

npm start

MCP servers using stdio communicate via standard input/output. npm start waits for JSON-RPC messages from an MCP client.

Integration with Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-boilerplate/dist/index.js"]
    }
  }
}

Example Tool: web_fetch

The boilerplate ships with a realistic tool that fetches a URL and returns its content:

server.setRequestHandler(CallToolRequestSchema, async (request) => {
  if (request.params.name === "web_fetch") {
    const url = String(request.params.arguments?.url);
    const response = await fetch(url);
    const text = await response.text();
    return {
      content: [{ type: "text", text: text.slice(0, 10000) }]
    };
  }
  throw new Error("Tool not found");
});

Example Resource: file://read

Safely read files from an allowed directory:

server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
  const path = request.params.uri.replace("file://", "");
  const content = await fs.readFile(path, "utf-8");
  return {
    contents: [{ uri: request.params.uri, text: content }]
  };
});

How to Customize

  1. Add Tools: Edit the CallToolRequestSchema handler in src/index.ts

  2. Add Resources: Edit ReadResourceRequestSchema and ListResourcesRequestSchema

  3. Change Name: Update the name in new Server() instantiation


🚀 HUQAN Ecosystem

mcp-boilerplate is part of the HUQAN trust infrastructure for AI. Sister projects:

Tool

What it does

env-sentinel

🔴 Stop leaking API keys

readme-score

📊 Score your README quality

repo-risk-scan

🛡️ Scan repo before giving to agent

pr-scope-check

📏 Block PR scope creep

llm-diff

🔍 Compare LLM outputs

token-budget

💰 Track LLM API costs

axiom-verify

✅ Validate LLM JSON outputs

mcp-boilerplate

🧩 MCP server starter You are here


License

MIT © HUQAN


Available Tools

1 tool
calculate_sumA

Calculates the sum of two numbers.

Inputs: a (required), b (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of ambiguity between tools.

    Naming Consistency5/5

    The single tool uses a consistent verb_noun pattern (calculate_sum), which is clear and predictable.

    Tool Count1/5

    A single trivial tool is an extreme mismatch for a functional server, even if it is a boilerplate example.

    Completeness1/5

    The server only offers a sum operation, lacking any other arithmetic operations, making it severely incomplete for basic math tasks.

    Maintenance

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors