Cover image
Try Now
2025-04-09

大家好!我是功能丰富的 MCP 服务,旨在打破设备与服务的隔阂,为用户带来便捷体验。 天气工具和气象平台联动,快速为用户推送全球实时天气,助力大家规划出行。控制浏览器工具模拟人工操作,自动搜索、浏览网页,大幅节省时间。摄像头工具调用本地摄像头拍照、录像,实现人脸识别,保障家庭安防。 为实现工具协同,我搭建了稳定框架,开发者可以基于现有服务进行拓展

3 years

Works with Finder

1

Github Watches

1

Github Forks

10

Github Stars

MCP Server for Local

一个基于 MCP (Multi-Component Platform) 的本地代理服务器和客户端实现,提供多种 AI 工具调用能力。

功能特点

核心功能

  • 天气查询:实时获取全球任意位置的天气信息,支持温度、湿度、风速等详细数据
  • 谷歌搜索:智能检索互联网信息,支持多语言和高级搜索语法
  • 摄像头控制:支持拍照、视频流和微表情分析,可用于情绪识别
  • 图片生成:集成 ComfyUI,支持文本到图像的 AI 生成
  • 智能对话:基于 DashScope 的 AI 对话能力,支持上下文理解和多轮对话

技术特性

  • 跨平台支持(Windows 和 Linux)
  • 模块化设计,易于扩展新功能
  • 完整的日志系统,便于调试和监控
  • 支持自定义工具和 API 集成
  • 高性能并发处理能力

环境配置

系统要求

  • Python 3.8+
  • Node.js (可选,用于运行 JavaScript 服务器)
  • Chrome 浏览器(用于谷歌搜索功能)
  • 摄像头(用于拍照功能)
  • 至少 4GB 内存
  • 支持 CUDA 的显卡(可选,用于加速 AI 计算)

安装步骤

  1. 克隆仓库:
git clone https://github.com/yourusername/mcp-server-for-local.git
cd mcp-server-for-local
  1. 创建并激活虚拟环境:
# Windows
python -m venv .venv
.venv\Scripts\activate

# Linux
python3 -m venv .venv
source .venv/bin/activate
  1. 安装依赖:
# 使用 uv 安装依赖
uv pip install -r requirements.txt

# 如果遇到网络问题,可以使用国内镜像
uv pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
  1. 配置环境变量:
# 复制环境变量模板
cp .env.example .env

# 编辑 .env 文件,设置你的配置

环境变量配置

编辑 .env 文件,设置以下配置:

  • DASHSCOPE_API_KEY: DashScope API 密钥(必填)
  • MODEL: 使用的模型名称(默认:qwen-max)
  • CONFIG_FILE: 服务器配置文件路径
  • GAODE_API_KEY: 高德地图 API 密钥(用于天气查询)
  • CHROME_PATH: Chrome 浏览器路径
  • CHROMEDRIVER_PATH: ChromeDriver 路径
  • BASE_URL: ComfyUI 服务器地址
  • SERVERS_DIR: 服务器脚本目录
  • LOG_LEVEL: 日志级别(可选:DEBUG, INFO, WARNING, ERROR)

使用方法

基本使用

  1. 进入项目目录:
cd src/mcp
  1. 运行客户端:
uv run .\client\mcp_client.py .\proxy\proxy_server.py
  1. 在客户端中输入命令,例如:
  • "北京的天气怎么样?"
  • "在谷歌上搜索 Python 教程"
  • "拍照"
  • "生成一张猫的图片"

高级功能

  1. 自定义工具

    • src/mcp/tools 目录下添加新的工具类
    • 实现必要的接口方法
    • 在配置文件中注册新工具
  2. API 扩展

    • 支持添加新的 API 服务
    • 可配置 API 密钥和端点
    • 支持自定义请求和响应处理
  3. 日志管理

    • 支持多级别日志记录
    • 可配置日志输出位置
    • 支持日志轮转和归档

常见问题

安装问题

  1. 依赖安装失败:
# 尝试清理缓存后重新安装
uv pip cache purge
uv pip install -r requirements.txt
  1. 虚拟环境问题:
# 如果激活失败,尝试重新创建虚拟环境
rm -rf .venv
python -m venv .venv

运行问题

  1. 权限问题:
# Linux
chmod +x src/mcp/proxy/proxy_server.py
chmod +x src/mcp/client/mcp_client.py
  1. Chrome 相关问题:
  • 确保 Chrome 和 ChromeDriver 版本匹配
  • 检查 Chrome 路径是否正确
  • 确保有足够的权限运行 Chrome
  • 如果遇到驱动问题,可以手动下载对应版本的 ChromeDriver
  1. API 密钥问题:
  • 检查 .env 文件中的 API 密钥是否正确
  • 确保 API 密钥有足够的配额
  • 检查网络连接是否正常

开发指南

项目结构

src/mcp/
├── client/          # 客户端代码
├── proxy/           # 代理服务器代码
├── tools/           # 工具实现
├── utils/           # 工具函数
└── config/          # 配置文件

添加新功能

  1. tools 目录下创建新的工具类
  2. 实现必要的接口方法
  3. 在配置文件中注册新工具
  4. 编写测试用例
  5. 更新文档

贡献指南

欢迎提交 Issue 和 Pull Request!在提交之前,请确保:

  1. 代码符合项目规范
  2. 添加了必要的测试
  3. 更新了相关文档
  4. 通过了所有测试

许可证

MIT License

相关推荐

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • https://reddgr.com
  • Delivers concise Python code and interprets non-English comments

  • 林乔安妮
  • A fashion stylist GPT offering outfit suggestions for various scenarios.

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • GeyserMC
  • A library for communication with a Minecraft client/server.

  • 1Panel-dev
  • 💬 MaxKB is an open-source AI assistant for enterprise. It seamlessly integrates RAG pipelines, supports robust workflows, and provides MCP tool-use capabilities.

  • Mintplex-Labs
  • The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, No-code agent builder, MCP compatibility, and more.

  • GLips
  • MCP server to provide Figma layout information to AI coding agents like Cursor

  • open-webui
  • User-friendly AI Interface (Supports Ollama, OpenAI API, ...)

    Reviews

    1 (1)
    Avatar
    user_psXqozuL
    2025-04-16

    As a devoted MCP user, I highly recommend the MCP-Server-For-Local developed by Dreamboat-Rachel. This server is incredibly efficient and user-friendly, enabling seamless local development. The comprehensive documentation on GitHub (https://github.com/Dreamboat-Rachel/MCP-Server-For-Local) makes setup a breeze. It's a fantastic tool for any developer looking to optimize their workflow locally.