Skip to main content
Glama

local-mcp

An extensible local Model Context Protocol (MCP) server for building and running tools from VS Code. Weather is the first tool set in the repository, and additional tools can be added over time.

The server communicates over stdio. The current implementation exposes two weather tools backed by the US National Weather Service API:

  • get_alerts: returns active weather alerts for a two-letter US state code, such as CA or NY.

  • get_forecast: returns the forecast for a latitude and longitude. The National Weather Service API supports US locations only.

Requirements

  • Node.js 20 or later

  • npm

  • VS Code with MCP support

Related MCP server: Weather MCP Server

Set up locally

Clone the repository and install its dependencies:

git clone <repository-url>
cd local-mcp
npm install

Build the TypeScript source:

npm run build

The compiled server is written to build/index.js. To run it directly:

node build/index.js

The server uses stdio, so it is intended to be started by an MCP client rather than used as an interactive terminal command. It logs status and errors to stderr while MCP messages use stdin/stdout.

Use with VS Code

After building the project, add an MCP configuration file at .vscode/mcp.json in this repository, or add the same server to your user-level MCP configuration. The configuration starts the whole local MCP server, so tools registered in the server become available through the same entry point:

{
	"servers": {
		"local-mcp": {
			"type": "stdio",
			"command": "node",
			"args": ["${workspaceFolder}/build/index.js"]
		}
	}
}

Start or restart the local-mcp server from VS Code. The registered tools will then be available to supported chat experiences in the workspace.

If the project is stored outside the active workspace, replace ${workspaceFolder}/build/index.js with the absolute path to the compiled build/index.js file.

Current tools: weather

get_alerts

{
	"state": "CA"
}

state must be exactly two characters. The server normalizes the value to uppercase before requesting alerts.

get_forecast

{
	"latitude": 37.7749,
	"longitude": -122.4194
}

latitude must be between -90 and 90, and longitude must be between -180 and 180.

Adding more tools

Add each tool’s implementation to its own module under src/, then register it in src/index.ts. Rebuild the project after making changes:

npm run build

Update the current tools section above when adding or changing tool inputs. The VS Code MCP configuration does not need to change unless the server entry point or launch command changes.

Development

After changing files in src/, rebuild the server:

npm run build

The upstream weather data comes from api.weather.gov. Network access is required when a tool is called. The project does not currently include automated tests; npm test is the placeholder npm script.

Project structure

src/
	index.ts    MCP server setup and tool registration
	weather.ts  Current weather tool implementations
build/        Compiled JavaScript output

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides weather information tools based on the National Weather Service APIs through an SSE-based MCP server that can run as a standalone process or Docker container.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides weather forecasts and active alerts for US locations using the National Weather Service API. It supports both local stdio and remote HTTP/SSE transport modes for flexible integration with MCP clients.
    56 npm
    GPL 3.0
  • F
    license
    B
    quality
    D
    maintenance
    Provides weather forecasts and alerts for US locations using the National Weather Service API. Enables users to retrieve active alerts by state and detailed forecasts by coordinates via MCP tools.
    2
    -