# Code Refactor

> Refactor legacy code into modern, idiomatic code without changing its behavior.

- name: io.github.zhouhengchang/code-refactor
- version: 1.0.4
- connection class: R0 (autonomous)
- trust: 97/100
- quality: 73/100 (new)
- owner: not claimed
- descriptor: https://api.protogrid.dev/v1/servers/io.github.zhouhengchang%2Fcode-refactor
- tools: https://api.protogrid.dev/v1/servers/io.github.zhouhengchang%2Fcode-refactor/tools

**An agent can connect right now, no human step.** Remote endpoint, no authentication, reachable on the last probe.

## Connection (mcpServers)

```json
{
  "mcpServers": {
    "code-refactor": {
      "type": "http",
      "url": "https://code-refactor-api.app.workbuddy.host/mcp"
    }
  }
}
```


## Trust

- hygiene: 100
- liveness: 100
- freshness: 100
- provenance: 90
- drivers: +repository +namespace-matches-repo +website +reachable +uptime-100% +updated-2d-ago
- Derived from observable signals (official registry feed and our own credential-free probes); no code audit performed.

## Quality 73/100 (new)

### protocol: 75 (weight 25)

- warn `protocol.modern`: newest supported version is 2025-06-18; 2026-07-28 not supported, older versions are deprecated until 2027-07-28
- n/a `protocol.stateless`: only applies to 2026-07-28 servers
- pass `protocol.transport`: streamable HTTP
- n/a `protocol.list_ttl`: only applies to 2026-07-28 servers

### authorization: n/a (weight 15)

- n/a `auth.prm`, `auth.as_metadata`, `auth.cimd`: no remote uses OAuth
- n/a `auth.secret_in_url`: no templated URL

### tool hygiene: 71 (weight 30)

- pass `tools.descriptions`: every tool has a description
- pass `tools.description_length`: descriptions are concise
- pass `tools.schemas`: every tool has an object input schema
- fail `tools.annotations`: no tool declares readOnlyHint or destructiveHint, so clients cannot tell safe calls from risky ones
- fail `tools.directory_hints`: no tool declares all four of readOnlyHint, destructiveHint, idempotentHint and openWorldHint; missing: refactor_code (readOnlyHint, destructiveHint, idempotentHint, openWorldHint); check_status (readOnlyHint, destructiveHint, idempotentHint, openWorldHint)
- pass `tools.token_cost`: about 140 tokens to load every tool
- pass `tools.api_dump`: tools are not a one-to-one API dump

### stability: n/a (weight 15)

- n/a `stability.changes`, `stability.rug_pull`: tool history recorded for 2 of the 7 days needed

### dependencies: n/a (weight 15)

- n/a `deps.known_vulns`, `deps.mcp_sdk_version`, `deps.resolvable`: deps.dev does not know workbuddy-code-refactor-connector@1.0.4

- tools: 2, about 140 tokens to load them all
- tool set hash: bf4526996d7cdb9bb08bc57dd45f1d30
- badge: [![protogrid quality](https://protogrid.dev/badge/io.github.zhouhengchang/code-refactor.svg)](https://protogrid.dev/servers/io.github.zhouhengchang/code-refactor)
- Checks run on what our credential-free, read-only probes observe; tools are never called and no code audit is performed.

### Tool changes

_No tool definition changes recorded._

## Dependencies

- npm workbuddy-code-refactor-connector@1.0.4: unknown

Dependency graphs from deps.dev; advisories from OSV.dev, including the GitHub Advisory Database and the PyPI Advisory Database; all CC BY 4.0.

## Remotes

- https://code-refactor-api.app.workbuddy.host/mcp (streamable-http, auth none, reachable true, uptime30d 1)

## Packages

- npm workbuddy-code-refactor-connector@1.0.4 secrets: OPENAI_API_KEY

## Tools (2)

- `check_status`: 检查重构服务与云端模型（DeepSeek）是否可用，返回后端类型、模型名与密钥校验状态。建议在调用 refactor_code 前先调用本工具。
- `refactor_code`: 把遗留代码重构为现代规范代码，行为保持不变。会做语义化重命名、补全类型标注、生成中文注释、优化结构。适用于 Python / JavaScript / TypeScript / Java / Go / Rust / C / C++。
