Mcp Server

@ai-mentora/mcp-server

MCP server for AI Mentora, compatible with ModelContextProtocol. Provides es-fulltext-retrieve tool for Canadian case law search.

0 downloads
v1.0.29

Capabilities

tools

Installation

Quick Install

Install using the MCPSearch CLI (recommended)

mcp install @ai-mentora/mcp-server

Don't have the CLI? Install it first

Run with npx

Run directly without installing

npx -y @ai-mentora/mcp-server

Manual Configuration

Add to your MCP client configuration file

CClaude Code / Claude Desktop

Add to ~/.claude/claude_desktop_config.json

{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@ai-mentora/mcp-server"
      ]
    }
  }
}

CuCursor

Add to ~/.cursor/mcp.json

{
  "mcp": {
    "servers": {
      "mcp-server": {
        "command": "npx",
        "args": [
          "-y",
          "@ai-mentora/mcp-server"
        ]
      }
    }
  }
}

VSVS Code / Continue.dev

Add to .vscode/mcp.json or Continue settings

{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@ai-mentora/mcp-server"
      ]
    }
  }
}

About

# MCP Elasticsearch Server 本服务基于 [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) 实现,作为 AI Mentora 平台的 Elasticsearch 法律案例全文检索 MCP 工具服务。 ## 功能定位 - 暴露标准 MCP 工具 `es-fulltext-retrieve`,支持多条件全文检索、字段权重、关键短语、结果高亮等。 - 通过 Bearer Token 认证,安全转发请求到 search-service。 - 支持多用户、会话隔离,兼容 Context7/Claude/VSCode 等 MCP 客户端。 ## 目录结构 - `src/elastic-search-tool.ts`:MCP 工具定义与 search-service API 封装 - `src/index.ts`:MCP 服务主入口,注册工具并暴露 /mcp 路由 ## 主要依赖 - `@modelcontextprotocol/sdk`:MCP TypeScript 官方 SDK - `zod`:类型安全校验 - `axios`:后端 API 调用 - `express`:HTTP 服务 ## 环境变量 - `SEARCH_SERVICE_URL`:search-service 检索 API 地址(默认 `http://search-service:8005/api/v1/rag/keyword-caselaw-retrieve`) - `PORT`:服务监听端口(默认 3001) ## 启动方式 ```bash pnpm install pnpm dev # 或 pnpm build && pnpm start ``` ## API 路径 - `POST /mcp`:MCP Streamable HTTP 入口,需携带 `Authorization: Bearer <token>` ## MCP 工具注册 - 工具名:`es-fulltext-retrieve` - 输入/输出严格类型化,参数结构与 search-service 保持一致 ## 认证机制 - 所有请求需携带 Bearer Token,服务端通过 digest-service 校验 - 示例代码中 `verifyTokenWithBackend` 需替换为实际 digest-service 校验逻辑 ## 参考文档 - [220-mcp-nodejs-best-practices.mdc](../../.cursor/rules/220-mcp-nodejs-best-practices.mdc) - [search-service es_fulltext_retrieve 实现](../search-service/src/api/routes.py) - [MCP TypeScript SDK 官方文档](https://github.com/modelcontextprotocol/typescript-sdk)

Reviews

No reviews yet. Be the first to review this package!

Compatible With

Claude CodeCursorWindsurfContinue.dev

Details

Version
1.0.29
License
MIT
Category
search
MCP Version
1.0
Published
4/29/2025
Updated
5/22/2025

Links