MCP 服务器

让 Claude Code、Codex、GitHub Copilot、Cursor 和 Windsurf 直接访问 SurfaceOne 的文档、API 和令牌。

@surface-one/angular-mcp 是一个 Model Context Protocol 服务器。你的 AI 助手会向它查询组件的确切 API、可运行的示例、源代码和样式、指南、页面模板以及主题变量——而不是靠猜测。所有内容都随包一起提供:它可以离线工作,并且始终与你的版本保持一致。

Claude Code

bash
claude mcp add surface-one-angular -- npx -y @surface-one/angular-mcp@latest

Codex

bash
codex mcp add surface-one-angular -- npx -y @surface-one/angular-mcp@latest

或者将其添加到 ~/.codex/config.toml:

toml
[mcp_servers.surface-one-angular]
command = "npx"
args = ["-y", "@surface-one/angular-mcp@latest"]

VS Code 与 GitHub Copilot

在项目中添加 .vscode/mcp.json:

json
{
  "servers": {
    "surface-one-angular": {
      "command": "npx",
      "args": ["-y", "@surface-one/angular-mcp@latest"]
    }
  }
}

Cursor、Windsurf 和 Claude Desktop

json
{
  "mcpServers": {
    "surface-one-angular": {
      "command": "npx",
      "args": ["-y", "@surface-one/angular-mcp@latest"]
    }
  }
}

工具

  • list_components —— 所有组件系列及其入口点和选择器。
  • get_component_docs —— 说明、导入方式、可运行的示例和完整 API。接受名称、slug、类名或选择器,例如 soneBtn。
  • get_component_source_code 和 get_component_source_styles —— 实现代码。
  • get_docs —— 指南页面和发布说明。
  • get_theme_variables —— 每套皮肤在亮色和暗色模式下的令牌值。
  • list_templates 和 get_template —— 可直接作为起点的完整页面。

试着这样问

  • “用 SurfaceOne 构建一个设置页面:包含一个开关、一个选择框和一个保存按钮。”
  • “给我看看 SurfaceOne 对话框的 API。”
  • “Paper 皮肤在暗色模式下使用哪些令牌?”

将服务器与智能体技能搭配使用:技能告诉助手如何使用 SurfaceOne,服务器则为它提供事实。