cleanslice/mcp 是从 https://github.com/cleanslice/mcp. 导入的 MCP 服务器候选
概览
cleanslice/mcp 是从 https://github.com/cleanslice/mcp. 导入的 MCP 服务器候选
概述(AI 翻译)
MCP(模型上下文协议)服务器,使AI编码代理能够访问CleanSlice架构文档。将其连接到Claude、Cursor、Windsurf或任何兼容MCP的客户端,使AI知道如何使用CleanSlice约定构建应用。
安装
在 Claude Code 中安装
执行这个命令。更多信息请参见Claude代码MCP文档。
移除
--scope user以仅用于当前项目安装。
提示:强制使用 CLAUDE.md 的MCP
为了确保 Claude Code 在编写任何代码前始终查阅 CleanSlice MCP,请在项目的 CLAUDE.md 中添加以下内容:
这确保代理在每个任务开始时读取CleanSlice文档,而不是事后处理。
可选:添加一个止钩作为安全网
为了捕捉代理跳过MCP但有CLAUDE.md指令的情况,将以下内容添加到.claude/settings.json中:
在光标中安装
前往:Settings -> Cursor Settings -> MCP -> Add new global MCP server
将以下内容粘贴到你的光标 ~/.cursor/mcp.json 文件中。你也可以通过在项目文件夹中创建 .cursor/mcp.json 来安装特定项目。更多信息请参见光标 MCP 文档。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
CleanSlice MCP Server
MCP (Model Context Protocol) server that gives AI coding agents access to the CleanSlice architecture documentation. Connect it to Claude, Cursor, Windsurf, or any MCP-compatible client so the AI knows how to build apps using CleanSlice conventions.
Installation
Run this command. See Claude Code MCP docs for more info.
claude mcp add --scope user --transport http cleanslice https://mcp.cleanslice.org/mcp
Remove
--scope userto install for the current project only.
Tip: enforce MCP usage with CLAUDE.md
To make sure Claude Code always consults the CleanSlice MCP before writing any code, add the following to your project’s 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.
This ensures the agent reads CleanSlice docs at the start of every task, not after the fact.
Optional: add a Stop hook as a safety net
To catch cases where the agent skips the MCP despite the CLAUDE.md instruction, add this to .claude/settings.json:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "agent",
"timeout": 180,
安装
docker run -p 8080:8080 cleanslice-mcp配置
{
"mcpServers": {
"cleanslice": {
"type": "http",
"url": "https://mcp.cleanslice.org/mcp"
}
}
}