mcp-server-template

mcp-server-template

0

This project offers a generic Model Context Protocol (MCP) server written in Node.js, providing tool-calling capabilities for language models. It includes features such as example tools and supports customization.

mcp-server-template

LLM-agnostic MCP Server- node

This is a lightweight, generic Model Context Protocol (MCP) server implementation written in Node.js. It defines a few simple tools and can be used with any LLM that supports the MCP tool calling interface โ€” including Claude, ChatGPT (via wrappers), OpenDevin, or open-source LLMs.

๐Ÿ›  Features

  • Supports MCP over stdio
  • Defines two example tools:
    • about โ€” returns information about the server
    • hello โ€” returns a friendly greeting
  • Built with the official @modelcontextprotocol/sdk

๐Ÿ“ฆ Installation

git clone https://github.com/yourusername/mcp-generic-server.git
cd mcp-generic-server
npm install

๐Ÿš€ Running the Server

node index.js

This will start the server and connect it via stdio (e.g., for use in Claude Desktop or similar tool-calling environments).

๐Ÿ”ง Tool Definitions

  1. about Description: Returns information about the MCP server.

Input Schema: {}

  1. hello Description: Returns a greeting.

Input Schema:

json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name to greet (optional)"
    }
  },
  "required": []
}

๐Ÿ’ก Customization

To add your own tools, modify the TOOLS array in index.js and extend the "tools/call" logic to handle them.

๐Ÿงช Testing

You can test the server using:

Claude Desktop (via stdio plugin)

A custom LLM tool-caller that supports MCP over stdio

Manual calls using tools like ncat, jq, or a test harness

๐Ÿ›  MCP Methods Supported

initialize

tools/list

tools/call

resources/list (returns empty array)

prompts/list (returns empty array)

๐Ÿ›ก License

This project is licensed under the MIT License. Please retain attribution in derivative works.

๐Ÿ™Œ Credits

Built using the Model Context Protocol SDK.