npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ai-mentora/mcp-server

v1.0.29

Published

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

Downloads

106

Readme

MCP Elasticsearch Server

本服务基于 @modelcontextprotocol/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)

启动方式

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 校验逻辑

参考文档