这是一个实现了模型上下文协议(MCP)的服务器,它为AI模型提供了访问Typesense搜索功能的能力。此服务器使LLMs能够发现、搜索并分析存储在Typesense集合中的数据。
typesense:// URI 列出和访问集合typesense_query
typesense_get_document
typesense_collection_stats
analyze_collection
search_suggestions
# 全局安装
npm install -g typesense-mcp-server
# 局部安装
npm install typesense-mcp-server
npx @michaellatman/mcp-get@latest install typesense-mcp-server
安装依赖项:
npm install
构建服务器:
npm run build
开发时自动重建:
npm run watch
要与Claude Desktop一起使用,请添加服务器配置:
在MacOS上:~/Library/Application Support/Claude/claude_desktop_config.json
在Windows上:%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"typesense": {
"command": "node",
"args": [
"~/typesense-mcp-server/dist/index.js",
"--host", "your-typesense-host",
"--port", "8108",
"--protocol", "http",
"--api-key", "your-api-key"
]
},
}
}
由于MCP服务器通过标准I/O进行通信,调试可能会很困难。我们推荐使用MCP Inspector,它作为一个包脚本提供:
npm run inspector
Inspector会提供一个URL,以便您可以在浏览器中访问调试工具。
服务器提供有关Typesense集合的信息:
typesense://collections/<collection>)
服务器提供以下工具用于与Typesense交互:
typesense_list_collections - 列出所有可用的集合及其模式
include_fields 参数以控制详细程度typesense_query - 在集合中搜索文档
typesense_get_document - 根据ID检索特定文档
typesense_collection_stats - 获取特定集合的详细统计信息
服务器提供以下模板:
要使用此服务器与Claude Desktop应用程序一起使用,请在您的 claude_desktop_config.json 的“mcpServers”部分添加以下配置:
{
"mcpServers": {
"typesense": {
"command": "npx",
"args": [
"-y",
"typesense-mcp-server",
"--host", "your-typesense-host",
"--port", "8108",
"--protocol", "http",
"--api-key", "your-api-key"
]
}
}
}
服务器将信息记录到位于以下位置的文件中:
/tmp/typesense-mcp.log
此日志包含有关服务器操作、请求以及发生的任何错误的详细信息。
此MCP服务器根据MIT许可证发布。这意味着您可以自由地使用、修改和分发该软件,但需遵守MIT许可证的条款和条件。如需更多详情,请参阅项目仓库中的LICENSE文件。