Minimal MCP (Model Context Protocol) weather server quickstart in TypeScript. Contains a small MCP server that fetches forecasts and alerts from the NWS API.
Quick setup & run (recommended)
-
Clone this repository.
Replace with the URL of this repository (or your fork).
git clone <repo-url> mcp-weather-sandbox
cd mcp-weather-sandbox- Install the included MCP configuration so VS Code (or other tools that read
.vscode/mcp.json) can start the local MCP server. This repository includes a ready-to-usemcp.jsonthat points to the local, built server binary. Create the.vscodedirectory and install the file with the exact contents shown below:
mkdir -p .vscode
cat > .vscode/mcp.json <<'JSON'
{
"servers": {
"weather-server": {
"type": "stdio",
"command": "node",
"args": ["/home/yogisotho/dev/mcp-weather-sandbox/weather-server-typescript/build/index.js"]
}
},
"inputs": []
}
JSONNote: the args path uses an absolute path recorded for the developer's environment. If you cloned the repository to a different location, update the path to point to the build/index.js file in your clone (for example: $(pwd)/weather-server-typescript/build/index.js).
- Build and run the TypeScript MCP server:
cd weather-server-typescript
npm ci
npm run build
node build/index.jsOr use the repository helper script from the repo root (if present):
./run-weather-server.shNotes:
- This repo intentionally includes TypeScript source in
weather-server-typescript/srcand the compiled output inweather-server-typescript/buildfor easy running. - If you prefer not to commit build output, remove
weather-server-typescript/buildfrom the repo and add it to.gitignore.