Token导航 LogoToken导航TokenDH.com
Foundation Sites MCP Server logo
开发工具未说明官方级别未说明来源级核验

Foundation Sites MCP Server

MCP Server

一个自定义的模型上下文协议(MCP)服务器,为AI助手提供对Foundation for Sites框架的结构化访问。

工具数

10

提示词数

0

GitHub Stars

0

资源数

0
开发工具代码分析TypeScript代码生成

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

hkwandrew

提供方

hkwandrew

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

基础站点MCP服务器

自定义模型上下文协议(MCP)服务器,为AI助手提供对Foundation for Sites框架的结构化访问。

特性

  • 🔌 插件生成:创建符合基金会标准的JavaScript插件
  • 🎨 组件生成:使用混入和变量生成Sass组件
  • 🧪 测试生成:自动生成插件和组件的测试套件
  • 📖 文档访问:Query Foundation的架构和模式
  • 🔍 代码分析:根据基金会惯例验证代码
  • 🏗️ 架构查询:获取插件和组件模式的指导

安装

cd mcp-server
npm install
# or
yarn install

配置

  1. 复制 .env.example.env:
   cp .env.example .env
  1. 配置您的Foundation存储库路径:
   FOUNDATION_REPO_PATH=/path/to/foundation-sites
  1. (可选)配置Redis进行分布式缓存:
   CACHE_BACKEND=redis
   REDIS_URL=redis://localhost:6379

用法

发展模式

npm run start:dev

生产建设

npm run build
npm start

运行测试

npm test
npm run test:watch

与AI助手集成

GitHub Copilot

添加到您的 .copilot-instructions.md:

Use the Foundation MCP server at foundation:// for:
- Generating Foundation plugins and components
- Validating code against Foundation patterns
- Querying architectural guidance

在LM Studio中配置 mcp.json:

{
  "mcp.servers": {
    "foundation": {
      "command": "node",
      "args": ["/path/to/mcp-server/dist/index.js"],
      "env": {
        "FOUNDATION_REPO_PATH": "/path/to/foundation-sites"
      }
    }
  }
}

可用资源

  • foundation://plugins/index -列出所有Foundation插件
  • foundation://plugins/{slug}/template -获取插件模板
  • foundation://plugins/{slug}/docs -获取插件文档
  • foundation://components/{slug}/template -获取组件模板
  • foundation://components/{slug}/docs -获取组件文档
  • foundation://build/config -构建系统配置
  • foundation://architecture/plugins -插件架构指南
  • foundation://patterns/tests/{type} -测试模式
  • foundation://integrations/wordpress -在WordPress主题或插件中使用Foundation的指南

可用工具

代码生成

  • generate_plugin -生成新的Foundation插件
  • generate_component -生成一个新的Sass组件

分析与重构

  • analyze_pattern -根据基础模式分析代码
  • find_similar_pattern -查找类似的代码模式
  • query_architecture -查询架构指导
  • refactor_to_foundation -分析非基础代码并生成全面的迁移指导

文件和参考

  • get_component_reference -获取组件API引用
  • get_plugin_reference -获取插件API参考

验证

  • validate_plugin -验证插件代码
  • wordpress_integration_guide -在WordPress(主题或插件)中排队基础的步骤和片段

建筑

src/
├── index.ts              # Entry point
├── server.ts             # MCP server setup
├── config.ts             # Configuration management
├── handlers/
│   ├── resources.ts      # Resource handlers
│   └── tools.ts          # Tool handlers
├── engines/
│   ├── CodebaseIndexer.ts       # Indexes Foundation codebase
│   ├── PluginAnalyzer.ts        # Analyzes plugin patterns
│   ├── RefactoringAnalyzer.ts   # Migration analysis engine
│   ├── ComponentResolver.ts
│   ├── DocsParser.ts
│   └── ArchitectureMap.ts
├── generators/
│   ├── PluginGenerator.ts
│   ├── ComponentGenerator.ts
│   ├── TestGenerator.ts
│   └── DocGenerator.ts
├── validators/
│   ├── PluginValidator.ts
│   ├── ComponentValidator.ts
│   └── AccessibilityValidator.ts
├── types.ts              # TypeScript interfaces
└── utils/
    ├── cache.ts
    ├── fileSystem.ts
    └── parser.ts

发展

Developpent.md 了解开发指南。

Lint 代码

npm run lint
npm run lint:fix

构建

npm run build

清洁构建工件

npm run clean

重构工具

概述

refactor_to_foundation 该工具分析非Foundation代码,并提供全面的重构指导,以迁移到Foundation等效代码。

特性

  • 特征检测 -识别下拉菜单、手风琴、模态、旋转木马、工具提示、表单等模式
  • 组件匹配 -将检测到的功能映射到具有相似性评分的Foundation插件/组件
  • 迁移规划 -生成逐步迁移指南
  • 代码适配 -提供带有特定更改列表的前后代码示例
  • 突破性变化分析 -识别jQuery与vanilla JS的差异,单位转换(px→rem),架构更改
  • 集成指导 -创建详细的分步实施指南

用法

// Input
{
  sourceCode: string,           // Code to analyze
  sourceType: 'custom-plugin' | 'custom-component',
  foundationTarget?: string     // Optional: target version (default: latest)
}

// Output
{
  sourceType: 'custom-plugin' | 'custom-component',
  suggestedFoundationComponents: [{
    name: string,
    slug: string,
    similarity: number,
    description: string
  }],
  migrationSteps: string[],
  codeAdaptation: {
    before: string,
    after: string,
    changes: [{description, reason, foundationAPI}]
  },
  breakingChanges: [{change, impact, solution}],
  recommendedApproach: string,
  integrationGuide: [{step, description, code}]
}

示例

# Analyze custom dropdown code
{
  "name": "refactor_to_foundation",
  "arguments": {
    "sourceCode": "// your custom dropdown implementation...",
    "sourceType": "custom-plugin",
    "foundationTarget": "6.9"
  }
}

工具将返回:

  • 最佳匹配的基础组件(例如,具有85%相似性的Dropdown插件)
  • 8步迁移指南
  • 前后代码示例
  • 突破性变化和解决方案列表
  • 推荐的迁移策略
  • 分步集成说明

目录标签

目录标签

开发工具代码分析TypeScript代码生成前端开发本地部署架构指导Foundation框架

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

10

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP