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

rule-mcp-server

v1.0.13

Published

Rule MCP Server for AI agents to retrieve and apply coding rules

Downloads

20

Readme

Rule MCP Server

npm version License: MIT

AIエージェント(Cursor、Claude Code、Cline)が共通のルールを取得・適用できるMCP(Model Context Protocol)サーバーです。

📦 npmパッケージ: rule-mcp-server として公開済み

🚀 クイックスタート

パターン1: 既にサーバーが動いている場合

Rule MCP Serverが既に稼働している場合は、以下の手順でAIエージェントを設定するだけです。

1. インストール

# pnpm dlx経由(推奨・インストール不要)
pnpm dlx rule-mcp-server

# またはグローバルインストール
pnpm add -g rule-mcp-server

2. AIエージェント設定

Cursor
# 設定テンプレートをコピー
cp config/pnpm-mcp-config.template.json ~/.cursor/mcp.json
Claude Code
# Claude Code にMCPサーバーを追加(stdio)
claude mcp add rule-mcp-server --env RULE_SERVER_URL=http://localhost:18080 -- pnpm dlx rule-mcp-server

# APIキーを使う場合
claude mcp add rule-mcp-server \
  --env RULE_SERVER_URL=http://localhost:18080 \
  --env MCP_API_KEY=your_api_key \
  -- pnpm dlx rule-mcp-server

3. 利用開始!

AIエージェント(Cursor/Claude Code)を再起動して、コーディングルールを自動取得・適用できるようになります。


パターン2: サーバーを自分で立ち上げる場合

Rule MCP Serverを自分で立ち上げて運用したい場合は、メインリポジトリを参照してください。

設定例

Cursor設定

~/.cursor/mcp.jsonに以下を追加:

{
  "mcpServers": {
    "rule-mcp-server": {
      "command": "pnpm",
      "args": ["dlx", "rule-mcp-server"],
      "env": {
        "RULE_SERVER_URL": "http://localhost:18080",
        "MCP_API_KEY": ""
      },
      "description": "Standard MCP Server for Rule Management",
      "disabled": false,
      "autoApprove": []
    }
  }
}

Claude Code設定

# Claude Code にMCPサーバーを追加(stdio)
claude mcp add rule-mcp-server --env RULE_SERVER_URL=http://localhost:18080 -- pnpm dlx rule-mcp-server

# APIキーを使う場合
claude mcp add rule-mcp-server \
  --env RULE_SERVER_URL=http://localhost:18080 \
  --env MCP_API_KEY=your_api_key \
  -- pnpm dlx rule-mcp-server

# 参考: Anthropic公式ドキュメント
# https://docs.anthropic.com/ja/docs/claude-code/mcp

環境変数

  • RULE_SERVER_URL: Rule MCP ServerのURL(デフォルト: http://localhost:18080)
  • MCP_API_KEY: APIキー(オプション、認証が必要な場合)

補足: MCP_API_KEY は未設定でも動作します(Publicアクセス)。チーム運用や管理API利用時のみ設定してください。

前提条件

MCPクライアント設定は、Rule MCP Serverが稼働していることが前提です。

curl http://localhost:18080/api/v1/health

サーバー未稼働の場合はDockerで起動できます:

docker compose up -d

LANで運用する場合は、RULE_SERVER_URL をLAN内のホストIPに変更してください。

提供ツール

  • getRules: プロジェクトルール取得
  • validateCode: コード検証
  • getProjectInfo: プロジェクト情報取得
  • autoDetectProject: プロジェクト自動検出
  • scanLocalProjects: ローカルプロジェクトスキャン
  • getGlobalRules: グローバルルール取得

ライセンス

MIT License