Cgm MCP Server

A **Model Context Protocol (MCP)** server implementation of **CodeFuse-CGM** (Code Graph Model), providing graph-integrated large language model

Local serverstdioPython

What is the Cgm MCP MCP server?

Cgm mcp mcp server lets Claude, Cursor and other MCP clients work with Cgm MCP directly. A Model Context Protocol (MCP) server implementation of CodeFuse-CGM (Code Graph Model), providing graph-integrated large language model capabilities for repository-level software engineering tasks.

What Cgm MCP does

A Model Context Protocol (MCP) server implementation of CodeFuse-CGM (Code Graph Model), providing graph-integrated large language model capabilities for repository-level software engineering tasks.

Tools it exposes

Once connected, the assistant can call these 14 tools directly:

  • repository_path — Path to the repository
  • query — Search query for relevant code
  • analysis_scope — Scope of analysis (full, focused, minimal)
  • max_files — Maximum number of files to analyze
  • file_paths — List of file paths to analyze
  • entity_name — Name of the entity to find relations for
  • relation_types — Types of relations to include (optional)
  • format — Output format (structured, markdown, prompt)
  • task_type — Type of task (issue_resolution, code_analysis, bug_fixing, feature_implementation)
  • repository_name — Name of the repository
  • issue_description — Description of the issue
  • repository_context — Optional repository context
  • Prerequisites — The Prerequisites tool exposed by this server
  • cgm_get_task_status — The cgm_get_task_status tool exposed by this server

Installing the cgm mcp mcp server

The server is distributed via PyPI as torch, so most clients can run it without a manual build step. Add it to your MCP client's configuration and restart the client to pick it up — the copy-paste configs for Claude Desktop, Claude Code and Cursor are on this page.

Configuration

Before the server will start you need to supply 8 environment variables: CGM_LLM_API_KEY, CGM_LLM_PROVIDER, CGM_LLM_MODEL, CGM_USE_GPU, CGM_GPU_BATCH_SIZE, CGM_SIMILARITY_THRESHOLD, CGM_CACHE_EMBEDDINGS, CGM_MAX_CACHE_SIZE. Keep credentials in your client's env block or a secrets manager rather than committing them.

Requirements

  • Python 3.8+ - pip or conda

Where it fits

Developer-tool servers are usually the first ones people connect, because they turn "help me with this code" into an assistant that can actually read the repo and act on it. Cgm MCP sits in that group, and the shape of its toolset — repository_path, query, analysis_scope among others — tells you what it is really for. Worth comparing against the other developer tools servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.

Practical notes

  • This server runs locally, so it operates with whatever access your machine and its credentials already have. Scope that deliberately rather than by default.
  • It will not start until its required credentials are present, so set those before wondering why the tools never appear.
  • With 14 tools exposed, expect a noticeable bump in prompt size — disable it in projects that never use Cgm MCP.
  • Maintained by yangweijie, written in Python.
  • MCP clients ask for confirmation before each tool call by default. Keep that on while you learn what the cgm mcp mcp server actually does with your data.
  • Every entry in this directory is reviewed by hand before it goes live, and details are checked against the project's own documentation.

Available tools

ToolWhat it does
repository_pathPath to the repository
querySearch query for relevant code
analysis_scopeScope of analysis (full, focused, minimal)
max_filesMaximum number of files to analyze
file_pathsList of file paths to analyze
entity_nameName of the entity to find relations for
relation_typesTypes of relations to include (optional)
formatOutput format (structured, markdown, prompt)
task_typeType of task (issue_resolution, code_analysis, bug_fixing, feature_implementation)
repository_nameName of the repository
issue_descriptionDescription of the issue
repository_contextOptional repository context
PrerequisitesThe Prerequisites tool exposed by this server.
cgm_get_task_statusThe cgm_get_task_status tool exposed by this server.

How to install the Cgm MCP MCP server

{
  "mcpServers": {
    "cgm": {
      "command": "uvx",
      "args": ["torch"],
      "env": {
        "CGM_LLM_API_KEY": "your-value",
        "CGM_LLM_PROVIDER": "your-value",
        "CGM_LLM_MODEL": "your-value",
        "CGM_USE_GPU": "your-value",
        "CGM_GPU_BATCH_SIZE": "your-value",
        "CGM_SIMILARITY_THRESHOLD": "your-value",
        "CGM_CACHE_EMBEDDINGS": "your-value",
        "CGM_MAX_CACHE_SIZE": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Python 3.8+ - pip or conda
VariableDescriptionRequired
CGM_LLM_API_KEYCredential the server authenticates with.Yes
CGM_LLM_PROVIDERConfiguration value read at startup.Optional
CGM_LLM_MODELConfiguration value read at startup.Optional
CGM_USE_GPUConfiguration value read at startup.Optional
CGM_GPU_BATCH_SIZEConfiguration value read at startup.Optional
CGM_SIMILARITY_THRESHOLDConfiguration value read at startup.Optional
CGM_CACHE_EMBEDDINGSConfiguration value read at startup.Optional
CGM_MAX_CACHE_SIZEConfiguration value read at startup.Optional

Example prompts to try

  • Use Cgm MCP to repository path.
  • Use Cgm MCP to query.
  • Use Cgm MCP to analysis scope.

Frequently asked questions

It connects Cgm MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (repository_path, query, analysis_scope, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Cgm MCP directly.