ascendc-codemap-mcp
AscendC CodeMap MCP
面向 AI 编码智能体的 AscendC 算子 CodeMap。将单个算子(Host / TilingKey / TilingData / Kernel)索引到已提交的 .uo 图中,然后通过 MCP 回答结构化查询。
这是 codebase-memory-mcp 的算子对应版本:安装一次,接入 Cursor / OpenCode / Codex / Claude Code,然后说 索引此算子。
构建 CodeMap 需要 CANN 头文件和 libclang。查询现有的 .uo 不需要 CANN。
安装
pip install -e .
ascendc-codemap-mcp install重启编码智能体。工具会以 MCP 服务器 ascendc-codemap-mcp 的形式出现。
Windows:
pip install -e .
ascendc-codemap-mcp installinstall 会为检测到的客户端写入自有的 MCP 条目(以及技能)。它不会启用 YOLO 模式,也不会改写无关的服务器。uninstall 只移除自有条目。
Related MCP server: Lore MCP Server
CLI
ascendc-codemap-mcp # stdio MCP (default)
ascendc-codemap-mcp install
ascendc-codemap-mcp uninstall
ascendc-codemap-mcp doctor --project <op> --architecture arch35
ascendc-codemap-mcp index --project <op> --architecture arch35
ascendc-codemap-mcp update --project <op> --architecture arch35
ascendc-codemap-mcp status --project <op> --architecture arch35
ascendc-codemap-mcp query --project <op> --architecture arch35 [pattern]MCP 工具
codemap_doctor— CANN / libclang / 算子路径 / 架构index_operator— 准备 → 提取 → 分析 → 提交(冷构建;尚无.uo)update_operator— 源码变更后对现有.uo进行增量刷新codemap_status—.uo是否存在query_codemap— 四种形式:索引、标识符、Dim=V/Name=Value、file+line
不要在 MCP 连接时自动建立索引。为算子建立索引可能需要几分钟。
产品布局
<operator>/.ascendc-codemap/<arch>/<op>.<arch>.uo环境变量
ASCENDC_CODEMAP_CANN_ROOT(回退:ASCEND_CANN_PACKAGE_PATH、ASCEND_HOME_PATH、CANN_ROOT)ASCENDC_CODEMAP_CACHE_DIR(默认~/.cache/ascendc-codemap-mcp)Codex MCP 子进程只会接收
env_vars中列出的名称;install会转发 CANN/cache 相关变量。
客户端
客户端 | MCP 配置 |
Cursor |
|
Claude Code |
|
Codex |
|
OpenCode |
|
Cursor 和 Claude Code 只会获得技能(没有拦截 Grep 的钩子)。Codex 和 OpenCode 还会获得一个 AGENTS.md 段落。
Available Tools
5 toolscodemap_doctorcodemap_doctorA
Check whether this machine can build an AscendC operator CodeMap: CANN headers, libclang, operator directory, and architecture.
| Name | Required | Description | Default |
|---|---|---|---|
| project | No | Operator directory (absolute path). | |
| architecture | No | e.g. arch35. Required for index paths. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the phrase 'Check whether' credibly signals a non-mutating diagnostic and the colon list reveals exactly what environment conditions are inspected. It does not spell out the result format or whether the check can have side effects, but the core behavior is transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence states the purpose before a colon-delimited list of dependencies. There is no filler or duplication of the schema; every phrase earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a low-complexity diagnostic with 100% schema coverage, the description gives an agent enough to select and call it correctly. The main gap is the absence of an output schema or a stated return shape (e.g., boolean vs. detailed report), but the core invocation context is complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the parameters are already documented. The description adds context by confirming that 'project' is the operator directory and architecture is one of the checked conditions, but it does not add new syntax or semantics beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific action ('Check whether this machine can build an AscendC operator CodeMap') and a concrete resource, with an explicit list of checked prerequisites (CANN headers, libclang, operator directory, architecture). This clearly distinguishes a preflight diagnostic from the sibling index/update/query tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The use case is implied: call this when you need to know whether the machine is ready to build a CodeMap before running a build or index operation. However, it does not explicitly name alternatives or say when not to use it, leaving some routing to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
codemap_statuscodemap_statusA
Whether a committed .uo CodeMap exists for this operator + architecture, plus mtime and completeness.
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| architecture | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must carry the behavioral disclosure burden, and it does partially by clarifying that the tool reports existence, mtime, and completeness rather than returning CodeMap content. It does not state whether the operation is read-only, what happens when the CodeMap is missing, or any authentication or error behavior. This is adequate for a likely innocuous status check but leaves gaps around edge-case behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that packs the resource, the condition (committed), the parameters (operator + architecture), and the returned attributes (existence, mtime, completeness) with no wasted words. Everything present is informative and directly relevant.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple two-parameter schema and no output schema, the description provides the core return semantics, but it does not describe the response shape, success/failure indicators, or behavior when no committed CodeMap exists. It is functionally complete for a basic status check but could benefit from a note on the return format.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It does so by mapping the two parameters to 'this operator + architecture', indicating that 'project' likely refers to an operator and 'architecture' to an architecture. It does not define valid values, formats, or the relationship between the fields, leaving some ambiguity.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear, specific purpose: it checks whether a committed .uo CodeMap exists for a given operator and architecture, and reports mtime and completeness. It is not a tautology and goes beyond the name by naming the exact resource and attributes. However, it does not explicitly contrast itself with siblings like query_codemap or codemap_doctor, so differentiation is implied rather than stated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The wording 'Whether a committed .uo CodeMap exists' implies an agent should use this tool to check existence/status, but there is no explicit guidance on when to reach for it instead of query_codemap or codemap_doctor. It lacks any mention of preconditions, alternatives, or exclusions, so the agent must infer usage from context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
index_operatorindex_operatorA
Build or rebuild the operator CodeMap (prepare → extract → analyze → commit). Requires project + architecture. Do not call on MCP connect; only when the user asks to index or no .uo exists. If a .uo already exists, use update_operator instead.
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | Operator directory (absolute path). | |
| architecture | Yes | e.g. arch35. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries the burden. It explains the pipeline stages and the rebuild behavior, implying a mutating operation. It also warns against calling on MCP connect. However, it doesn't explicitly state side effects like overwriting an existing .uo or the nature of the output, which would add more transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences deliver the purpose, pipeline, preconditions, and alternative routing without fluff. Critical usage constraints are front-loaded and every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given only two required params and no output schema, the description covers the main decision points well: what the tool does, when to call it, and when not to. Minor gaps remain around post-conditions (e.g., what a successful run produces) and whether 'rebuild' is destructive, but these are not critical for a tool with such strong usage guidance.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so both parameters are already documented with types and descriptions. The description only restates that project and architecture are required, adding no additional semantic detail beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action: 'Build or rebuild the operator CodeMap' with a pipeline (prepare → extract → analyze → commit). It distinguishes itself from sibling update_operator by explicitly stating when to use that alternative instead.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives explicit conditions for use: 'only when the user asks to index or no .uo exists' and 'Do not call on MCP connect.' It also names the alternative (update_operator) for the opposite case, leaving no ambiguity.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
query_codemapquery_codemapA
Read-only operator CodeMap query. Four shapes only: (1) no pattern = index, (2) identifier e.g. IsPse, (3) Dim=Name or Name=Value e.g. IsPse=1, (4) file + line copied from a previous card. Do not pass natural-language sentences.
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Relative path copied from a previous card. | |
| line | No | ||
| pattern | No | Identifier, Dim=Name, or Name=Value. Omit for index. | |
| project | No | Operator directory. | |
| line_end | No | ||
| architecture | No | e.g. arch35. Required. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden of behavioral disclosure and does state that the tool is read-only and accepts only four shapes. It does not cover invalid-input outcomes or authentication expectations, but the main safety-relevant behavior is clearly disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded with the read-only nature and allowed shapes. Every sentence adds a useful constraint or clarification, with no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the main query patterns but leaves line_end undefined, does not explain project/architecture usage, and the schema's 'Required.' note on architecture conflicts with the declared zero required parameters. An agent can use the main forms but may be uncertain about combinations and output behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds meaningful semantics beyond the schema by explaining pattern syntax, the file+line combination, and the omission rule for the index case. It does not describe line_end or clarify the requiredness of architecture and project, but the core query semantics are well covered.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific read-only query operation on the operator CodeMap and enumerates the four accepted input shapes. The read-only qualifier sharply differentiates it from mutation siblings like update_operator.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives explicit valid invocation forms and explicitly says not to pass natural-language sentences. It does not name alternative tools for other use cases, but the context is clear enough for an agent to know how to use this tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
update_operatorupdate_operatorA
Incrementally refresh an existing CodeMap after source changes (detect → plan → rebuild changed layers). Requires an existing .uo. Do not call on MCP connect. Use index_operator only when no .uo exists.
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | Operator directory (absolute path). | |
| architecture | Yes | e.g. arch35. | |
| confirm_scope | No | Proceed when the plan asks for scope confirmation. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses that this is an incremental rebuild of changed layers, that an existing .uo is required, and that it must not be called on MCP connect. It does not detail side effects or reversibility, but provides substantial behavioral context beyond a bare 'update' label.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three concise, purposeful sentences. The core purpose is front-loaded, followed by two essential constraints and a clear pointer to the alternative tool. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with no output schema, the description covers prerequisites and usage boundaries well. However, it does not describe the return value or outcome of the plan/confirmation flow, and it doesn't state what happens if confirm_scope is false. This leaves a small but meaningful gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all three parameters (project, architecture, confirm_scope) are already documented in the schema. The description adds no extra parameter-level meaning, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: 'incrementally refresh an existing CodeMap', and explains the internal pipeline (detect → plan → rebuild changed layers). It clearly distinguishes itself from index_operator ('only when no .uo exists'), leaving no ambiguity about what the tool does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly states when to use the tool ('Requires an existing .uo'), when not to use it ('Do not call on MCP connect'), and names the alternative: 'Use index_operator only when no .uo exists.' This is direct and actionable guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool maps to a distinct action: environment check, full build, incremental update, status check, and read-only query. The overlapping index/update pair is explicitly disambiguated by whether a .uo already exists.
The names are readable and domain-consistent, but they do not follow one pattern: codemap_doctor/codemap_status use noun-first style, query_codemap is verb-first, and index_operator/update_operator use _operator suffix. This makes the naming less predictable across the set.
Five tools is well-scoped for an operator CodeMap lifecycle: preflight, full index, incremental update, status, and query. No tool feels redundant at this granularity.
The surface covers the core lifecycle: build/rebuild, update, status, and query, plus environment validation. An explicit delete/cleanup tool is absent, but rebuild and update cover most recovery workflows.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Hosted code graph over MCP: exact callers, dependencies, and cross-repo blast radius for AI agents.
Multiple MCP tools, persistent graph memory, token-saving data pointers, and more.
Agent-driven search: build, import, tune, search, and score result quality — all over MCP.
Remote MCP learning coach for coding agents.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceProvides code intelligence for AI coding agents by indexing repositories into a hybrid knowledge graph, enabling agents to query dependencies, impact, and context through 28 MCP tools.3Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables LLM agents to query a codebase's structural knowledge (symbols, imports, call graphs, etc.) via MCP, reducing tokens and improving correctness compared to raw file access.266MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to search, analyze, and understand multi-language codebases by providing indexed code intelligence via MCP.167527MIT
- AlicenseNot gradedqualityBmaintenanceExposes code graphs across multi-program repositories via MCP, enabling humans and agents to query the fleet with evidence.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sunye1213106/ascendc-codemap-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server