Skip to main content
Glama
generic-mcp-server

generic-mcp-server

by v4lheru

Generic MCP Server Template

A flexible template for creating Model Context Protocol (MCP) servers using the official TypeScript SDK.

What is MCP?

The Model Context Protocol (MCP) enables communication between AI assistants and locally running servers that provide additional tools and resources.

Related MCP server: Swagger MCP

Features

  • Official SDK: Built with @modelcontextprotocol/sdk

  • Type Safety: Full TypeScript support with Zod validation

  • Stdio Transport: Standard transport for local agent integration

  • Modular Design: Easy to add new tools and resources

Getting Started

Prerequisites

  • Node.js (v16 or later)

  • npm or yarn

Installation

  1. Clone the repository:

    git clone https://github.com/v4lheru/generic-mcp-template.git
    cd generic-mcp-server
  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build

Usage

To run the server locally (for testing or development):

npm run start

Note: This server uses stdio transport, so it expects to communicate via standard input/output. It will not start an HTTP server.

Adding to Claude Desktop

  1. Open Claude Desktop config (e.g. ~/Library/Application Support/Claude/claude_desktop_config.json on macOS).

  2. Add your server:

{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["/path/to/generic-mcp-server/dist/index.js"]
    }
  }
}

Customization

  • Tools: Add new tools in src/tools.ts.

  • Resources: Add new resources in src/resources.ts.

  • Config: Update src/config.ts for environment variables.

License

MIT

Available Tools

2 tools
calculate-sumB

Calculates the sum of two numbers

Inputs: a (required), b (required).

get-weatherC

Get weather forecast for a city

Inputs: city (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have completely distinct purposes: calculate-sum performs a mathematical operation on numbers, while get-weather retrieves weather data for a city. There is no overlap or ambiguity between these functions, making it impossible for an agent to confuse them.

    Naming Consistency3/5

    The tool names use a verb-noun pattern (calculate-sum, get-weather), which is consistent in structure. However, they use different verb styles (calculate vs. get) and a hyphen delimiter, which is readable but shows minor deviation in convention.

    Tool Count2/5

    With only 2 tools, the server feels thin and under-scoped for a generic purpose. This minimal set lacks coverage for typical operations in any specific domain, making it inappropriate for most agent workflows.

    Completeness1/5

    The tool surface is severely incomplete for a generic server. There are major gaps in functionality, such as missing basic CRUD operations, data processing tools, or domain-specific coverage, which will likely cause agent failures in practical use.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers