这是一个实现了“群体智慧”方法的人工智能推理 Model Context Protocol (MCP) 服务器,通过并行咨询多个最先进的语言模型,并综合它们的回答。
# 直接使用 npx 运行(无需安装)
npx mcp-cognition-wheel
# 或者全局安装
npm install -g mcp-cognition-wheel
mcp-cognition-wheel
pnpm install.env.example 到 .env 并添加你的 API 密钥pnpm run build认知轮遵循一个三阶段过程:
并行咨询:同时查询三个不同的 AI 模型:
匿名分析:使用代号(Alpha, Beta, Gamma)来消除合成阶段的偏见
智能合成:随机选择一个模型作为合成器,该模型分析所有响应并生成最终的综合答案
# 直接使用 npx 运行(无需安装)
npx mcp-cognition-wheel
# 或者全局安装
npm install -g m
mcp-cognition-wheel
pnpm install.env.example 到 .env 并添加你的 API 密钥pnpm run build这是一个设计用于与兼容 MCP 的客户端(如 Claude Desktop 或其他 MCP 工具)一起使用的 MCP 服务器。
ANTHROPIC_API_KEY:你的 Anthropic API 密钥GOOGLE_GENERATIVE_AI_API_KEY:你的 Google AI API 密钥OPENAI_API_KEY:你的 OpenAI API 密钥根据 这篇 dev.to 文章,这里是如何与 Cursor 集成的方法:
打开 Cursor 设置:
配置服务器:
cognition-wheelnpx["-y", "mcp-cognition-wheel"]示例配置:
{
"cognition-wheel": {
"command": "npx",
"args": ["-y", "mcp-cognition-wheel"],
"env": {
"ANTHROPIC_API_KEY": "your_anthropic_key",
"GOOGLE_GENERATIVE_AI_API_KEY": "your_google_key",
"OPENAI_API_KEY": "your_openai_key"
}
}
}
构建项目(如果尚未完成):
pnpm run build
配置服务器:
cognition-wheelnode["/绝对路径到你的/cognition-wheel/dist/app.js"]示例配置:
{
"cognition-wheel": {
"command": "node",
"args": [
"/Users/yourname/path/to/cognition-wheel/dist/app.js"
],
"env": {
"ANTHROPIC_API_KEY": "your_anthropic_key",
"GOOGLE_GENERATIVE_AI_API_KEY": "your_google_key",
"OPENAI_API_KEY": "your_openai_key"
}
}
}
测试集成:
cognition_wheel 工具应自动触发服务器提供了一个名为 cognition_wheel 的工具,具有以下参数:
context:问题的背景信息和上下文question:你想要回答的具体问题enable_internet_search:布尔标志,启用网络搜索能力pnpm run dev:开发监视模式pnpm run build:构建 TypeScript 代码pnpm run start:直接用 tsx 运行服务器使用 Docker 构建和运行:
# 构建镜像
docker build -t cognition-wheel .
# 使用环境变量运行
docker run --rm \
-e ANTHROPIC_API_KEY=your_key \
-e GOOGLE_GENERATIVE_AI_API_KEY=your_key \
-e OPENAI_API_KEY=your_key \
cognition-wheel
MIT