Weather MCP Server

Weather MCP Server

Okay, here's an example of creating an MCP (Minecraft Coder Pack) server setup. This focuses on the core steps and assumes you have some basic familiarity with command lines and file management. Keep in mind that MCP is primarily used for *mod development*, not for running a standard Minecraft server. This setup is to allow you to decompile, modify, and recompile the Minecraft server code. **Important Considerations:** * **MCP is for Mod Development, Not Server Hosting:** MCP is designed to let you *modify* the Minecraft code. It's not a replacement for a standard Minecraft server (like the official server.jar or a Spigot/Paper server). You'll use MCP to change the code, then build a modified server jar. * **Minecraft Version Compatibility:** MCP is tied to specific Minecraft versions. You *must* use the correct MCP version for the Minecraft version you want to work with. Using the wrong versions will lead to errors. * **Legality:** You are allowed to modify the Minecraft code for personal use and mod development. Distributing the *original* Minecraft code (even modified) is generally not allowed. You can distribute your *mod* (the changes you made). * **Complexity:** Mod development with MCP is a complex process. This example provides a basic outline. Expect to encounter challenges and consult the MCP documentation and community resources. **Steps (Simplified):** 1. **Download MCP:** * Go to a reliable source for MCP downloads. A common place is often linked from the MinecraftForge forums or related modding communities. Search for "MCP [Minecraft Version]" (e.g., "MCP 1.19.2"). Make sure you download the correct version for the Minecraft version you want to mod. * Extract the downloaded MCP archive (usually a `.zip` or `.tar.gz` file) to a directory on your computer. For example, `C:\mcp` (Windows) or `/home/user/mcp` (Linux/macOS). This directory will be your MCP working directory. 2. **Download the Minecraft Server Jar:** * Download the official Minecraft server `.jar` file from the Minecraft website ([https://www.minecraft.net/en-us/download/server](https://www.minecraft.net/en-us/download/server)). Make sure it's the same version as the MCP version you downloaded. * Place the server `.jar` file in the `jars` subdirectory within your MCP directory. For example, `C:\mcp\jars\server.jar`. Rename the server jar to `minecraft_server.jar`. 3. **Configure MCP ( `mcp.cfg` ):** * Open the `mcp.cfg` file in your MCP directory with a text editor. * **Important:** Verify that the `MinecraftVersion` setting in `mcp.cfg` matches the Minecraft version of your server jar. If it doesn't, change it. For example: ``` MinecraftVersion = 1.19.2 ``` * You might need to adjust other settings in `mcp.cfg` depending on your specific needs and the MCP version. Refer to the MCP documentation for details. 4. **Decompile Minecraft:** * Open a command prompt or terminal. * Navigate to your MCP directory using the `cd` command. For example: ```bash cd C:\mcp (Windows) cd /home/user/mcp (Linux/macOS) ``` * Run the `decompile.sh` (Linux/macOS) or `decompile.bat` (Windows) script. This will decompile the Minecraft server code. ```bash ./decompile.sh (Linux/macOS) decompile.bat (Windows) ``` * **This step takes a significant amount of time (minutes to hours), depending on your computer and the Minecraft version.** Be patient. Watch the output in the command prompt/terminal for any errors. If you encounter errors, carefully read the error messages and consult the MCP documentation or online forums for solutions. Common errors are related to incorrect Java versions or missing dependencies. 5. **Understanding the Decompiled Code:** * After successful decompilation, the decompiled source code will be located in the `src/minecraft_server` directory within your MCP directory. * The code is organized into packages and classes, mirroring the structure of the original Minecraft code. * **Important:** The decompiled code is often obfuscated (variable and method names are meaningless). MCP uses mappings (stored in `.csv` files) to deobfuscate the code, making it more readable. 6. **Modifying the Code (Example):** * Open the `src/minecraft_server` directory in your IDE (Integrated Development Environment) like Eclipse or IntelliJ IDEA. You'll need to configure your IDE to use the MCP project structure. This usually involves creating a new project and importing the `src/minecraft_server` directory as the source folder. * **Example:** Let's say you want to change the default message that appears when a player joins the server. You would need to find the relevant class and method that handles player joining and modify the string that is sent to the player. This requires understanding the Minecraft server code. * **Important:** Make small, incremental changes and test frequently. It's easy to introduce errors that can prevent the server from starting or cause unexpected behavior. 7. **Recompiling and Reobfuscating:** * After making your changes, you need to recompile the code and reobfuscate it (convert it back to the original obfuscated form). * In your command prompt/terminal (still in the MCP directory), run the `recompile.sh` (Linux/macOS) or `recompile.bat` (Windows) script. ```bash ./recompile.sh (Linux/macOS) recompile.bat (Windows) ``` * If the recompilation is successful, run the `reobfuscate.sh` (Linux/macOS) or `reobfuscate.bat` (Windows) script. ```bash ./reobfuscate.sh (Linux/macOS) reobfuscate.bat (Windows) ``` * These steps will create a new, modified server `.jar` file in the `reobf/minecraft_server.jar` directory. 8. **Testing Your Modified Server:** * Copy the `reobf/minecraft_server.jar` file to a new directory where you want to run your modified server. * Create an `eula.txt` file in that directory and set `eula=true`. * Run the modified server jar: ```bash java -jar minecraft_server.jar ``` * Connect to your server using the Minecraft client and test your changes. **Example `mcp.cfg` (Illustrative):** ``` # Configuration file for MCP # Minecraft Version MinecraftVersion = 1.19.2 # Java location # If not set, MCP will try to find it in your PATH #JavaDir = C:\Program Files\Java\jdk1.8.0_201 # Options for the decompile process Decompile = true Recompile = true Reobfuscate = true # Location of the Minecraft server jar ServerJar = jars/minecraft_server.jar # Location of the Minecraft client jar (optional) ClientJar = jars/minecraft_client.jar # Location of the mappings #Mappings = conf/server.srg # Output directories OutputDir = bin ReobfDir = reobf SourceDir = src # Logging level (DEBUG, INFO, WARN, ERROR) LogLevel = INFO ``` **Chinese Translation of Key Terms:** * **MCP (Minecraft Coder Pack):** Minecraft 代码包 (Minecraft Dàimǎ Bāo) * **Decompile:** 反编译 (Fǎnbiānyì) * **Recompile:** 重新编译 (Chóngxīn Biānyì) * **Reobfuscate:** 重新混淆 (Chóngxīn Hùnxiáo) * **Server Jar:** 服务器 Jar 文件 (Fúwùqì Jar Wénjiàn) * **Mappings:** 映射 (Yìngshè) * **Source Code:** 源代码 (Yuán Dàimǎ) * **Mod:** 模组 (Mózǔ) **Important Notes and Troubleshooting:** * **Java Version:** MCP often requires a specific Java version (usually Java 8 or Java 17, depending on the Minecraft version). Make sure you have the correct Java Development Kit (JDK) installed and that your `JAVA_HOME` environment variable is set correctly. The `mcp.cfg` file may have a `JavaDir` setting you need to adjust. * **Errors During Decompilation/Recompilation:** Carefully read the error messages. Common causes include: * Incorrect Java version * Missing dependencies * Corrupted server jar file * Incorrect MCP version for the Minecraft version * **IDE Setup:** Configuring your IDE (Eclipse, IntelliJ IDEA) correctly is crucial for mod development. Refer to the MCP documentation and tutorials for instructions on setting up your IDE. * **MCP Documentation:** The official MCP documentation (if available for your version) is your best resource for detailed information and troubleshooting. * **Community Forums:** The MinecraftForge forums and other modding communities are excellent places to ask questions and get help from experienced modders. This is a simplified example. Mod development with MCP is a complex and challenging process. Be prepared to spend time learning and troubleshooting. Good luck!

dsomel21

研究与数据
访问服务器

README

Weather MCP 服务器

这是一个学习项目,探索模型上下文协议 (MCP) 的概念。该项目实现了一个简单的天气服务,该服务使用美国国家气象局 (NWS) API 提供天气警报和预报。

关于本项目

本项目旨在学习和实现 MCP(模型上下文协议),遵循以下文档: https://modelcontextprotocol.io/quickstart/server#core-mcp-concepts

MCP 是一种协议,允许 AI 助手访问外部工具和数据源。本项目演示了如何创建一个可以与 Claude 或其他 MCP 兼容的助手一起使用的 MCP 服务器。

功能

  • get_alerts: 检索美国州当前的有效天气警报
  • get_forecast: 获取特定位置的天气预报,使用经度和纬度

要求

  • Python 3.9+
  • httpx
  • mcp

设置说明

  1. 克隆此存储库

  2. 安装依赖项:

    pip install mcp httpx
    

    或者使用 uv:

    uv pip install mcp httpx
    
  3. 在您的 AI 助手中配置 MCP 服务器:

在 Claude Desktop 中

将以下内容添加到 Claude Desktop 配置中:

{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather",
        "run",
        "weather.py"
      ]
    }
  }
}

在 Cursor 中

转到 Cursor 设置 -> MCP 服务器 -> 添加 MCP 服务器

  • 名称:Weather(或您喜欢的任何名称)
  • 类型:Command
  • 命令:uv run /ABSOLUTE/PATH/TO/PARENT/FOLDER/weather/weather.py

使用示例

设置好 MCP 服务器后,您可以要求 AI 助手:

  • "What are the current weather alerts in CA?" (加州目前的天气警报是什么?)
  • "Get me the weather forecast for latitude 37.7749 and longitude -122.4194" (获取纬度 37.7749 和经度 -122.4194 的天气预报)

许可证

本项目仅用于教育目的。

致谢

  • 美国国家气象局 (NWS) API 提供天气数据
  • MCP 文档提供有关实现服务器的指导

推荐服务器

Crypto Price & Market Analysis MCP Server

Crypto Price & Market Analysis MCP Server

一个模型上下文协议 (MCP) 服务器,它使用 CoinCap API 提供全面的加密货币分析。该服务器通过一个易于使用的界面提供实时价格数据、市场分析和历史趋势。 (Alternative, slightly more formal and technical translation): 一个模型上下文协议 (MCP) 服务器,利用 CoinCap API 提供全面的加密货币分析服务。该服务器通过用户友好的界面,提供实时价格数据、市场分析以及历史趋势数据。

精选
TypeScript
MCP PubMed Search

MCP PubMed Search

用于搜索 PubMed 的服务器(PubMed 是一个免费的在线数据库,用户可以在其中搜索生物医学和生命科学文献)。 我是在 MCP 发布当天创建的,但当时正在度假。 我看到有人在您的数据库中发布了类似的服务器,但还是决定发布我的服务器。

精选
Python
mixpanel

mixpanel

连接到您的 Mixpanel 数据。 从 Mixpanel 分析查询事件、留存和漏斗数据。

精选
TypeScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

这个服务器通过将复杂问题分解为顺序步骤来促进结构化的问题解决,支持修订,并通过完整的 MCP 集成来实现多条解决方案路径。

精选
Python
Nefino MCP Server

Nefino MCP Server

为大型语言模型提供访问德国可再生能源项目新闻和信息的能力,允许按地点、主题(太阳能、风能、氢能)和日期范围进行筛选。

官方
Python
Vectorize

Vectorize

将 MCP 服务器向量化以实现高级检索、私有深度研究、Anything-to-Markdown 文件提取和文本分块。

官方
JavaScript
Mathematica Documentation MCP server

Mathematica Documentation MCP server

一个服务器,通过 FastMCP 提供对 Mathematica 文档的访问,使用户能够从 Wolfram Mathematica 检索函数文档和列出软件包符号。

本地
Python
kb-mcp-server

kb-mcp-server

一个 MCP 服务器,旨在实现便携性、本地化、简易性和便利性,以支持对 txtai “all in one” 嵌入数据库进行基于语义/图的检索。任何 tar.gz 格式的 txtai 嵌入数据库都可以被加载。

本地
Python
Research MCP Server

Research MCP Server

这个服务器用作 MCP 服务器,与 Notion 交互以检索和创建调查数据,并与 Claude Desktop Client 集成以进行和审查调查。

本地
Python
Cryo MCP Server

Cryo MCP Server

一个API服务器,实现了模型补全协议(MCP),用于Cryo区块链数据提取,允许用户通过任何兼容MCP的客户端查询以太坊区块链数据。

本地
Python