Sponsored by Deepsite.site

Dreamboat Rachel_MCP Server For Local

Created By
MCP-Mirror8 months ago
Mirror of
Content

MCP(Model Context Protocol)简介

官方地址https://github.com/modelcontextprotocol/python-sdk

MCP(Model Context Protocol)是由 Anthropic 开发的一种开源协议,旨在为 AI 模型提供与外部数据源和工具交互的标准化方式。它就像 AI 应用的“通用接口”,通过客户端-服务器架构,让语言模型(如 Claude)能够安全、高效地访问实时数据、执行操作并扩展功能。MCP 的核心优势在于其统一性与模块化,开发者无需为每个工具或数据源编写定制集成,只需实现 MCP 协议即可让 AI 无缝连接。

我的 MCP 实现:天气查询、谷歌自动检索与摄像头控制

我基于 MCP 开发了一个多功能配置,集成了以下特性,开发者可根据需求自由调整:

  • 天气查询:通过 MCP 服务器连接外部天气 API(如 OpenWeatherMap),支持实时获取指定位置的天气预报和警报信息。用户只需输入指定地点,即可获得格式化的天气数据。
  • 谷歌自动检索:利用 MCP 工具,AI 可以动态调用谷歌搜索功能,自动检索相关信息并返回结果,适用于需要实时外部知识的场景。
  • 摄像头控制:集成了摄像头操作功能,通过 MCP 定义的工具,开发者可以控制摄像头执行拍摄、流媒体传输等任务,并支持自定义参数配置。

开发者自由配置

此实现的亮点在于其高度可配置性。开发者可以通过修改 MCP 服务器的工具定义(Tools,即 server 服务端)、客户端(client)、服务端代理以及提示模板(Prompts),轻松扩展功能。例如:

  • 调整天气查询的 API 端点或返回格式。
  • 更改谷歌检索的搜索参数或添加其他搜索引擎。
  • 为摄像头控制添加新命令,如调整分辨率或切换设备。

使用场景

这个配置适用于多种场景,例如:

  • 智能助手:结合天气和检索功能,为用户提供实时信息支持。
  • 自动化工作流:通过摄像头控制与数据检索,构建监控或内容生成系统。
  • 开发测试:开发者可基于此模板快速集成新工具,探索 MCP 的潜力。

MCP 的标准化设计让 AI 不再局限于静态知识库,而是能主动与世界交互。我的代码提供了一个开箱即用的示例,欢迎开发者在此基础上自由发挥!


MCP 环境配置指南

本指南将帮助你快速搭建 MCP(Model Context Protocol)客户端的开发环境,包括创建项目目录、设置虚拟环境以及安装 MCP SDK。以下是具体步骤:

1. 创建项目目录

首先,创建一个新的项目目录并进入其中:

uv init mcp-client
cd MCP-Server-For-Local

2. 创建 MCP 客户端虚拟环境

# 创建虚拟环境
uv venv
.venv\Scripts\activate
source .venv/bin/activate

3. 安装 MCP SDK

uv add mcp
uv pip install dashscope

4. main.py运行代码(可选)

from mcp import MCPClient
client = MCPClient()
print("MCP Client initialized!")

运行代码:

python main.py

注意事项

  • 依赖工具:本教程假设你已安装 uv。如果没有,请先运行以下命令安装:
    pip install uv
    Windows 用户使用:.venv\Scripts\activate
    Linux/MacOS 用户使用:source .venv/bin/activate
    
    安装完成后,可根据项目需求配置天气查询、谷歌检索或摄像头控制等功能(详见项目文档)。 通过以上步骤,你已成功搭建 MCP 客户端的开发环境,可以开始开发和测试了!
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
WindsurfThe new purpose-built IDE to harness magic
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Playwright McpPlaywright MCP server
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
DeepChatYour AI Partner on Desktop
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Serper MCP ServerA Serper MCP Server
CursorThe AI Code Editor
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Amap Maps高德地图官方 MCP Server
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.