@weapp-vite/mcp
v1.1.1
Published
mcp
Readme
@weapp-vite/mcp
简介
@weapp-vite/mcp 是面向 weapp-vite / wevu monorepo 的 MCP 服务端实现,目标是把核心研发能力暴露给 AI:
- 包目录与能力发现
- 源码读取、检索、按行裁剪
- 包级脚本执行
weapp-viteCLI 执行- 文档/变更记录资源暴露
- 调试/改造提示词模板
默认通过 stdio 运行,适合接入任意 MCP Client,也支持 streamable-http。
启动
pnpm --filter @weapp-vite/mcp start也可以在 Node 脚本里直接调用:
import { startWeappViteMcpServer } from '@weapp-vite/mcp'
const handle = await startWeappViteMcpServer({
workspaceRoot: process.cwd(),
transport: 'streamable-http',
host: '127.0.0.1',
port: 3088,
endpoint: '/mcp',
})
await handle.close?.()主要 Tools
workspace_catalog: 输出weapp-vite / wevu / wevu-compiler目录、版本、脚本list_source_files: 列出包内文件(默认src)read_source_file: 读取包内文件,支持startLine/endLine/maxCharssearch_source_code: 在包源码中检索关键词run_package_script: 在指定包目录执行pnpm run <script>run_weapp_vite_cli: 执行node packages/weapp-vite/bin/weapp-vite.js ...run_repo_command: 执行仓库级命令(pnpm/node/git/rg)
主要 Resources
weapp-vite://workspace/catalogweapp-vite://docs/{package}/README.mdweapp-vite://docs/{package}/CHANGELOG.mdweapp-vite://source/{package}?path={path}
其中 {package} 支持:
weapp-vitewevuwevu-compiler
Prompts
plan-weapp-vite-change: 生成 weapp-vite/wevu 改造计划提示词debug-wevu-runtime: 生成 wevu runtime 排查提示词
开发
pnpm --filter @weapp-vite/mcp test
pnpm --filter @weapp-vite/mcp build相关链接
- MCP SDK: https://github.com/modelcontextprotocol/sdk
- 仓库: https://github.com/weapp-vite/weapp-vite
