MCP Server for ArkTS development assistant with custom documentation, search capabilities, and integration with Huawei Developer's official AI question-answering service
This MCP server exposes 8 tools for ArkTS documentation search and AI assistance. Overall definition quality is below average. While tool naming follows verb-first conventions (find_docs, read_doc, ask_ai), descriptions are verbose and contain examples in the text rather than as constraints. Several tools lack proper parameter constraints (enums, ranges), and output schemas are not documented. The server accepts user credentials (cookie) as a parameter, violating secure secret injection patterns. Error handling is minimal, most tools provide no recovery guidance.
向华为开发者官方智能问答助手提问。 ## 使用场景 当需要获取更全面、更权威的鸿蒙开发答案时使用此工具: - 复杂的开发问题(整合了官方文档 + 社区经验) - 需要代码示例和最佳实践 - 错误排查和问题解决 - 获取最新的开发建议 ## 与 find_docs 的区别 - find_docs:搜索本地文档,返回原始文档内容 - ask_ai:调用华为官方 AI,返回整合后的智能回答 ## 使用示例 示例1 - 用户问:"Navigation 怎么实现页面跳转并传参?" 调用:ask_ai({ query: "Navigation 怎么实现页面跳转并传参" }) 示例2 - 用户问:"List 组件性能优化有哪些方法?" 调用:ask_ai({ query: "List 组件性能优化方法" }) 返回华为官方智能助手的回答,包含参考链接。
批量向华为开发者官方智能问答助手提问(并行处理)。 ## 使用场景 当需要同时查询多个问题时使用此工具: - 一次调用处理多个相关问题 - 服务器端并行执行,大幅节省时间 - 适用于需要查询多个不同主题的场景 ## 与 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 秒(取决于最慢的问题)
搜索 ArkTS 开发文档。 ## 使用场景 当用户询问以下内容时,应主动使用此工具搜索相关文档: - ArkTS 语法特性和语言约束 - ArkUI 组件用法(Button、Text、Column、Row、List、Grid 等) - 状态管理装饰器(@State、@Prop、@Link、@Observed、@ObjectLink 等) - 动画和转场效果 - 导航和路由 - 系统能力和 API - 错误码和问题排查 ## 使用示例 示例1 - 用户问:"@State 和 @Prop 有什么区别?" 调用:find_docs({ query: "State Prop 装饰器" }) 示例2 - 用户问:"怎么实现页面跳转?" 调用:find_docs({ query: "Navigation 路由 页面跳转" }) 示例3 - 用户问:"List 组件怎么用?" 调用:find_docs({ query: "List 列表组件" }) ## 搜索技巧 - 使用中文关键词效果更好 - 可以组合多个关键词,用空格分隔 - 搜索组件时加上"组件"后缀 - 搜索装饰器时可以带@符号 返回匹配的文档列表,包含标题、预览和 objectId(用于 read_doc 获取完整内容)。
列出文档的所有主题分类。 ## 使用场景 - 了解文档库的整体结构 - 查看有哪些主题分类 - 统计各分类的文档数量 返回所有主题分类及其文档数量。
set_ai_auth accepts cookie credentials as a tool parameter. This violates secure secret injection, credentials in parameters are logged in traces and prompt history. Credentials must be injected server-side via environment variables or vault.
Output schemas are not documented for any tool. Descriptions mention return types in prose ('returns matching documents', 'returns complete Markdown'), but LLMs need structured schema definitions to plan downstream tool calls and extract fields. Documentation must specify return field names, types, and whether results are paginated.
find_docs and ask_ai lack pagination controls in the response description. find_docs accepts a 'limit' parameter (default 50, max 1000), but the description does not specify whether results include a 'total_count' or 'has_more' field. Pagination metadata is essential for LLMs to iterate over large result sets.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 47 | 2026-07-28+ | v2 |
读取文档的完整内容。 ## 使用场景 在使用 find_docs 搜索后,根据返回的 objectId 读取文档的完整 Markdown 内容。 ## 使用流程 1. 先调用 find_docs 搜索相关文档 2. 从搜索结果中选择最相关的文档 3. 使用该文档的 objectId 调用此工具获取完整内容 ## 使用示例 示例 - 搜索后读取完整文档: 1. 调用:find_docs({ query: "State装饰器" }) 2. 从结果中找到 objectId: "arkts-state" 3. 调用:read_doc({ objectId: "arkts-state" }) 返回文档的完整 Markdown 内容,包含代码示例和详细说明。
读取被截断的完整回答内容。 ## 使用场景 当 ask_ai 返回的内容被截断时,使用此工具读取完整内容。 ## 使用流程 1. 调用 ask_ai 获取回答 2. 如果回答中包含 "内容过长已缓存" 的提示和 resourceId 3. 使用该 resourceId 调用此工具读取完整内容 ## 使用示例 read_more({ resourceId: "qa-result-1-1706123456789" }) 返回完整的 Markdown 格式回答内容。
重新加载文档索引。 ## 使用场景 当文档库更新后,使用此工具重新加载索引,使搜索结果包含最新文档。 返回重新加载后的文档总数。
设置 AI 问答的登录凭证,用于突破匿名态的次数限制。 ## 使用场景 当 ask_ai 提示次数限制或需要登录时,使用此工具设置登录凭证。 ## 如何获取 Cookie 1. 打开浏览器,登录 developer.huawei.com 2. 打开开发者工具 (F12) → Network 标签 3. 在页面上使用智能问答功能提问 4. 找到 dialog/submission 请求 5. 复制 Request Headers 中的 Cookie 值 ## 使用示例 set_ai_auth({ cookie: "your_full_cookie_value_here" }) 设置成功后,后续的 ask_ai 调用将使用登录态,无次数限制。
Descriptions contain example values and usage scenarios inline, which LLMs often reuse literally (e.g., 'Navigation 路由 页面跳转' or 'State 管理' become hardcoded search strings). Replace prose examples with formal constraints (enums for known categories, regex patterns for formats).
Error handling provides no recovery guidance. Tools return minimal error messages (if any are visible in the source). E.g., if find_docs returns zero results or ask_ai hits a rate limit, the description does not explain what the LLM should do next (retry, use find_docs instead, ask the user for input).
reload_docs description is generic ('When document library updates') with no indication of when or how often the agent should call it. No explanation of how this tool relates to search freshness or cache invalidation.