q

quanticsoul4772

@quanticsoul4772/analytical-mcp
0 Stars 312 次浏览 quanticsoul4772 更新于 2026-08-23

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "analytical": {
      "args": [
        "run",
        "--rm",
        "-i",
        "--env-file",
        ".env",
        "-v",
        "$(pwd)/cache:/app/cache",
        "analytical-mcp"
      ],
      "command": "docker"
    }
  }
}

服务介绍

分析型MCP服务器

一种专门的模型上下文协议(MCP)服务器,提供先进的分析、研究和自然语言处理能力。

主要特性

分析工具

  • 数据集分析
  • 决策分析
  • 相关性分析
  • 回归分析
  • 时间序列分析
  • 假设检验

高级NLP功能

  • 增强的事实提取
  • 命名实体识别
  • 代词消解
  • 关系抽取
  • 情感分析
  • 文本相似度
  • 词性标注
  • 词形还原
  • 拼写检查

安装

先决条件

  • Node.js (v20+)
  • npm
  • Exa API密钥(用于研究和高级NLP功能)

设置

  1. 克隆仓库

  2. 安装依赖项:
    bash
    npm install

  3. 设置环境变量:
    bash

    复制示例环境文件

    cp .env.example .env

    编辑.env并添加您的API密钥

    您需要一个Exa API密钥以启用研究功能

  4. 构建项目:
    bash
    npm run build

使用

运行工具

每个工具都可以通过特定参数调用。例如:
typescript
// 分析数据集
const datasetAnalysis = await analyzeDataset([1, 2, 3, 4, 5], 'summary');

// 验证研究声明
const researchVerification = await researchVerification.verifyResearch({
query: 'Climate change impacts',
sources: 3
});

// 从文本中提取实体
const entities = await advancedNER.recognizeEntities(
"Apple Inc. is planning to open a new headquarters in Austin, Texas."
);

高级NLP演示

您可以运行包含的NLP演示来查看高级功能的实际效果:
bash
npm run build
node examples/advanced_nlp_demo.js

开发

可用脚本

  • npm run build: 编译TypeScript
  • npm test: 运行所有测试
  • npm run test:integration: 仅运行集成测试
  • npm run test:exa: 运行Exa Research API测试
  • npm run test:research: 运行研究验证测试
  • npm run test:server: 运行服务器工具注册测试
  • npm run lint: 检查代码质量
  • npm run format: 格式化代码
  • npm run nlp:demo: 运行高级NLP演示

测试脚本

我们提供了运行特定测试套件的专用脚本:

Unix/Linux/Mac

bash

运行所有集成测试并生成摘要报告

./tools/run-all-integration-tests.sh

运行特定测试套件

./tools/run-exa-tests.sh
./tools/run-research-tests.sh
./tools/run-server-tests.sh
./tools/run-api-key-tests.sh
./tools/run-data-pipeline-tests.sh
./tools/run-market-analysis-tests.sh

Windows

batch

运行所有集成测试并生成摘要报告

. ools un-all-integration-tests.bat

关键技术

  • TypeScript
  • 模型上下文协议SDK
  • 用于研究和NLP的Exa API
  • 自然语言处理库
  • Jest用于测试

高级NLP实现

分析型MCP服务器使用以下技术实现高级NLP功能:

  • Exa研究API用于上下文感知实体识别
  • 自然语言工具包用于基本NLP操作
  • 自定义基于规则的回退机制以支持离线功能
  • 增强的事实提取并带有置信度评分
  • 实体间的关系抽取

有关详细信息,请参阅高级NLP文档

所需的API密钥

此项目需要以下API密钥:

  • EXA_API_KEY: 用于研究集成和高级NLP

.env.example文件包含所有可用的配置选项:

  • API密钥
  • 功能标志
  • 缓存设置
  • NLP配置
  • 服务器配置

将此文件复制到项目根目录下的.env文件,并更新为实际的API密钥以开始使用。

贡献

  1. Fork仓库
  2. 创建功能分支
  3. 提交更改
  4. 推送到分支
  5. 创建Pull Request

许可证

MIT许可证

相关 MCP 服务