Skip to main content
Glama

codefactor-mcp

Node.js MCP CodeFactor

English | 简体中文

codefactor-mcp is a local MCP server for reading CodeFactor repository issue pages.

✨ Features

  • Parse CodeFactor issues: extracts issue data from the embedded model in CodeFactor pages

  • Normalize issue details: outputs file paths, categories, severity, metrics, line ranges, preview code, and recommendations

  • Generate summaries: converts CodeFactor issues into Markdown for quick reading

Related MCP server: code-health-mcp

🚀 Quick Start

Prerequisites

  • Node.js 20+

  • A CodeFactor repository issues URL, for example:

https://www.codefactor.io/repository/github/5656565566/aylink.extra/issues

If the CodeFactor page requires a logged-in session, you also need a browser Cookie header.

Install And Build

Clone the project:

git clone https://github.com/5656565566/codefactor_mcp.git

Then run:

cd codefactor_mcp
npm install
npm run build

The built MCP entry point is:

codefactor_mcp\dist\index.js

In the examples below, replace <CODEFACTOR_MCP_DIR> with the actual install directory of your local codefactor-mcp project.

⚙️ Codex Configuration

Codex uses:

%USERPROFILE%\.codex\config.toml

After changing this file, restart Codex or open a new session.

Option 1: Let AI Choose The Repository

Use this when you want the AI to pass the CodeFactor repository URL for each task:

[mcp_servers.codefactor]
command = 'node'
args = ['<CODEFACTOR_MCP_DIR>\dist\index.js']
startup_timeout_sec = 30

Then provide the repository URL in your request:

请使用 codefactor MCP 检查这个仓库,并在修改代码时遵守它的代码建议:
https://www.codefactor.io/repository/github/5656565566/aylink.extra/issues

You can also ask the AI to inspect the current Git remote and derive the CodeFactor URL:

请根据当前仓库 remote 推导 CodeFactor issues 地址,然后调用 codefactor MCP 获取建议。

Option 2: Configure A Default Repository

Use this when most tasks target the same repository:

[mcp_servers.codefactor]
command = 'node'
args = ['<CODEFACTOR_MCP_DIR>\dist\index.js']
startup_timeout_sec = 30

[mcp_servers.codefactor.env]
CODEFACTOR_REPOSITORY_URL = 'https://www.codefactor.io/repository/github/5656565566/aylink.extra/issues'

Tool behavior:

  • If url is not provided, the tool uses CODEFACTOR_REPOSITORY_URL

  • If url is provided, the tool uses that URL for the current call

Use this only when CodeFactor requires a logged-in browser session:

[mcp_servers.codefactor]
command = 'node'
args = ['<CODEFACTOR_MCP_DIR>\dist\index.js']
startup_timeout_sec = 30

[mcp_servers.codefactor.env]
CODEFACTOR_REPOSITORY_URL = 'https://www.codefactor.io/repository/github/5656565566/aylink.extra/issues'
CODEFACTOR_COOKIE = 'paste browser Cookie header here'

Notes:

  • Do not commit CODEFACTOR_COOKIE

  • Do not share cookies with untrusted AI clients or third-party services

  • Cookies may expire and need to be refreshed

🔌 Other Platform Configuration

Different MCP clients use different config file locations and root fields. All examples below use this built entry point:

<CODEFACTOR_MCP_DIR>\dist\index.js

If you want the AI to choose the repository, remove env from the examples and pass url when calling the tool.

Claude Code

Install globally for the current user:

claude mcp add --scope user codefactor -- node <CODEFACTOR_MCP_DIR>\dist\index.js

For project-scoped shared configuration, create .mcp.json in the project root:

{
  "mcpServers": {
    "codefactor": {
      "type": "stdio",
      "command": "node",
      "args": [
        "<CODEFACTOR_MCP_DIR>\\dist\\index.js"
      ],
      "env": {
        "CODEFACTOR_REPOSITORY_URL": "https://www.codefactor.io/repository/github/5656565566/aylink.extra/issues"
      }
    }
  }
}

After starting Claude Code, use /mcp to check the connection.

Claude Desktop

Common config file locations:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Example:

{
  "mcpServers": {
    "codefactor": {
      "command": "node",
      "args": [
        "<CODEFACTOR_MCP_DIR>\\dist\\index.js"
      ],
      "env": {
        "CODEFACTOR_REPOSITORY_URL": "https://www.codefactor.io/repository/github/5656565566/aylink.extra/issues"
      }
    }
  }
}

Save the file, then fully quit and reopen Claude Desktop.

Cursor

Common configuration options:

  • Global: ~/.cursor/mcp.json

  • Project-level: .cursor/mcp.json in the project root

  • You can also add it from Cursor's MCP / Tools settings page

Example:

{
  "mcpServers": {
    "codefactor": {
      "command": "node",
      "args": [
        "<CODEFACTOR_MCP_DIR>\\dist\\index.js"
      ],
      "env": {
        "CODEFACTOR_REPOSITORY_URL": "https://www.codefactor.io/repository/github/5656565566/aylink.extra/issues"
      }
    }
  }
}

After adding it, refresh the MCP / Tools page or restart the Cursor window.

VS Code / GitHub Copilot

VS Code uses servers as the root field, not mcpServers.

Common config locations:

  • Workspace: .vscode/mcp.json

  • User-level: run MCP: Open User Configuration from the Command Palette

Example:

{
  "servers": {
    "codefactor": {
      "command": "node",
      "args": [
        "<CODEFACTOR_MCP_DIR>\\dist\\index.js"
      ],
      "env": {
        "CODEFACTOR_REPOSITORY_URL": "https://www.codefactor.io/repository/github/5656565566/aylink.extra/issues"
      }
    }
  }
}

To share the configuration with a team, prefer the workspace .vscode/mcp.json file.

Windsurf / Cascade

Common configuration options:

  • Add from Settings > Tools > Windsurf Settings > Add Server

  • Or click View Raw Config and edit mcp_config.json

Common config file locations:

  • Windows: %APPDATA%\Codeium\Windsurf\mcp_config.json

  • macOS / Linux: ~/.codeium/windsurf/mcp_config.json

Example:

{
  "mcpServers": {
    "codefactor": {
      "command": "node",
      "args": [
        "<CODEFACTOR_MCP_DIR>\\dist\\index.js"
      ],
      "env": {
        "CODEFACTOR_REPOSITORY_URL": "https://www.codefactor.io/repository/github/5656565566/aylink.extra/issues"
      }
    }
  }
}

After adding it, refresh the MCP plugin list or restart Windsurf.

Generic JSON MCP Clients

If a client uses the standard mcpServers layout, use:

{
  "mcpServers": {
    "codefactor": {
      "type": "stdio",
      "command": "node",
      "args": [
        "<CODEFACTOR_MCP_DIR>\\dist\\index.js"
      ],
      "env": {
        "CODEFACTOR_REPOSITORY_URL": "https://www.codefactor.io/repository/github/5656565566/aylink.extra/issues"
      }
    }
  }
}

If the client does not support the type field, remove "type": "stdio".

🧰 MCP Tools

fetch_codefactor_issues

Fetches issues from https://www.codefactor.io and returns normalized JSON.

Common arguments:

Argument

Description

url

CodeFactor repository or issues URL; falls back to CODEFACTOR_REPOSITORY_URL

cookie

Optional Cookie header; falls back to CODEFACTOR_COOKIE

allPages

Whether to fetch multiple issue pages

maxPages

Maximum pages to fetch when allPages is true

category

Filter by category, such as Complexity

filePathIncludes

Filter by file path text

maxIssues

Limit the number of returned issues

includeHidden

Include hidden issues; defaults to false

summarize_codefactor_issues

Returns a compact Markdown summary. This is useful before code review or refactoring work.

build_codefactor_prompt

Builds an AI-facing prompt from CodeFactor issues. This is the recommended tool before asking an AI agent to edit code.

The generated prompt asks the AI to:

  • Prefer CodeFactor issues within the current scope

  • For complexity issues, extract functions, name intermediate concepts, and decompose conditionals

  • For duplication issues, extract shared logic

  • For maintainability issues, remove truly unused code or duplicate selectors

  • Preserve the project's existing comment style

  • Run relevant validation and report coverage

parse_codefactor_html

Parses a raw HTML string. Use this when you already have the CodeFactor page response from browser DevTools or curl.

🧭 MCP Prompt

The server exposes one prompt:

follow-codefactor-advice

It asks the AI to read CodeFactor issues before editing code and keep the fix scoped and maintainable.

📌 Usage Examples

Use The Default Repository

先调用 codefactor MCP 生成代码建议提示,然后按提示修复当前问题。

Use A Specific Repository

请对这个仓库调用 codefactor MCP,并在修改代码时遵守建议:
https://www.codefactor.io/repository/github/5656565566/aylink.extra/issues

Focus On Complexity

{
  "url": "https://www.codefactor.io/repository/github/5656565566/aylink.extra/issues",
  "category": "Complexity",
  "allPages": true,
  "maxPages": 4,
  "maxIssues": 20
}

Focus On One Module

{
  "filePathIncludes": "AYLink.Web/src/features/screencast",
  "allPages": true,
  "maxPages": 4,
  "maxIssues": 20
}

Parse Pasted HTML

{
  "html": "<!DOCTYPE html>..."
}

🛠️ Development And Verification

npm run build
npm test
npm run typecheck

You can also run MCP discovery with a client. The server should expose these tools:

  • parse_codefactor_html

  • fetch_codefactor_issues

  • build_codefactor_prompt

  • summarize_codefactor_issues

And this prompt:

  • follow-codefactor-advice

📄 Notes

  • Repository URLs may omit /issues; the server appends it automatically

  • CodeFactor issue pages may be paginated; use allPages: true when full context is needed

  • Public repositories usually do not need cookies

  • Private or logged-in pages may need CODEFACTOR_COOKIE

Available Tools

4 tools
build_codefactor_promptBuild CodeFactor PromptC

Build an AI-facing prompt that asks the model to follow CodeFactor suggestions while editing code.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlNoCodeFactor repository or issues URL.
htmlNoRaw CodeFactor issues HTML. If omitted, url or CODEFACTOR_REPOSITORY_URL is used.
cookieNoOptional CodeFactor Cookie header. Falls back to CODEFACTOR_COOKIE.
allPagesNoFetch all issue pages up to maxPages when using url.
categoryNoOnly include one CodeFactor category, for example Complexity.
maxPagesNoMaximum pages to fetch when allPages is true.
maxIssuesNoMaximum number of issues returned.
includeHiddenNoInclude hidden CodeFactor issues. Defaults to false.
filePathIncludesNoOnly include issues whose file path contains this text.

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavior. It only states the output is a prompt, but does not explain how it uses the URL, HTML, or other parameters. There is no mention of side effects, data fetching, or any disclaimers.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence, front-loaded with the verb and resource. No wasted words, but could benefit from slightly more detail without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and 9 parameters, the description is too brief. It does not explain the prompt structure, how parameters affect output, or the interaction between url and html. This leaves agents with insufficient context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so each parameter already has a description. The tool description adds no extra meaning beyond what the schema provides, meeting the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description has a specific verb 'Build' and resource 'AI-facing prompt', clarifying the output. It distinguishes from sibling tools like 'fetch_codefactor_issues' which fetch raw data, and 'summarize_codefactor_issues' which presumably produce summaries. However, 'AI-facing prompt' is somewhat ambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus siblings. The description does not indicate prerequisites, such as needing to fetch issues first, or when a prompt is needed instead of raw issues.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

fetch_codefactor_issuesFetch CodeFactor IssuesB

Fetch CodeFactor repository issues from codefactor.io and return normalized issue data.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlNoCodeFactor repository or issues URL. Falls back to CODEFACTOR_REPOSITORY_URL.
cookieNoOptional CodeFactor Cookie header. Falls back to CODEFACTOR_COOKIE.
allPagesNoFetch all issue pages up to maxPages.
categoryNoOnly include one CodeFactor category, for example Complexity.
maxPagesNoMaximum pages to fetch when allPages is true.
maxIssuesNoMaximum number of issues returned.
includeHiddenNoInclude hidden CodeFactor issues. Defaults to false.
filePathIncludesNoOnly include issues whose file path contains this text.

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavior, but it only mentions fetching and normalization. It omits authentication, rate limits, error handling, pagination, and other behavioral traits, leaving significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence, front-loaded with the core action. It is efficient but could be slightly more informative without becoming verbose, hence a 4.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With eight parameters, no output schema, and no annotations, the description is insufficient. It fails to explain how parameters interact (e.g., maxPages with allPages), what 'normalized issue data' means, or provide an overall workflow context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so the baseline is 3. The description adds no extra parameter context beyond the schema, which already documents all eight parameters with descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Fetch', the resource 'CodeFactor repository issues', and includes 'normalized issue data', distinguishing it from sibling tools like build_codefactor_prompt, parse_codefactor_html, and summarize_codefactor_issues.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage as a fetch tool but provides no explicit guidance on when to use it versus alternatives, nor does it mention prerequisites or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

parse_codefactor_htmlParse CodeFactor HTMLB

Parse a CodeFactor repository issues HTML response and return normalized issues.

ParametersJSON Schema
NameRequiredDescriptionDefault
htmlYesRaw HTML from a CodeFactor issues page.
categoryNoOnly include one CodeFactor category, for example Complexity.
maxIssuesNoMaximum number of issues returned.
includeHiddenNoInclude hidden CodeFactor issues. Defaults to false.
filePathIncludesNoOnly include issues whose file path contains this text.

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full responsibility. It only says 'parse and return normalized issues' without disclosing behavior like input validation, error handling, side effects, or output format details (e.g., what 'normalized' means).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with 12 words, very concise. It is front-loaded with the primary action. However, it could benefit from slightly more structure (e.g., mentioning output or usage hint).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 5 parameters, no output schema, and no annotations, the description is too sparse. It omits return value details, error scenarios, and how to effectively use optional filters like category or filePathIncludes. Inadequate for a tool of this complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description does not add extra meaning beyond the schema. It does not explain how parameters like category affect output or the relationship between input and output.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action ('Parse') and resource ('CodeFactor repository issues HTML response'), with a specific output ('return normalized issues'). It distinguishes from siblings like fetch_codefactor_issues (fetching) and summarize_codefactor_issues (summarizing).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives (e.g., after fetch_codefactor_issues, before summarize_codefactor_issues). No explicit context or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

summarize_codefactor_issuesSummarize CodeFactor IssuesC

Return a compact Markdown summary of CodeFactor issues for quick context.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlNoCodeFactor repository or issues URL.
htmlNoRaw CodeFactor issues HTML. If omitted, url or CODEFACTOR_REPOSITORY_URL is used.
cookieNoOptional CodeFactor Cookie header. Falls back to CODEFACTOR_COOKIE.
allPagesNoFetch all issue pages up to maxPages when using url.
categoryNoOnly include one CodeFactor category, for example Complexity.
maxPagesNoMaximum pages to fetch when allPages is true.
maxIssuesNoMaximum number of issues returned.
includeHiddenNoInclude hidden CodeFactor issues. Defaults to false.
filePathIncludesNoOnly include issues whose file path contains this text.

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description does not disclose behavioral traits such as network requests, authentication needs (cookie), or the impact of parameters like allPages or maxPages. It only states the output format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is front-loaded and to the point. It is concise, though it could be slightly expanded to improve clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (9 parameters, no output schema, no annotations), the description is incomplete. It does not explain the return structure or how parameters influence the summary, leaving agents with insufficient context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% parameter description coverage, so the schema itself explains each parameter. The tool description adds no additional semantic value beyond 'compact Markdown summary', which is adequate but not enhanced.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly indicates the tool returns a compact Markdown summary of CodeFactor issues, distinguishing it from sibling tools that fetch raw data or parse HTML. However, it could be more specific about the nature of the summary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like fetch_codefactor_issues or parse_codefactor_html. It lacks explicit context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.5/5.0
Disambiguation5/5

Each tool serves a distinct purpose: building a prompt, fetching issues, parsing HTML, and summarizing. No overlap in functionality.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (build_, fetch_, parse_, summarize_) with clear domain context.

Tool Count5/5

4 tools is an appropriate size for a focused server providing CodeFactor issue access and summarization without being too sparse or overwhelming.

Completeness4/5

Covers key operations: fetching, parsing, summarizing issues, and generating a prompt. Minor gap: no tool to act on issues directly, but prompt builder handles that indirectly.

Maintenance

ActivitySlowing
ResponsivenessSyncing

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

Related MCP Servers

Latest Blog Posts

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/5656565566/codefactor_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server