济南AI MCP服务器
模型上下文协议 (MCP) 服务器,可与 Jina AI 的神经搜索功能无缝集成。该服务器通过简单的界面实现语义搜索、图像搜索和跨模态搜索功能。
🚀 功能
- 语义搜索:使用自然语言查询查找语义相似的文档
- 图像搜索:使用图像 URL 搜索视觉上相似的图像
- 跨模式搜索:执行文本到图像或图像到文本的搜索
📋 先决条件
- Node.js 16 或更高版本
- Jina AI 帐户和 API 密钥(在此获取)
- MCP 兼容环境(例如 Cline)
🛠️ 安装
- 克隆存储库:
git clone <repository-url>
cd jina-ai-mcp
- 安装依赖项:
- 使用您的 Jina AI API 密钥创建一个
.env
文件:
JINA_API_KEY=your_api_key_here
- 构建服务器:
⚙️ 配置
将以下配置添加到您的 MCP 设置文件:
{
"mcpServers": {
"jina-ai": {
"command": "node",
"args": [
"/path/to/jina-ai-mcp/build/index.js"
],
"env": {
"JINA_API_KEY": "your_api_key_here"
}
}
}
}
🔍 可用工具
1.语义搜索
对文本文档执行语义/神经搜索。
use_mcp_tool({
server_name: "jina-ai",
tool_name: "semantic_search",
arguments: {
query: "search query text",
collection: "your-collection-name",
limit: 10 // optional, defaults to 10
}
})
2. 图像搜索
使用图像 URL 搜索相似图像。
use_mcp_tool({
server_name: "jina-ai",
tool_name: "image_search",
arguments: {
imageUrl: "https://example.com/image.jpg",
collection: "your-collection-name",
limit: 10 // optional, defaults to 10
}
})
3.跨模态搜索
执行文本到图像或图像到文本的搜索。
use_mcp_tool({
server_name: "jina-ai",
tool_name: "cross_modal_search",
arguments: {
query: "a beautiful sunset", // or image URL for image2text
mode: "text2image", // or "image2text"
collection: "your-collection-name",
limit: 10 // optional, defaults to 10
}
})
📝 响应格式
所有搜索工具均以以下格式返回结果:
{
content: [
{
type: "text",
text: JSON.stringify({
results: [
{
id: string,
score: number,
data: Record<string, any>
}
]
}, null, 2)
}
]
}
🔐 错误处理
服务器处理各种错误情况:
- API 密钥无效
- 参数缺失或无效
- API 速率限制
- 网络错误
- 无效的集合名称
所有错误均被正确格式化并返回适当的错误代码和消息。
🤝 贡献
欢迎贡献代码!欢迎提交 Pull 请求。
📄 许可证
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
🙏 致谢