mermaid-mcp

mermaid-mcp

A basic MCP server example with a hello tool, info resource, and assistant prompt, built with TypeScript and Node.js using the official MCP SDK.

Category
Visit Server

README

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

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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured