Mistral MCP 服务器示例
这是一个基于 TypeScript 的 MCP 服务器,提供了两个与 Mistral 通信的工具。这是一个关于如何创建可与模型上下文协议 (MCP)配合使用的服务器的基本示例。
博客文章
该存储库是 Speakeasy 博客文章的一部分:为 Mistral 构建 MCP 服务器。
要求
- Node.js(在 v20.17.10 上测试)
- 支持工具的MCP 客户端。我们推荐使用Claude 桌面应用程序或Cline VSCode 扩展。
Mistral API 密钥
要与 Mistral AI 平台交互,您需要一个 API 密钥。您可以在mistral.ai上注册以获取密钥。
将您的 API 密钥设置为环境变量。创建.env.example
的副本并将其重命名为.env
。
现在使用您的 Mistral API 密钥更新.env
文件:
工具
该服务器提供了两个工具。
要使用文本输入与 Mistral 聊天,请使用mistral_chat_text
工具:
- 采用模型和文本输入数组
- 返回来自 Mistral 的文本响应。
要使用文本和图像输入与 Mistral 聊天,请使用mistral_chat_image
工具:
- 采用模型以及文本和图像输入数组
- 仅接受托管在公共 URL 上的图片
- 返回 Mistral 的文本响应
发展
安装依赖项:
构建服��器:
对于使用自动重建的开发:
安装
要将此服务器与 Claude 桌面应用程序一起使用,请将以下服务器配置添加到您的 Claude 配置文件中:
- 在 MacOS 上:
~/Library/Application Support/Claude/claude_desktop_config.json
- 在 Windows 上:
%APPDATA%/Claude/claude_desktop_config.json
调试
由于 MCP 服务器通过标准输入/输出流 (stdio) 进行通信,因此调试起来可能颇具挑战性。我们建议使用MCP Inspector ,它以包脚本的形式提供:
MCP Inspector 将提供一个 URL,用于访问浏览器中的调试工具。
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
基于 TypeScript 的 MCP 服务器,提供两种与 Mistral AI 模型聊天的工具,支持纯文本对话和图像+文本输入。
Related Resources
Related MCP Servers
- -securityFlicense-qualityAn MCP server that enables AI assistants like Claude to interact with Anki flashcard decks, allowing users to create, manage, and update flashcards through natural language conversations.Last updated -1TypeScript
YaVendió Toolsofficial
-security-license-qualityAn MCP-based messaging system that allows AI systems to interact with various messaging platforms through standardized tools for sending text, images, documents, buttons, and alerts.Last updated -Python- -securityAlicense-qualityA Model Context Protocol (MCP) server that enables real-time, interactive AI chat with Selector AI through a streaming-capable server and Docker-based client communicating via stdin/stdout.Last updated -1PythonApache 2.0
- -securityAlicense-qualityAn MCP-based service that enables AI models to seamlessly interact with Feishu (Lark) platform, supporting document reading and chatbot messaging capabilities.Last updated -3963TypeScriptMIT License