Skip to main content
Glama
won3er

mermaid-mcp

by won3er

MCP Server Básico

Servidor Model Context Protocol (MCP) de exemplo, escrito em TypeScript e Node.js, usando o SDK oficial @modelcontextprotocol/sdk.

📖 Nunca usou MCP? Siga o Guia de Uso passo a passo — do zero até usar no Claude Desktop, sem precisar saber programar.

Capacidades

Tipo

Nome

Descrição

Tool

hello

Recebe name e retorna Olá, <name>!

Resource

info

resource://info — texto explicando o servidor

Prompt

assistant

Recebe topic e gera um prompt de sistema sobre esse tema

Related MCP server: FastMCP Demo

Estrutura do projeto

mermaid MCP/
├── src/
│   ├── index.ts              # Ponto de entrada: cria o servidor e conecta via stdio
│   ├── tools/
│   │   └── hello.ts          # Tool "hello"
│   ├── resources/
│   │   └── info.ts           # Resource "info" (resource://info)
│   └── prompts/
│       └── assistant.ts      # Prompt "assistant"
├── package.json
├── tsconfig.json
└── README.md

Arquitetura

graph TD
    Claude["Cliente Claude<br/>(Claude Desktop)"]
    Server["MCP Server<br/>(index.ts — stdio / JSON-RPC 2.0)"]

    Tools["Tools<br/>(src/tools/)"]
    Resources["Resources<br/>(src/resources/)"]
    Prompts["Prompts<br/>(src/prompts/)"]

    Hello["hello<br/>name → 'Olá, name!'"]
    Info["info<br/>resource://info"]
    Assistant["assistant<br/>topic → prompt de sistema"]

    Claude -- "tools/call" --> Server
    Claude -- "resources/read" --> Server
    Claude -- "prompts/get" --> Server

    Server --> Tools
    Server --> Resources
    Server --> Prompts

    Tools --> Hello
    Resources --> Info
    Prompts --> Assistant

    Hello -. "resposta (content)" .-> Server
    Info -. "resposta (contents)" .-> Server
    Assistant -. "resposta (messages)" .-> Server
    Server -. "resultado JSON-RPC" .-> Claude

Fluxo de uma chamada de Tool

sequenceDiagram
    participant Claude as Cliente Claude
    participant Server as MCP Server
    participant Tool as Tool "hello"

    Claude->>Server: initialize
    Server-->>Claude: capabilities (tools, resources, prompts)
    Claude->>Server: notifications/initialized

    Claude->>Server: tools/call { name: "hello", arguments: { name: "Maria" } }
    Server->>Tool: valida input (Zod) e executa handler
    Tool-->>Server: { content: [{ type: "text", text: "Olá, Maria!" }] }
    Server-->>Claude: resposta JSON-RPC com o resultado

Requisitos

  • Node.js 18 ou superior

Instalação

npm install

Desenvolvimento

Executa direto do TypeScript, sem compilar (via tsx):

npm run dev

Build e execução

npm run build   # compila TypeScript para ./build
npm start       # executa node build/index.js

O servidor se comunica por stdio (stdin/stdout com JSON-RPC 2.0). Ele não abre porta HTTP — quem o inicia é o cliente MCP (ex.: Claude Desktop).

Testando manualmente

Com o MCP Inspector:

npx @modelcontextprotocol/inspector node build/index.js

Conectando ao Claude Desktop

  1. Compile o projeto: npm run build

  2. Abra o arquivo de configuração do Claude Desktop:

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  3. Adicione o servidor (ajuste o caminho absoluto):

{
  "mcpServers": {
    "mcp-server-basico": {
      "command": "node",
      "args": [
        "C:\\CAMINHO\\ATE\\O\\PROJETO\\mermaid-mcp\\build\\index.js"
      ]
    }
  }
}
  1. Reinicie o Claude Desktop. O servidor aparecerá no menu de ferramentas (ícone 🔌 / "Search and tools").

Depois disso você pode pedir, por exemplo: "Use a tool hello com o nome Maria".

Adicionando novas Tools

  1. Crie um arquivo em src/tools/, exportando uma função registerXxxTool(server).

  2. Dentro dela, chame server.registerTool(nome, config, handler).

  3. Importe e chame a função em src/index.ts.

  4. Rode npm run build e reinicie o cliente MCP.

Available Tools

1 tool
helloHelloA

Recebe um nome e retorna uma saudação personalizada.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesNome da pessoa a ser saudada

TDQS

A3.6/5.0
Behavior2/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 only states the input and output, but does not disclose any behavioral traits such as side effects, authentication requirements, or rate limits. For a simple tool, this is minimally acceptable.

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 in Portuguese (14 words). It is front-loaded with the core function and contains no unnecessary information.

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 tool with one parameter and no output schema, the description is mostly complete. It could optionally mention the output format (e.g., 'returns a string greeting'), but the current description suffices.

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 description coverage is 100% (the 'name' parameter is described in the schema). The tool description does not add additional parameter semantics beyond what the schema already provides, so a baseline score of 3 is appropriate.

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 that it receives a name and returns a personalized greeting. It uses a specific verb+resource structure ('Recebe um nome e retorna uma saudação') and is unambiguous.

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?

The description does not explicitly state when to use this tool vs alternatives. However, there are no sibling tools, so the lack of alternative guidance is acceptable. The context is clear.

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. Dates show when Glama detected each change.

  1. 1 tool updatev1.0.0
    • First observedhello

TDQS

B3.4/5.0
Disambiguation5/5

Only one tool exists, so there is no risk of confusion or overlapping purposes.

Naming Consistency5/5

With a single tool, naming consistency is inherently perfect.

Tool Count1/5

A server named 'mermaid-mcp' with just one trivial greeting tool is an extreme mismatch between scope and tool count.

Completeness1/5

The tool set is severely incomplete for the implied domain of mermaid diagram generation or manipulation, as it only offers a greeting function.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A minimal demonstration server showcasing MCP protocol capabilities including tools, resources, and prompts with basic examples like hello world functionality.
    2
    MIT
  • F
    license
    B
    quality
    D
    maintenance
    A demonstration TypeScript MCP server that showcases basic MCP concepts with simple tools (greeting, calculator), text resources, and prompt templates for learning the Model Context Protocol.
    2
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A simple demonstration MCP server that provides a basic 'say_hello' tool for greeting users by name, serving as a template for building MCP servers with TypeScript.
    13
    1
    ISC
  • A
    license
    Not graded
    quality
    D
    maintenance
    A minimal template MCP server demonstrating basic tools, resources, and prompts functionality. Includes example implementations like a hello tool, history resource, and greet prompt for learning MCP development.
    2
    ISC

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/won3er/basic-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server