MCP Server Template
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Server Template check the health status of the server"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server Template
Template TypeScript para criacao de servidores MCP (Model Context Protocol) usando o SDK oficial @modelcontextprotocol/sdk.
Copie este repositorio como ponto de partida para qualquer novo servidor MCP. A estrutura ja esta pronta com contrato de tool, adaptador de registro e uma tool de exemplo.
Estrutura
.
├── src/
│ ├── core/
│ │ └── protocols/
│ │ └── McpTool.ts # Interface base para todas as tools
│ ├── adapters/
│ │ └── registerMcpTools.ts # Registra tools no McpServer
│ ├── tools/
│ │ └── HealthTool.ts # Tool de exemplo (health check)
│ └── main.ts # Bootstrap do servidor (stdio)
├── claude_desktop_config.example.json
├── package.json
└── tsconfig.jsonRelated MCP server: TypeScript MCP Server Boilerplate
Decisoes de arquitetura
core/protocols/McpTool.ts
Contrato que toda tool deve implementar. Desacopla as tools do SDK, tornando cada uma independente e testavel.
export interface McpTool<
TInput extends Record<string, unknown> = Record<string, unknown>,
> {
name: string;
description: string;
inputSchema: McpInputSchema; // Record<string, z.ZodTypeAny>
execute(input: TInput): Promise<string>;
}adapters/registerMcpTools.ts
Unico ponto que conhece o McpServer. Itera sobre as tools e faz o bind via server.registerTool, mantendo o resto do codigo desacoplado do SDK.
tools/
Cada tool e uma classe que implementa McpTool. O inputSchema usa tipos Zod para que o SDK valide e documente os parametros automaticamente.
main.ts
Bootstrap do processo. Instancia o servidor, registra as tools e conecta o transporte stdio.
Regra importante: nunca use
console.log— o canalstdoute reservado para o protocolo MCP. Use sempreconsole.errorpara logs.
Rodando localmente
npm install
npm run devScripts
Comando | Descricao |
| Modo desenvolvimento com hot reload (tsx) |
| Compila TypeScript para |
| Executa o servidor compilado |
| Valida tipos sem emitir arquivos |
Como usar este template
1. Copie o repositorio
cp -r mcp-server-template ../meu-novo-mcp
cd ../meu-novo-mcp
npm install2. Compile e execute
npm run build
node build/main.js3. Configure o cliente MCP
Use claude_desktop_config.example.json como base:
{
"mcpServers": {
"meu-novo-mcp": {
"command": "node",
"args": ["/caminho/absoluto/para/meu-novo-mcp/build/main.js"]
}
}
}Como adicionar uma nova tool
1. Crie a classe da tool em src/tools/
// src/tools/MinhaFerramenta.ts
import { z } from "zod";
import { McpTool } from "../core/protocols/McpTool.js";
export class MinhaFerramenta implements McpTool<{ mensagem: string }> {
name = "minha_ferramenta";
description = "Descricao do que esta tool faz.";
inputSchema = {
mensagem: z.string().describe("Texto de entrada"),
};
async execute(input: { mensagem: string }): Promise<string> {
return JSON.stringify({ resultado: input.mensagem.toUpperCase() });
}
}2. Registre em src/main.ts
import { MinhaFerramenta } from "./tools/MinhaFerramenta.js";
registerMcpTools(server, [new HealthTool(), new MinhaFerramenta()]);Dependencias
Pacote | Finalidade |
| SDK oficial para criacao de servidores MCP |
| Validacao e tipagem dos inputs das tools |
| Execucao de TypeScript sem build (dev) |
| Compilador TypeScript |
Available Tools
1 toolhealthB
Retorna o status do servidor MCP.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool 'health' has a clearly distinct and singular purpose of returning server status.
A single tool inherently has perfect naming consistency as there are no other tools to compare against. The name 'health' is clear and follows a simple noun pattern.
One tool is too few for a server described as a 'template', which implies a broader scope or example set. A template should ideally demonstrate multiple tools to guide users, making this count inappropriate for the stated purpose.
The server is severely incomplete for a template purpose, as it only provides a health check tool with no other functionality. This leaves significant gaps, failing to cover any meaningful domain or provide a useful example surface.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A simple Typescript MCP server built using the official MCP Typescript SDK and smithery/cli. This…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- -licenseBqualityNot gradedmaintenanceA boilerplate project for quickly developing Model Context Protocol (MCP) servers using TypeScript SDK. Includes example tools for calculations and greetings, plus system information resources.23-
- AlicenseNot gradedqualityDmaintenanceA boilerplate project for quickly developing Model Context Protocol (MCP) servers using TypeScript SDK, with example implementations of tools (calculator, greetings) and resources (server info) using Zod schema validation.85 npmISC
- AlicenseNot gradedqualityDmaintenanceA starter kit for quickly building Model Context Protocol (MCP) servers using the TypeScript SDK. It includes a structured project setup with pre-configured examples for implementing tools, resources, and Zod-based schema validation.501 npmMIT
- AlicenseNot gradedqualityDmaintenanceA starter project designed to quickly build and deploy Model Context Protocol (MCP) servers using the TypeScript SDK and Zod for schema validation. It features example implementations for tools and resources, providing a solid foundation for custom MCP development and integration.ISC