A simple Model Context Protocol (MCP) server that provides real-time weather data to AI agents like GitHub Copilot
A simple Model Context Protocol (MCP) server that provides real-time weather data to AI agents like GitHub Copilot.
Clone the repository:
git clone https://github.com/debs-obrien/mcp-weather-server-demo.git
cd mcp-weather-server-demo
npm install
Test with MCP Inspector:
npx -y @modelcontextprotocol/inspector npx -y tsx main.ts
mcp.jsonfile in .vscode folderAsk GitHub Copilot:
The server provides a get-weather tool that:
// Creates MCP server with weather tool
const server = new McpServer({
name: "Weather Server",
version: "1.0.0"
});
// Defines the get-weather tool
server.tool('get-weather', 'Tool to get the weather of a city', ...);
// Connects via stdio transport
const transport = new StdioServerTransport();
server.connect(transport);
@modelcontextprotocol/sdk - MCP server frameworkzod - Schema validationBuilding Your First MCP Weather Server: A Complete Tutorial
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.