zhin-mcp-server
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseZhin MCP Server Guide
Zhin MCP 服务器指南
Use this skill to set up the plugin, enabling AI assistants (Claude, Cursor, etc.) to understand and generate Zhin plugins via the Model Context Protocol.
@zhin.js/mcp使用本技能来设置插件,让Claude、Cursor等AI助手能够通过Model Context Protocol理解并生成Zhin插件。
@zhin.js/mcpInstallation
安装
bash
pnpm add @zhin.js/mcpbash
pnpm add @zhin.js/mcpConfiguration
配置
MCP requires the HTTP plugin. Enable both in :
zhin.config.ymlyaml
plugins:
- http
- mcp
http:
port: 8086
mcp:
enabled: true
path: /mcpThe MCP endpoint is available at .
http://localhost:8086/mcpMCP依赖HTTP插件。在中启用两者:
zhin.config.ymlyaml
plugins:
- http
- mcp
http:
port: 8086
mcp:
enabled: true
path: /mcpMCP端点地址为。
http://localhost:8086/mcpConnecting AI Assistants
连接AI助手
Claude Desktop
Claude Desktop
Edit :
~/Library/Application Support/Claude/claude_desktop_config.jsonjson
{
"mcpServers": {
"zhin": {
"command": "curl",
"args": ["-N", "http://localhost:8086/mcp"]
}
}
}编辑:
~/Library/Application Support/Claude/claude_desktop_config.jsonjson
{
"mcpServers": {
"zhin": {
"command": "curl",
"args": ["-N", "http://localhost:8086/mcp"]
}
}
}Cursor/VSCode
Cursor/VSCode
Install an MCP extension and configure the server URL in settings.
安装MCP扩展并在设置中配置服务器URL。
Available Tools
可用工具
create_plugin
create_plugin
Create a new Zhin plugin file.
| Parameter | Required | Description |
|---|---|---|
| Yes | Plugin name |
| Yes | Plugin description |
| No | Feature list: |
| No | Save directory (default: |
创建新的Zhin插件文件。
| 参数 | 是否必填 | 描述 |
|---|---|---|
| 是 | 插件名称 |
| 是 | 插件描述 |
| 否 | 功能列表: |
| 否 | 保存目录(默认: |
create_command
create_command
Generate command code snippets.
| Parameter | Required | Description |
|---|---|---|
| Yes | Command pattern, e.g. |
| Yes | Command description |
| No | Whether to include permission checks |
生成命令代码片段。
| 参数 | 是否必填 | 描述 |
|---|---|---|
| 是 | 命令模式,例如 |
| 是 | 命令描述 |
| 否 | 是否包含权限检查 |
create_component
create_component
Generate message component code.
| Parameter | Required | Description |
|---|---|---|
| Yes | Component name |
| Yes | Property definitions |
| No | Whether to use JSX syntax |
生成消息组件代码。
| 参数 | 是否必填 | 描述 |
|---|---|---|
| 是 | 组件名称 |
| 是 | 属性定义 |
| 否 | 是否使用JSX语法 |
create_adapter
create_adapter
Generate platform adapter code.
| Parameter | Required | Description |
|---|---|---|
| Yes | Adapter name |
| Yes | Adapter description |
| No | Whether webhook support is needed |
生成平台适配器代码。
| 参数 | 是否必填 | 描述 |
|---|---|---|
| 是 | 适配器名称 |
| 是 | 适配器描述 |
| 否 | 是否需要支持Webhook |
create_model
create_model
Generate database model definition.
| Parameter | Required | Description |
|---|---|---|
| Yes | Model name |
| Yes | Field definitions |
生成数据库模型定义。
| 参数 | 是否必填 | 描述 |
|---|---|---|
| 是 | 模型名称 |
| 是 | 字段定义 |
query_plugin
query_plugin
Query details of an existing plugin.
| Parameter | Required | Description |
|---|---|---|
| Yes | Plugin name to query |
查询现有插件的详细信息。
| 参数 | 是否必填 | 描述 |
|---|---|---|
| 是 | 要查询的插件名称 |
list_plugins
list_plugins
List all loaded plugins (no parameters).
列出所有已加载的插件(无参数)。
Available Resources
可用资源
MCP exposes documentation as resources:
| URI | Description |
|---|---|
| Zhin architecture design |
| Plugin development guide |
| Development best practices |
| Command system docs |
| Component system docs |
| Context system docs |
| Basic plugin example |
| Command plugin example |
| Adapter example |
MCP将文档作为资源暴露:
| URI | 描述 |
|---|---|
| Zhin架构设计 |
| 插件开发指南 |
| 开发最佳实践 |
| 命令系统文档 |
| 组件系统文档 |
| 上下文系统文档 |
| 基础插件示例 |
| 命令插件示例 |
| 适配器示例 |
Available Prompts
可用提示词
create-plugin-workflow
create-plugin-workflow
Guides the full plugin creation workflow.
Parameter: — , , , or .
feature_typecommandmiddlewarecomponentadapter指导完整的插件创建流程。
参数: — , , , 或 。
feature_typecommandmiddlewarecomponentadapterdebug-plugin
debug-plugin
Step-by-step plugin debugging guidance.
Parameter: (optional) — the error to diagnose.
error_message分步指导插件调试。
参数:(可选)—— 要诊断的错误信息。
error_messagebest-practices
best-practices
Returns Zhin development best practices.
返回Zhin开发最佳实践。
Usage Scenarios
使用场景
Create a Plugin via AI
通过AI创建插件
User: Create a plugin named "welcome" that replies when users say hello
AI: [Uses create_plugin tool] Created plugin with command feature...用户:创建一个名为"welcome"的插件,当用户说hello时进行回复
AI:[使用create_plugin工具] 创建了包含命令功能的插件...Debug a Plugin via AI
通过AI调试插件
User: My plugin reports "Context not found"
AI: [Uses query_plugin to inspect] This error usually means the context
dependency hasn't been registered yet...用户:我的插件提示"Context not found"
AI:[使用query_plugin工具检查] 这个错误通常意味着上下文依赖尚未注册...Generate an Adapter via AI
通过AI生成适配器
User: Create a WhatsApp adapter with webhook support
AI: [Uses create_adapter tool] Generated WhatsApp adapter scaffold...用户:创建一个支持Webhook的WhatsApp适配器
AI:[使用create_adapter工具] 生成了WhatsApp适配器脚手架...Checklist
检查清单
- Install and
@zhin.js/mcp.@zhin.js/http - Add both and
httpto the plugins list.mcp - Configure (default
mcp.path)./mcp - Start the Zhin app, then connect your AI assistant.
- Use MCP tools to scaffold plugins, commands, components, and adapters.
- Access resources for framework documentation.
zhin://docs/*
- 安装和
@zhin.js/mcp。@zhin.js/http - 将和
http添加到插件列表中。mcp - 配置(默认值为
mcp.path)。/mcp - 启动Zhin应用,然后连接你的AI助手。
- 使用MCP工具快速生成插件、命令、组件和适配器的脚手架。
- 访问资源获取框架文档。
zhin://docs/*