MCP服务器集合

基于FastMCP构建的MCP服务器集合,提供天气警报和OCR文本提取功能。

  • by CodeProcessor
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 CodeProcessor/mcp-server

使用说明

MCP服务器

一组 模型上下文协议(MCP) 服务器构建于 FastMCP.

服务器

服务器 端口 描述
天气 8008 通过美国国家气象局API发布的美国天气警报和预报
镶嵌ocr 8010 使用Tesseract从图像中提取OCR文本

天气

目录: weather/ 要求: Python 3.12+

使用 美国国家气象局API。覆盖范围仅限于美国的地点和地区。

工具

get_alerts(state: str)

获取美国某个州的活跃天气警报。

  • state:两个字母的州代码(例如。 CA, NY, TX)

get_forecast(latitude: float, longitude: float)

获取特定位置的天气预报。

  • latitude:十进制纬度
  • longitude:经度十进制度数

设置

cd weather
uv sync

跑步

HTTP服务器(推荐):

just run-weather
# or
uv run fastmcp run weather.py:mcp --transport http --port 8008 --host 0.0.0.0

stdio(用于VS代码/Claude桌面):

{
  "servers": {
    "weather": {
      "type": "stdio",
      "command": "uv",
      "args": ["--directory", "/path/to/mcp-server/weather", "run", "weather.py"]
    }
  }
}

Tesseract OCR

目录: tesseract-ocr/ 要求: Python 3.13+, 立方体 安装在系统上

使用Tesseract OCR从图像中提取文本。接受base64编码字符串或直接URL形式的图像。

系统相关性

运行此服务器之前,必须单独安装Tesseract:

# Ubuntu / Debian
sudo apt install tesseract-ocr

# macOS
brew install tesseract

工具

ocr_image_from_base64(base64_image: str, language: str = "eng")

对base64编码的图像运行OCR。

  • base64_image:Base64编码图像数据
  • language:细分语言代码(默认值: eng)

ocr_image_from_url(image_url: str, language: str = "eng")

对从URL获取的图像运行OCR。

  • image_url:指向图像的HTTP/HTTPS URL
  • language:细分语言代码(默认值: eng)

设置

cd tesseract-ocr
uv sync

跑步

HTTP服务器(推荐):

just run-ocr
# or
uv run fastmcp run ocr.py:mcp --transport http --port 8010 --host 0.0.0.0

先决条件

  • 紫外线 --Python包管理器
  • 仅仅 --命令运行器(可选,为方便命令)

快速开始

# List available commands
just

# Run both servers (in separate terminals)
just run-weather
just run-ocr

许可证

看 许可证.