mcp-server
A starter MCP server built with the official TypeScript SDK, providing example tools for echoing messages and getting current time.
README
mcp-server
A starter Model Context Protocol (MCP) server, built with the official TypeScript SDK.
It ships with two example tools:
echo— echoes a message back to the caller (useful for testing connectivity)get_time— returns the current date/time, optionally in a given IANA timezone
Use these as templates, then add your own tools in src/index.ts.
Getting started
npm install
npm run build
npm start
The server communicates over stdio, so it's meant to be launched by an MCP client (e.g. Claude Desktop, Claude Code) rather than run standalone.
Development
npm run dev # watch mode, recompiles on change
Test interactively with the MCP Inspector:
npm run build
npm run inspector
Connecting to an MCP client
Add an entry pointing at the built server, e.g. for Claude Desktop's claude_desktop_config.json:
{
"mcpServers": {
"mcp-server": {
"command": "node",
"args": ["/absolute/path/to/mcp-server/build/index.js"]
}
}
}
Registering with the Claude Code CLI
You can also register this server (or any third-party MCP server) with the claude mcp add command instead of editing a client's config file by hand:
# This project, at user scope (available in every project on your machine)
claude mcp add mcp-server -s user -- node /absolute/path/to/mcp-server/build/index.js
The same pattern works for other MCP servers distributed via npm. A couple of examples:
Perplexity's MCP server (requires an API key):
claude mcp add perplexity -s user --env PERPLEXITY_API_KEY="your-api-key" -- npx -y @perplexity-ai/mcp-server
Playwright's MCP server (browser automation, no API key needed):
claude mcp add playwright -s user -- npx -y @playwright/mcp@latest
-s userregisters the server at user scope (all projects); use-s projectto scope it to the current repo instead.--env KEY=valuepasses environment variables (e.g. API keys) to the server process.- Everything after
--is the command used to launch the server. - Replace
"your-api-key"with a real key from the provider's dashboard — a placeholder value will cause auth failures.
Project structure
src/
index.ts # server entry point: tool definitions + handlers
build/ # compiled output (generated, gitignored)
Adding a new tool
- Add its JSON schema to the
TOOLSarray insrc/index.ts. - Handle it in the
CallToolRequestSchemaswitch statement. - Validate its arguments with a zod schema, as the examples do.
- Rebuild (
npm run build) and reconnect your MCP client.
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.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
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.