
MCP_Connection
3 years
Works with Finder
0
Github Watches
0
Github Forks
0
Github Stars
🧠 Model Context Protocol (MCP) – Clientes y Servidores

Enlace al Discord de CLAI: https://discord.gg/d49rGXxn
Este repositorio contiene ejemplos prácticos y mínimos para entender cómo funciona el Model Context Protocol (MCP), un estándar abierto para conectar modelos de lenguaje (LLMs) con datos y herramientas externas de forma modular y escalable.
📂 Estructura del repositorio
🟦 mcp_client_stdio/cliente-openai.py
y mcp_client_stdio/cliente-anthropic.py
Implementaciones de clientes MCP que se comunican con modelos de lenguaje a través del protocolo MCP:
-
cliente-openai
: Cliente que se conecta a servidores MCP usando la API de OpenAI. -
cliente-anthropic
: Cliente que utiliza Claude de Anthropic como host para el MCP.
Cada cliente mantiene una conexión 1:1 con un servidor MCP, gestionando la comunicación con los recursos y herramientas.
🟨 /servidor-api
y /servidor-local
Ejemplos de servidores MCP que exponen funcionalidades al modelo:
-
servidor-api
: Simula conexión a un servicio externo vía API (ej. información del clima). -
servidor-local
: Expone archivos o datos locales como recursos accesibles desde el modelo.
Cada servidor MCP puede ofrecer:
- 🔧 Tools: Funciones ejecutables por el LLM (function calling).
- 📄 Resources: Datos de solo lectura, como si fueran endpoints GET.
- 💬 Prompts: Plantillas predefinidas para guiar al modelo.
🚀 Cómo probarlo
Paso 1: Configurar el Proyecto del Cliente
uv init mcp-client
cd mcp-client
uv venv
source .venv/bin/activate # En Windows: .venv\\Scripts\\activate
uv add mcp anthropic python-dotenv
Paso 2: Configura Tu Clave API
Crea un archivo .env con tu clave API de Anthropic:
ANTHROPIC_API_KEY=<tu clave aquí>
Paso 3: Implementar el Cliente
El archivo cliente_anthropic.py contendrá la lógica del cliente MCP (ver ejemplo completo en el repositorio).
Incluye:
Inicialización de la sesión y conexión con el servidor MCP
Envío de mensajes a Claude
Llamadas a herramientas dinámicas según la respuesta del modelo
Paso 4: Ejecuta el Cliente
(asegurate de estar en la carpeta mcp_client_stdio)
uv run cliente_anthropic.py ../mcp_server_stdio/weather.py
相关推荐
🔥 1Panel fournit une interface Web intuitive et un serveur MCP pour gérer des sites Web, des fichiers, des conteneurs, des bases de données et des LLM sur un serveur Linux.
🧑🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.
⛓️RULEGO est un cadre de moteur de règle d'orchestration des composants de nouvelle génération légère, intégrée, intégrée et de nouvelle génération pour GO.
Créez facilement des outils et des agents LLM à l'aide de fonctions Plain Bash / JavaScript / Python.
😎简单易用、🧩丰富生态 - 大模型原生即时通信机器人平台 | 适配 QQ / 微信 (企业微信、个人微信) / 飞书 / 钉钉 / Discord / Telegram / Slack 等平台 | 支持 Chatgpt 、 Deepseek 、 Dify 、 Claude 、 GEMINI 、 XAI 、 PPIO 、 OLLAMA 、 LM Studio 、阿里云百炼、火山方舟、 Siliconflow 、 Qwen 、 Moonshot 、 ChatGlm 、 Sillytraven 、 MCP 等 LLM 的机器人 / Agent | Plateforme de bots de messagerie instantanée basés sur LLM, prend en charge Discord, Telegram, WeChat, Lark, Dingtalk, QQ, Slack
Reviews

user_8IJoCfRD
MCP_connection by CLAI-Academy is a fantastic tool for seamless integration and connectivity. The interface is intuitive, and the welcome information is quite helpful for beginners. I've been using it consistently, and it has vastly improved my workflow while ensuring robust performance. Highly recommend this for anyone looking to enhance their digital connection experiences!

user_0U1Zr8vl
As a dedicated user of MCP_connection by CLAI-Academy, I must say this product is exceptional. The seamless connectivity and user-friendly interface have significantly improved my productivity. The comprehensive support and detailed welcome information make the experience even more enjoyable. Highly recommended!

user_dut9o6OZ
I have been using MCP_connection by CLAI-Academy for a few months now, and it has truly transformed my workflow. The welcome message is very inviting, making it easy to get started quickly. I appreciate the seamless connectivity and user-friendly interface. Highly recommend it for anyone looking for a reliable connection tool!