Example MCP Server
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.
README
Example MCP Server
A simple Model Context Protocol (MCP) server built with TypeScript and Node.js. This server demonstrates how to create an MCP server that exposes tools for use in Claude Desktop and other MCP clients.
Features
- Simple
say_hellotool that greets a person by name - Built with TypeScript for type safety
- Uses the official MCP SDK for Node.js
- STDIO transport for communication with MCP clients
Prerequisites
- Node.js (v16 or higher)
- npm
Installation
Install the project dependencies:
npm install
Building
Build the TypeScript source code:
npm run build
This will compile the TypeScript files from src/ to build/ and make the output executable.
Running the Inspector
After building, you can test your server using the MCP Inspector:
npm run inspector
Or run it directly:
npx @modelcontextprotocol/inspector@latest node build/index.js
The inspector provides a web-based interface where you can test your MCP tools interactively.
Development
For development with auto-reload, use:
npm run dev
Important: When developing MCP servers that use STDIO transport, always use console.error() for logging, never console.log(). Writing to stdout will corrupt the JSON-RPC messages and break your server.
Project Structure
example-mcp-server/
├── src/
│ └── index.ts # Main server implementation
├── build/ # Compiled output (generated)
├── package.json
├── tsconfig.json
└── README.md
Additional Resources
- MCP Server Setup Gist - Additional information and walkthrough for setting up MCP STDIO servers, including project setup, configuration, and Claude Desktop integration
- Official MCP Documentation - The official documentation for building MCP servers (Note: this documentation may not be up to date)
Claude Desktop Integration
To use this server with Claude Desktop, add it to your claude_desktop_config.json:
{
"mcpServers": {
"example_server": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/THIS/PROJECT/build/index.js"]
}
}
}
Note: Use the absolute path to the built index.js file. After making changes, fully quit and restart Claude Desktop for the configuration to take effect.
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.