Cover image
Try Now
2025-03-14

简化Node.js的MCP服务器模板

3 years

Works with Finder

1

Github Watches

1

Github Forks

1

Github Stars

MCP JS Server Template

Overview

This is a simplified template for creating Model Context Protocol (MCP) servers in JavaScript for integration with Claude Desktop. It provides a basic structure for developing custom MCP servers with minimal boilerplate code.

Features

  • Implements standard MCP server initialization
  • Provides two basic tools: about and hello
  • Follows MCP protocol version 2024-11-05
  • Uses @modelcontextprotocol/sdk for server implementation
  • Includes error handling and logging

Prerequisites

  • Node.js (v16 or later)
  • Claude Desktop
  • @modelcontextprotocol/sdk npm package

Installation

  1. Clone the repository
  2. Install dependencies:
npm install @modelcontextprotocol/sdk

Claude Desktop Configuration

Add to your Claude Desktop configuration file:

Location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Configuration Example:

{
  "mcpServers": {
    "template-server": {
      "command": "node",
      "args": [
        "/full/path/to/simplified-template-mcp-server.js"
      ],
      "env": {
        "NODE_OPTIONS": "--no-deprecation"
      }
    }
  }
}

Available Tools

1. about

Returns information about the MCP server.

2. hello

Provides a greeting, with an optional name parameter.

Example Usage in Claude:

hello with name="Claude"

Extending the Template

To create your own MCP server:

  1. Copy this template
  2. Modify the TOOLS array
  3. Implement custom tool handlers in server.fallbackRequestHandler
  4. Update server name and version

Limitations

  • Minimal error handling
  • No advanced security features
  • Meant as a starting point for custom implementations

Contributing

Contributions are welcome! Please submit pull requests or open issues.

License

MIT License

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    3 (1)
    Avatar
    user_hAgrL1mb
    2025-04-16

    As a dedicated user of the MCP-JS-Server-Template, I can confidently say it's an exceptional boilerplate for any JavaScript server project. Created by ryaker, this template simplifies setup and boosts efficiency. I highly recommend checking it out on GitHub: https://github.com/ryaker/MCP-JS-Server-Template. It's been a game-changer for my development process!