trackmcp
Back to directory
RaulCalderon

my-first-mcp

View on GitHub

This is a simple MCP created with Typescript. This MCP uses "Open Meteo", a Free Open-Source Weather API

0 stars TypeScriptOthers Updated Jun 21, 2025

Documentation

MCP Weather Server Demo

This project is a sample MCP (Model Context Protocol) server that exposes a tool to fetch the weather for any city using the Open-Meteo API.

Features

  • Basic MCP server using `@modelcontextprotocol/sdk` and `zod` for validation.
  • `fetch-weather` tool that takes a city name and returns current weather information.
  • Uses public APIs for geocoding and weather data.

Installation

1. Clone this repository:

sh
git clone https://github.com/your-username/your-repo.git
   cd your-repo

2. Install dependencies:

sh
npm install

Usage

Run the MCP server:

sh
npx tsx main.ts

This will start the server and you can connect from any compatible MCP client.

Note:

You can also run this to use the inspector on the web browser.

sh
npx -y @modelcontextprotocol/inspector npx -y tsx main.ts

1.- Run the command.

2.- Go to the link provided in console.

3.- Configure the enviroment this way:

    4.- Connect -> List Tools -> Select your MCP -> Start using it.

    Main structure

    • `main.ts`: Source code for the server and weather tool.
    • `package.json`: Project dependencies and scripts.

    BONUS

    I attatched a json file (with a different name), which is used on Claude an AI Assistant built by Anthropic.

    In this file, we can use the AI to do incredible things, such as the following and many more:

    1.- Get access to folders and interact with your computer. ๐Ÿ“

    https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem

    `

    "mcpServers": {

    "filesystem": {

    "command": "npx",

    "args": [

    "-y",

    "@modelcontextprotocol/server-filesystem",

    "/Users/username/Desktop",

    "/path/to/other/allowed/dir"

    ]

    }

    }

    `

    Tasks examples (via prompts):

    Give permission to access the Desktop

      etc.

      2.- Get access to a database and start prompting simple or complex tasks. ๐Ÿค–

      https://github.com/modelcontextprotocol/servers-archived/tree/main/src/postgres

      `

      "postgres": {

      "command": "npx",

      "args": [

      "-y",

      "@modelcontextprotocol/server-postgres",

      "postgresql://DB_USER:DB_PASS@localhost:5432/DB_NAME"

      ]

      }

      `

      Tasks examples (via prompts):

      • Truncate a single table
      • Get all data from a single user and export it into a csv file.
      • Get all activity from a user that has root privileges on diferent tables.

      etc.

      You can install Claude Agent and configure the json file like this to test them.

      *[Just make sure you are using the Claude configuration in both cases.]*

      NOTE

      the 'weather' element in the configuration file, is the MCP we just created. Yes, you can using on Claude too.

      License

      This project is licensed under the MIT License. See the `LICENSE` file for details.


      > Example project to learn how to create MCP tools and consume public APIs.

      Frequently asked questions

      What is my-first-mcp?

      my-first-mcp is This is a simple MCP created with Typescript. This MCP uses "Open Meteo", a Free Open-Source Weather API

      How do I install my-first-mcp?

      Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

      Is my-first-mcp open source?

      Yes โ€” it is hosted on GitHub at https://github.com/RaulCalderon/my-first-mcp.

      Related MCP tools

      Run your own MCP server? See who uses it and what to fix.

      Measure it with TrackMCP