Get the FREE Ultimate OpenClaw Setup Guide →

MCP s-

This repo has my learnings on how to create an MCP-Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio krishcodesw-mcp-servers- node main.js

How to use

This MCP server is a starter example that demonstrates how to create an MCP server focused on Weather data. The main.js file implements a local, offline server using a STDIO transport, meaning it can operate without network access. It provides a simple context for weather-related data, which you can extend by integrating real APIs later. By default, you can run this server locally and communicate with it through the MCP framework's tooling. If you want online access, you can adapt the project to expose an SSE endpoint with an Express server, enabling remote consumption of weather data while keeping the core logic in the local STDIO-based server.

How to install

Prerequisites:

  • Node.js (LTS)
  • npm or yarn

Installation steps:

  1. Clone or download the repository containing main.js (the starter MCP server).
  2. Open a terminal and navigate to the project directory.
  3. Install dependencies (if any):
    • npm install
    • or yarn install
  4. Run the server:
    • node main.js

Notes:

  • Since this is a starter with offline STDIO transport, no external APIs are required initially.
  • To enable online access, integrate an Express server and SSE endpoint, then route weather data through that interface.

Additional notes

Tips:

  • The server operates via STDIO transport for offline usage. If you plan to deploy online, consider wiring an SSE endpoint with Express to serve data over HTTP.
  • You can modify main.js to fetch real weather data from external APIs and return it via the MCP interface.
  • If you encounter issues with missing dependencies, ensure Node.js versions are compatible and that dependencies listed in package.json (if present) are installed.
  • For production, you may want to containerize the server or adapt the configuration to run under a process manager. Environment variables to consider:
  • WEATHER_API_KEY: if you add external weather API integration
  • MCP_TRANSPORT: transport type (e.g., stdio, sse) if you support multiple transports
  • DEBUG: enable verbose logging (true/false)

Related MCP Servers

Sponsor this space

Reach thousands of developers