Sample
Mcp server, using model context protocol sdk and a http interface
What is Sample?
Sample is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server, using model context protocol sdk and a http interface
Mcp server, using model context protocol sdk and a http interface
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Mcp server, using model context protocol sdk and a http inte
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx sampleConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Sample
The Sample MCP Server (mcp-server-sample) is an educational reference implementation of the Model Context Protocol built with the official @modelcontextprotocol/sdk for Node.js/TypeScript. It exposes two weather tools — get-alerts (active NWS weather alerts by US state) and get-forecast (weather forecast by latitude/longitude) — using a clean Domain-Driven Design architecture with separated domain, infrastructure, application, and interface layers, making it an ideal starting point for developers learning how to structure a production MCP server.
Prerequisites
- Node.js 18 or higher with npm
- Git to clone the repository
- An MCP-compatible client such as Claude Desktop
- Internet access to reach the US National Weather Service API (no API key required)
Clone the repository
Clone the mcp-server-sample repository from GitHub and change into the project directory.
git clone https://github.com/gabrielfroes/mcp-server-sample.git
cd mcp-server-sampleInstall dependencies
Install the project dependencies using npm. The key dependency is @modelcontextprotocol/sdk for MCP communication and zod for input validation.
npm installBuild the TypeScript project
Compile the TypeScript source to JavaScript. The output lands in the build/ directory and the entry point is build/main.js.
npm run buildRun the server locally to verify it starts
Start the server directly with Node. It communicates via stdio and will wait for MCP requests — this is normal; the server is ready when no error appears.
node build/main.jsRegister the server in your MCP client configuration
Add an entry for the server in claude_desktop_config.json (or your client's equivalent), pointing to the compiled build/main.js file.
Sample Examples
Client configuration
Add this to claude_desktop_config.json after cloning and building the project. Replace the path with the absolute path to your local build/main.js.
{
"mcpServers": {
"mcp-server-sample": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-sample/build/main.js"]
}
}
}Prompts to try
Example prompts that exercise the two NWS weather tools exposed by this server.
- "Are there any active weather alerts in California right now?"
- "What is the weather forecast for New York City? (latitude 40.7128, longitude -74.0060)"
- "Check for severe weather alerts in Texas."
- "Give me the 7-day forecast for San Francisco (37.7749, -122.4194)."Troubleshooting Sample
npm run build fails with TypeScript errors
Make sure you are running Node.js 18 or higher ('node --version'). Run 'npm install' again to ensure all type definitions are present, then retry the build.
get-forecast returns an error for coordinates outside the US
The National Weather Service API only covers US locations. The get-forecast tool requires valid US latitude/longitude values. For non-US locations, the NWS API will return an error — this is a limitation of the upstream API, not the server itself.
Claude Desktop does not show the weather tools after adding the config
Verify the path in args points to the compiled build/main.js (not src/main.ts). Run 'node /your/path/build/main.js' from a terminal — if that errors, the build step did not complete. Fully quit and relaunch Claude Desktop after editing the config.
Frequently Asked Questions about Sample
What is Sample?
Sample is a Model Context Protocol (MCP) server that mcp server, using model context protocol sdk and a http interface It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Sample?
Follow the installation instructions on the Sample GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Sample?
Sample works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Sample free to use?
Yes, Sample is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Sample Alternatives — Similar Developer Tools Servers
Looking for alternatives to Sample? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Sample in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Sample?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.