CleanSlice について
CleanSlice MCP Serverは、NestJSとNuxtを使う開発者向けに、AIコーディングエージェントがCleanSliceのアーキテクチャ文書を参照できるようにします。カテゴリ別検索に加え、文書全体の取得にも対応します。
主な機能
- 01基本アーキテクチャルールの取得
- 02ドキュメントカテゴリの一覧
- 03条件を指定した検索
- 04ドキュメント全文の取得
活用シーン
- 01CleanSliceの規約に沿った機能実装
- 02コーディング前の設計指針の確認
- 03フレームワークや開発段階別の文書検索
MCP 対応
MCPサーバーとして、リモートHTTPまたはローカル実行で、クライアントにアーキテクチャ文書の検索・取得ツールを提供します。
設定
リモートサーバーはインストール不要です。クライアントを選んで設定をコピーするか、ワンクリックで導入できます。
https://mcp.cleanslice.org/mcpclaude mcp add --transport http cleanslice https://mcp.cleanslice.org/mcp{"mcpServers":{"cleanslice":{"type":"http","url":"https://mcp.cleanslice.org/mcp"}}}Cursor で開く{"servers":{"cleanslice":{"type":"http","url":"https://mcp.cleanslice.org/mcp"}}}VS Code で開く{"mcpServers":{"cleanslice":{"type":"http","url":"https://mcp.cleanslice.org/mcp"}}}{"mcpServers":{"cleanslice":{"serverUrl":"https://mcp.cleanslice.org/mcp"}}}コマンドはターミナルで実行し、JSON は各クライアントの MCP 設定に貼り付けて再起動します。認可が必要なサーバーは初回接続時にログインを求めます。
ツール
4このツールにパラメーターはありません。
詳細
CleanSlice MCP Server
AI コーディングエージェントが CleanSlice のアーキテクチャドキュメントにアクセスできるようにする MCP(Model Context Protocol)サーバーです。Claude、Cursor、Windsurf、または MCP 互換クライアントに接続すると、CleanSlice の規約に沿ったアプリの構築方法を AI が理解できます。
インストール
Claude Code にインストール
このコマンドを実行してください。詳しくはClaude Code MCP ドキュメントをご覧ください。
claude mcp add --scope user --transport http cleanslice https://mcp.cleanslice.org/mcp
現在のプロジェクトにのみインストールするには、
--scope userを削除してください。
ヒント:CLAUDE.md で MCP の使用を徹底する
コードを書く前に Claude Code が必ず CleanSlice MCP を参照するようにするには、プロジェクトの CLAUDE.md に次の内容を追加してください。
## CleanSlice MCP — Required
Before writing or modifying any code you MUST consult the CleanSlice MCP:
1. Call `get-started` to load the core architecture rules.
2. Call `list-categories` to see available documentation areas.
3. Call `search` with at least 2 task-relevant queries covering:
(a) core implementation details for the feature you are building,
(b) edge cases, constraints, or standards that apply.
4. Call `read-doc` to read the full document when search snippets aren't enough.
Do NOT guess conventions — always verify against MCP results first.
これにより、エージェントはタスクの後ではなく、開始時に毎回 CleanSlice のドキュメントを読むようになります。
任意:安全策として Stop フックを追加する
CLAUDE.md の指示があるにもかかわらず、エージェントが MCP を使わない場合に備えて、.claude/settings.json に次の内容を追加してください。
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "agent",
"timeout": 180,
"prompt": "You are a verification subagent. Your job: ensure the main Claude Code agent used the `cleanslice` MCP knowledge sufficiently and did not guess.\n\nContext JSON:\n$ARGUMENTS\n\nVerification requirements:\n1) Identify what the user asked for (deliverables + constraints) from the conversation/transcript in $ARGUMENTS.\n2) Verify the agent consulted the `cleanslice` MCP server for relevant knowledge BEFORE finalizing:\n - Must call `cleanslice` \"get-started\" at least once (or equivalent) to confirm the server's purpose and usage.\n - Must call \"list-categories\" to understand the available knowledge areas.\n - Must call \"search\" with task-relevant queries (at least 2 searches) covering: (a) core implementation details, (b) edge cases / constraints.\n - May call \"read-doc\" to get full document content when search snippets are insufficient.\n3) Validate coverage:\n - If any required category is relevant but not checked, fail.\n - If answers include specifics that are not supported by MCP results, fail.\n4) Output STRICT JSON only:\n - If everything is verified: {\"ok\": true}\n - If anything is missing/unsupported: {\"ok\": false, \"reason\": \"What is missing + exact MCP calls the main agent must run next (e.g., run list-categories, then search for X/Y, then update the solution).\"}\n\nImportant:\n- `cleanslice` tools will appear as MCP tools. Use whatever exact tool names are available in this environment (they follow the mcp__<server>__<tool> naming pattern).\n- Do not allow stopping until MCP-backed evidence is sufficient."
}
]
}
]
}
}
Cursor にインストール
次の場所に移動します:Settings -> Cursor Settings -> MCP -> Add new global MCP server
次の内容を Cursor の ~/.cursor/mcp.json ファイルに貼り付けてください。プロジェクトフォルダーに .cursor/mcp.json を作成すれば、特定のプロジェクトにインストールすることもできます。詳しくはCursor MCP ドキュメントをご覧ください。
{
"mcpServers": {
"cleanslice": {
"type": "http",
"url": "https://mcp.cleanslice.org/mcp"
}
}
}
ヒント:Cursor ルールで MCP の使用を徹底する
コードを書く前に Cursor が必ず MCP を参照するようにするには、プロジェクトに .cursor/rules/cleanslice.mdc を作成してください。
---
description: CleanSlice architecture rules
globs: **/*.{ts,vue,prisma}
alwaysApply: true
---
## CleanSlice MCP — Required
Before writing or modifying any code you MUST consult the CleanSlice MCP:
1. Call `get-started` to load the core architecture rules.
2. Call `list-categories` to see available documentation areas.
3. Call `search` with at least 2 task-relevant queries covering:
(a) core implementation details for the feature you are building,
(b) edge cases, constraints, or standards that apply.
4. Call `read-doc` to read the full document when search snippets aren't enough.
Do NOT guess conventions — always verify against MCP results first.
Windsurf にインストール
Windsurf の MCP 設定ファイルに追加してください。詳しくはWindsurf MCP ドキュメントをご覧ください。
{
"mcpServers": {
"cleanslice": {
"type": "http",
"serverUrl": "https://mcp.cleanslice.org/mcp"
}
}
}
ヒント:Windsurf ルールで MCP の使用を徹底する
コードを書く前に Windsurf が必ず MCP を参照するようにするには、プロジェクトに .windsurf/rules/cleanslice.md を作成してください。
## CleanSlice MCP — Required
Before writing or modifying any code you MUST consult the CleanSlice MCP:
1. Call `get-started` to load the core architecture rules.
2. Call `list-categories` to see available documentation areas.
3. Call `search` with at least 2 task-relevant queries covering:
(a) core implementation details for the feature you are building,
(b) edge cases, constraints, or standards that apply.
4. Call `read-doc` to read the full document when search snippets aren't enough.
Do NOT guess conventions — always verify against MCP results first.
VS Code(Copilot)にインストール
プロジェクトの .vscode/mcp.json に追加してください。詳しくはVS Code MCP ドキュメントをご覧ください。
{
"servers": {
"cleanslice": {
"type": "http",
"url": "https://mcp.cleanslice.org/mcp"
}
}
}
ヒント:Copilot の指示で MCP の使用を徹底する
コードを書く前に Copilot が必ず MCP を参照するようにするには、プロジェクトのルートに .github/copilot-instructions.md を作成してください。
## CleanSlice MCP — Required
Before writing or modifying any code you MUST consult the CleanSlice MCP:
1. Call `get-started` to load the core architecture rules.
2. Call `list-categories` to see available documentation areas.
3. Call `search` with at least 2 task-relevant queries covering:
(a) core implementation details for the feature you are building,
(b) edge cases, constraints, or standards that apply.
4. Call `read-doc` to read the full document when search snippets aren't enough.
Do NOT guess conventions — always verify against MCP results first.
Claude Desktop にインストール
claude_desktop_config.json に追加してください。詳しくはClaude Desktop MCP ドキュメントをご覧ください。
{
"mcpServers": {
"cleanslice": {
"type": "http",
"url": "https://mcp.cleanslice.org/mcp"
}
}
}
Opencode にインストール
Opencode の設定ファイルに次の内容を追加してください。詳しくはOpencode MCP ドキュメントをご覧ください。
{
"mcp": {
"cleanslice": {
"type": "remote",
"url": "https://mcp.cleanslice.org/mcp",
"enabled": true
}
}
}
ヒント:AGENTS.md で MCP の使用を徹底する
コードを書く前に Opencode が必ず MCP を参照するようにするには、プロジェクトのルートに AGENTS.md を作成してください。
## CleanSlice MCP — Required
Before writing or modifying any code you MUST consult the CleanSlice MCP:
1. Call `get-started` to load the core architecture rules.
2. Call `list-categories` to see available documentation areas.
3. Call `search` with at least 2 task-relevant queries covering:
(a) core implementation details for the feature you are building,
(b) edge cases, constraints, or standards that apply.
4. Call `read-doc` to read the full document when search snippets aren't enough.
Do NOT guess conventions — always verify against MCP results first.
ローカルで実行
git clone https://github.com/CleanSlice/mcp.git
cd mcp
bun install
bun run dev
次に、MCP クライアントの接続先を http://localhost:8080/mcp に設定してください。
利用可能なツール
| ツール | 説明 |
|---|---|
get-started | CleanSlice の基本的なルールと規約を返します。最初に呼び出してください。 |
list-categories | 検索フィルターとして利用できるすべてのドキュメントカテゴリを一覧表示します |
search | クエリ、カテゴリ、フレームワーク、フェーズ、またはタグでドキュメントを検索します。スニペット(キーワードとその前後の抜粋)とドキュメントのパスを返します |
read-doc | パスを指定して、特定のドキュメントの全内容を読み込みます。完全なドキュメントを取得するには、search の後に使用してください |
推奨ワークフロー
get-started → learn the core rules
list-categories → discover what's available
search(query: "...") → find relevant docs (returns snippets)
read-doc(path: "...") → read full document when snippets aren't enough
search ツールは、各結果について文書全体ではなく、キーワードを含む前後の抜粋を1~3件返します。これにより、最も関連性の高いセクションを示しながら、応答をコンパクト(約3~5K、全文では約95K)に保てます。必要に応じて、検索結果の path を使って read-doc で文書全体を取得してください。
環境変数
| 変数 | デフォルト | 説明 |
|---|---|---|
PORT | 8080 | サーバーのポート |
NODE_ENV | - | デバッグ/詳細ログを有効にするには dev を設定します |
DOCS_PATH | 自動検出 | バンドルされたドキュメントディレクトリのパス |
GITHUB_REPO | CleanSlice/docs | ドキュメント用のフォールバック GitHub リポジトリ |
GITHUB_BRANCH | main | 取得する GitHub ブランチ |
GITHUB_TOKEN | - | GitHub トークン(任意。レート制限を緩和する場合に使用) |
GITHUB_CACHE_TTL | 3600 | GitHub コンテンツキャッシュの有効期間(秒) |
CORS_ORIGIN | * | 許可する CORS オリジン |
Docker
docker build -t cleanslice-mcp .
docker run -p 8080:8080 cleanslice-mcp
エンドポイント
| エンドポイント | 説明 |
|---|---|
GET /sse | SSE トランスポート(Claude Desktop、Cursor 用) |
POST /messages | SSE メッセージハンドラー |
POST /mcp | ストリーミング可能な HTTP トランスポート |
GET /health | ヘルスチェック |
GET /api | Swagger ドキュメント |
アーキテクチャドキュメントの同期
docs/architecture/ にある4つの信頼性ガイドは、ウェブサイトリポジトリの docs/architecture/ ファイル(隣接するチェックアウト ../docs/docs/architecture)から生成されます。正規ドキュメントを編集した後に node scripts/sync-architecture-docs.mjs を実行し、リリース前に node scripts/sync-architecture-docs.mjs --check を実行してください。別のチェックアウト構成を使用する場合は、--source=/absolute/path/to/architecture を渡してください。チェックでは、コピーの欠落や差異がある場合に失敗します。スタンドアロンのデプロイ環境でも同じバージョンのコンテンツを検索・読み込みできるよう、生成されたバンドルを MCP の変更とともにコミットしてください。
get-started は 00-quickstart/get-started.md を直接読み込み、ローカルを優先してリモートへフォールバックします。利用できない場合は、空のルールを返すのではなく、明示的に失敗します。バンドルされたナレッジの統合テストでは、実際の読み込み、検索、レンダリングされた起動時コンテンツを検証します。ローカルでファイルを更新しても、ホストされた MCP は更新されません。通常の承認済みリリースプロセスに従ってビルドとテストを行い、ドキュメントを公開し、MCP をデプロイしてください。
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。