Skip to main content
Glama
agiulucom42-del

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
aYesFirst number
bYesSecond number

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that the tool is a calculation (no side effects), which is sufficient for a simple mathematical operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that conveys the essential information without any wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter tool with no output schema required, the description is adequate. It covers the core functionality, and the schema covers the parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with clear descriptions ('First number', 'Second number'). The description adds no additional meaning beyond what the schema provides, achieving the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('calculates') and the resource ('sum of two numbers'). It is unambiguous and directly conveys the tool's function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidelines are provided. However, since there are no sibling tools, the need for explicit alternatives is reduced. The description implies usage from the name but offers no additional context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 1 tool updatev1.0.0
    • First observedcalculate_sum

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

ActivityMaintained
ResponsivenessSyncing

Related MCP Connectors