ArkTS Helper MCP
Provides documentation search and AI Q&A for ArkTS/ArkUI development using Huawei's official documentation and intelligent Q&A service.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ArkTS Helper MCP Explain @State vs @Prop in ArkTS"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ArkTS Helper MCP
ArkTS/ArkUI 开发助手 MCP Server,为 AI 编程助手(Claude Code、Cursor、Windsurf 等)提供文档检索和华为官方智能问答能力。
功能概览
工具 | 功能 | 说明 |
| 文档搜索 | 关键词搜索 1000+ 篇 ArkTS/ArkUI 官方文档 |
| 文档阅读 | 根据 objectId 获取完整 Markdown 内容 |
| 分类浏览 | 列出所有文档主题及数量 |
| AI 问答 | 调用华为官方智能问答,获取整合回答 |
| 批量问答 | 并行处理多个问题,大幅节省时间 |
| 读取全文 | 获取被截断的完整回答 |
| 设置凭证 | 配置登录态 Cookie,突破匿名次数限制 |
Related MCP server: DevDocs MCP Server
快速开始
安装
git clone https://github.com/LongLiveY96/arkts-helper-mcp.git
cd arkts-helper-mcp
npm install
npm run build配置 AI 助手
Claude Code / Cursor / Windsurf:
{
"mcpServers": {
"arkts-helper": {
"command": "node",
"args": ["/path/to/arkts-helper-mcp/dist/index.js"]
}
}
}HTTP 模式(可选)
npm run start:http端点:
GET /health— 健康检查GET /search?q=关键词— 搜索文档GET /doc/:objectId— 获取文档GET /topics— 列出主题
使用示例
配置完成后,AI 助手会自动调用工具:
用户:@State 和 @Prop 有什么区别?
AI:→ find_docs({ query: "State Prop 装饰器" })
→ read_doc({ objectId: "arkts-state" })
@State 是组件私有状态,@Prop 是单向数据传递...用户:Navigation 怎么实现页面跳转并传参?
AI:→ ask_ai({ query: "Navigation 页面跳转传参" })
Navigation 是路由容器组件,通过 NavPathStack 管理页面栈...用户:同时告诉我 @State、@Prop、@Link 的用法
AI:→ ask_ai_batch({ queries: ["@State用法", "@Prop用法", "@Link用法"] })
(并行查询,约 60 秒返回全部结果)环境变量
变量名 | 说明 | 默认值 |
| 文档目录路径 |
|
| HTTP 服务端口 |
|
| AI 问答超时(毫秒) |
|
| Cookie 配置目录 |
|
AI 问答认证(可选)
匿名模式有次数限制。配置登录态 Cookie 可解除限制:
F12 → Network → 使用智能问答提问
找到
dialog/submission请求,复制 Cookie通过工具设置:
set_ai_auth({ cookie: "你的Cookie" })
Cookie 保存在 ~/.config/arkts-mcp/config.json,不会进入代码仓库。
许可证
MIT
Available Tools
7 toolsask_aiA
向华为开发者官方智能问答助手提问。
使用场景
当需要获取更全面、更权威的鸿蒙开发答案时使用此工具:
复杂的开发问题(整合了官方文档 + 社区经验)
需要代码示例和最佳实践
错误排查和问题解决
获取最新的开发建议
与 find_docs 的区别
find_docs:搜索本地文档,返回原始文档内容
ask_ai:调用华为官方 AI,返回整合后的智能回答
使用示例
示例1 - 用户问:"Navigation 怎么实现页面跳转并传参?" 调用:ask_ai({ query: "Navigation 怎么实现页面跳转并传参" })
示例2 - 用户问:"List 组件性能优化有哪些方法?" 调用:ask_ai({ query: "List 组件性能优化方法" })
返回华为官方智能助手的回答,包含参考链接。
Inputs: query (required), newSession.
ask_ai_batchA
批量向华为开发者官方智能问答助手提问(并行处理)。
使用场景
当需要同时查询多个问题时使用此工具:
一次调用处理多个相关问题
服务器端并行执行,大幅节省时间
适用于需要查询多个不同主题的场景
与 ask_ai 的区别
ask_ai:单次提问,多个问题需要多次调用
ask_ai_batch:批量提问,一次调用处理多个问题(并行执行)
使用示例
示例1 - 批量查询不同主题: 调用:ask_ai_batch({ queries: ["Navigation 组件用法", "List 性能优化", "@State 和 @Prop 区别"] })
示例2 - 批量查询相关问题: 调用:ask_ai_batch({ queries: ["如何实现页面跳转", "如何传递参数", "如何返回数据"] })
性能优势
假设单个问题响应时间 60 秒:
串行调用 3 个问题:60s + 60s + 60s = 180 秒
批量并行调用:约 60 秒(取决于最慢的问题)
Inputs: queries (required), newSession.
find_docsA
搜索 HarmonyOS ArkTS 官方开发文档。
使用场景
当用户询问以下内容时,应主动使用此工具搜索相关文档:
ArkTS 语法特性和语言约束
ArkUI 组件用法(Button、Text、Column、Row、List、Grid 等)
状态管理装饰器(@State、@Prop、@Link、@Observed、@ObjectLink 等)
动画和转场效果(animateTo、transition、共享元素转场等)
导航和路由(Navigation、NavDestination、Router 等)
系统能力和 API(文件访问、网络请求、数据存储等)
错误码和问题排查
使用示例
示例1 - 用户问:"@State 和 @Prop 有什么区别?" 调用:search_arkts_docs({ query: "State Prop 装饰器" })
示例2 - 用户问:"怎么实现页面跳转?" 调用:search_arkts_docs({ query: "Navigation 路由 页面跳转" })
示例3 - 用户问:"List 组件怎么用?" 调用:search_arkts_docs({ query: "List 列表组件" })
示例4 - 用户问:"动画怎么实现?" 调用:search_arkts_docs({ query: "animateTo 属性动画" })
搜索技巧
使用中文关键词效果更好
可以组合多个关键词,用空格分隔
搜索组件时加上"组件"后缀,如"Button组件"
搜索装饰器时可以带@符号,如"@State"
返回匹配的文档列表,包含标题、预览和 objectId(用于 read_doc 获取完整内容)。
Inputs: query (required), limit.
list_doc_topicsA
列出 ArkTS 文档的所有主题分类。
使用场景
了解文档库的整体结构
查看有哪些主题分类
统计各分类的文档数量
使用示例
当用户问"文档有哪些分类?"或"有什么类型的文档?"时调用此工具。
返回所有主题分类及其文档数量。
Inputs: no named parameters.
read_docA
读取 ArkTS 文档的完整内容。
使用场景
在使用 find_docs 搜索后,根据返回的 objectId 读取文档的完整 Markdown 内容。
使用流程
先调用 find_docs 搜索相关文档
从搜索结果中选择最相关的文档
使用该文档的 objectId 调用此工具获取完整内容
使用示例
示例 - 搜索后读取完整文档:
调用:find_docs({ query: "State装饰器" })
从结果中找到 objectId: "arkts-state"
调用:read_doc({ objectId: "arkts-state" })
返回文档的完整 Markdown 内容,包含代码示例和详细说明。
Inputs: objectId (required).
read_moreA
读取被截断的完整回答内容。
使用场景
当 ask_ai 返回的内容被截断时,使用此工具读取完整内容。
使用流程
调用 ask_ai 获取回答
如果回答中包含 "内容过长已缓存" 的提示和 resourceId
使用该 resourceId 调用此工具读取完整内容
使用示例
read_more({ resourceId: "qa-result-1-1706123456789" })
返回完整的 Markdown 格式回答内容。
Inputs: resourceId (required).
set_ai_authA
设置 AI 问答的登录凭证,用于突破匿名态的次数限制。
使用场景
当 ask_ai 提示次数限制或需要登录时,使用此工具设置登录凭证。
如何获取 Cookie
打开浏览器,登录 developer.huawei.com
打开开发者工具 (F12) → Network 标签
在页面上使用智能问答功能提问
找到 dialog/submission 请求
复制 Request Headers 中的 Cookie 值
使用示例
set_ai_auth({ cookie: "your_full_cookie_value_here" })
设置成功后,后续的 ask_ai 调用将使用登录态,无次数限制。
Inputs: cookie (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: ask_ai vs ask_ai_batch are differentiated by single vs batch, find_docs vs read_doc vs list_doc_topics cover different phases of documentation access, read_more handles truncation, and set_ai_auth manages authentication. Descriptions explicitly contrast overlapping tools.
All tool names follow a consistent verb_noun pattern with lowercase and underscores (e.g., ask_ai, find_docs, list_doc_topics). No mixing of conventions like camelCase or inconsistent verb styles.
With 7 tools, the server is well-scoped for its purpose of providing ArkTS documentation search/reading and AI Q&A. Each tool earns its place without redundancy or excessive numbers.
The tool surface covers the core workflow: search docs, list topics, read docs, ask AI (single/batch), retrieve truncated responses, and set auth. A minor gap is no explicit tool for clearing auth or browsing AI history, but the set is largely complete for its stated domain.
Maintenance
Related MCP Connectors
Versioned documentation registry and semantic search for AI tools and coding assistants.
Search and query nTop's knowledge base and engineering guides from AI applications.
Tailor Platform for AI assistants: search, list and read the platform documentation.
Provide your AI coding tools with token-efficient access to up-to-date technical documentation for…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search documentation of packages and services to find implementation details, examples, and specifications.MIT
- FlicenseAqualityDmaintenanceProvides AI models with direct access to documentation for over 600 technologies from DevDocs.io, including popular languages, frameworks, and tools. It enables comprehensive searching, content retrieval, and offline access via an intelligent local caching system.122-
- FlicenseNot gradedqualityDmaintenanceProvides retrieval of WeChat Work and Feishu developer documentation, enabling AI assistants to query API references without switching browsers.19-
- AlicenseAqualityDmaintenanceBrings HarmonyOS and OpenHarmony English documentation to AI assistants for instant retrieval and multimodal analysis.34MIT