OpenRouter MCP 多模式服务器
一个 MCP(模型上下文协议)服务器,通过 OpenRouter.ai 丰富的模型生态系统提供聊天和图像分析功能。该服务器将文本聊天功能与强大的图像分析功能相结合。
特征
文字聊天:
直接访问所有 OpenRouter.ai 聊天模型
支持简单文本和多模式对话
可配置温度和其他参数
图像分析:
使用自定义问题分析单个图像
同时处理多幅图像
自动调整图像大小并进行优化
支持各种图像源(本地文件、URL、数据URL)
模型选择:
搜索并过滤可用模型
验证模型 ID
获取详细模型信息
支持默认模型配置
性能优化:
智能模型信息缓存
重试的指数退避
自动速率限制处理
1.5.0 中的新功能
改进的操作系统兼容性:
增强了 Windows、macOS 和 Linux 的路径处理
更好地支持带有驱动器号的 Windows 样式路径
规范化路径处理以实现跨平台的一致行为
MCP 配置支持:
无需环境变量的 Cursor MCP 集成
通过 MCP 参数直接配置
灵活的 API 密钥和模型规范选项
强大的错误处理:
改进了图像处理的回退机制
通过特定诊断更好地报告错误
文件读取多种备份策略
图像处理增强功能:
为所有图像类型提供更可靠的 base64 编码
Sharp 模块不可用时的后备选项
通过自动优化更好地处理大图像
安装
选项 1:通过 npm 安装
选项 2:通过 Docker 运行
快速启动配置
先决条件
从OpenRouter Keys获取您的 OpenRouter API 密钥
选择默认模型(可选)
MCP 配置选项
将以下配置之一添加到您的 MCP 设置文件(例如cline_mcp_settings.json
或claude_desktop_config.json
):
选项 1:使用 npx(Node.js)
选项 2:使用 uv(Python 包管理器)
选项 3:使用 Docker
选项 4:使用 Smithery(推荐)
示例
有关如何使用此 MCP 服务器的详细示例,请查看示例目录。我们提供:
Node.js 应用程序的 JavaScript 示例
具有交互式聊天功能的 Python 示例
用于与各种应用程序集成的代码片段
每个示例都附有清晰的文档和分步说明。
依赖项
该项目使用以下关键依赖项:
@modelcontextprotocol/sdk
: ^1.8.0 - 用于工具实现的最新 MCP SDKopenai
:^4.89.1 - OpenAI 兼容的 OpenRouter API 客户端sharp
: ^0.33.5 - 快速图像处理库axios
:^1.8.4 - 用于 API 请求的 HTTP 客户端node-fetch
: ^3.3.2 - 现代 fetch 实现
需要 Node.js 18 或更高版本。所有依赖项都会定期更新,以确保兼容性和安全性。
可用工具
mcp_openrouter_chat_completion
向 OpenRouter 模型发送文本或多模式消息:
对于带有图像的多模式消息:
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
通过 OpenRouter.ai 多样化的模型生态系统提供聊天和图像分析功能,实现文本对话和使用各种 AI 模型的强大的多模式图像处理。
Related MCP Servers
- AsecurityAlicenseAqualityProvides integration with OpenRouter.ai, allowing access to various AI models through a unified interface.Last updated -5861Apache 2.0
- AsecurityFlicenseAqualityProvides a bridge between AI assistants and VRChat, enabling AI-driven avatar control and interactions in virtual reality environments through the Model Context Protocol.Last updated -1214
- -securityFlicense-qualityImplements a secure message communication protocol for handling exchanges between the banking chatbot and Azure OpenAI, providing message queuing, reliability, and detailed logging.Last updated -1
- -securityFlicense-qualityA unified API server that enables interaction with multiple AI model providers like Anthropic and OpenAI through a consistent interface, supporting chat completions, tool calling, and context handling.Last updated -