Coding Guides

io.github.delian由 GitHub 帳號 delian 發布v0.1.0更新於 Oct 24, 2026

Coding guidelines and best-practice guides for 130+ languages, frameworks, and tools.

已驗證Streamable HTTP可網頁執行知識與記憶開發者工具

概覽

AI 產生的概覽

提供 130 多種語言、框架與工具的程式碼規範與最佳實務指南,讓助理在寫程式時查閱風格規則。

可以做什麼
  • 依名稱取得某份程式碼指南的完整內容
  • 列出可用指南,並以 MCP 資源形式讀取
  • 從 GitHub 儲存庫或本機 Markdown 目錄載入指南,支援本機快取與離線備援
適用情境
希望助理在開發過程中遵循專案或語言的程式碼慣例時使用,可作為貼上或維護 AGENTS.md 檔案的結構化替代方案。
執行需求
可使用公開的遠端 Streamable HTTP 端點(無需憑證),也可用 Python 搭配 mcp SDK 在本機執行,或透過 Docker 映像以 stdio 執行。可透過 GUIDES_GITHUB_REPO、GUIDES_DIR、GUIDES_CACHE_DIR 等變數進行選用設定;僅在從 GitHub 取得指南時需要網路。
安裝前請注意
參考用的遠端部署是公開且未驗證身分的,任何人都能呼叫;其 clear_cache 提示對任何呼叫者開放,且流量會產生託管費用。從 GitHub 取得指南受未驗證 API 每小時每 IP 60 次請求的限制,超過後伺服器會默默退回快取或內建檔案。此伺服器被描述為唯讀。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Coding Guides,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.delian%2Fcodeguide-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "coding-guides": {
      "type": "http",
      "url": "https://codeguide-mcp-86057491046.europe-west1.run.app/mcp"
    }
  }
}

README

Coding Guides MCP Server

A Model Context Protocol (MCP) server that provides access to coding guides and best practices for AI assistants like Claude and GitHub Copilot.

What is this?

This MCP server exposes coding guidelines and style guides as resources that can be accessed by MCP clients. It's designed to extend or replace AGENTS.md files by providing a structured way to serve coding practices and guidelines to AI assistants during development.

Features

  • Resource-based API: Exposes coding guides through MCP resources
  • GitHub integration: Loads guides from GitHub repositories over the web
  • Automatic caching: Caches downloaded guides locally for offline access
  • Fallback support: Uses local cache or directory when network is unavailable
  • Simple file-based storage: Guides can be stored as Markdown files locally
  • Official MCP SDK: Built on the Python mcp SDK (MCPServer, formerly FastMCP)
  • Easy integration: Works with any MCP-compatible client (Claude Desktop, Cline, etc.)

Available Resources

  • guides://list - Lists all available coding guides
  • guides://{guide_name} - Retrieves the content of a specific guide (e.g., guides://python.md)

Installation

From Source

bash
# Clone the repositorygit clone https://github.com/delian/codeguide-mcp.gitcd codeguide-mcp
# Install with uv (recommended)uv sync
# Or with pippip install -e .

With Docker

bash
docker build -t codeguide-mcp .docker run -i codeguide-mcp

In VS Code

[Install in VS Code]

Or search for codeguide-mcp in the Extensions view MCP servers list (type @mcp in the Extensions search bar), or add it manually to .vscode/mcp.json:

json
{  "servers": {    "codeguide-mcp": {      "command": "docker",      "args": ["run", "-i", "--rm", "delian/codeguide-mcp"]    }  }}

Configuration

Configure the server by creating a config.toml file or setting environment variables:

GitHub Configuration (Recommended)

To load guides from a GitHub repository:

toml
github_repo = "owner/repository"  # e.g., "delian/codeguide-mcp"github_path = "guides"            # Path to guides directory in repogithub_branch = "main"            # Branch to fetch from  cache_dir = ".guides-cache"       # Local cache directorylog_level = "INFO"

Local Directory Configuration

To use local guides only:

toml
guides_dir = "guides"log_level = "INFO"

Environment Variables

  • GUIDES_GITHUB_REPO - GitHub repository (format: owner/repo)
  • GUIDES_GITHUB_PATH - Path to guides directory in repository (default: guides)
  • GUIDES_GITHUB_BRANCH - Branch to fetch from (default: main)
  • GUIDES_CACHE_DIR - Local cache directory (default: .guides-cache)
  • GUIDES_DIR - Local directory containing guide files (default: guides)
  • GUIDES_LOG_LEVEL - Logging level (default: INFO)

Transport (see Remote deployment):

  • GUIDES_TRANSPORT - stdio, streamable-http, or auto (default: auto — HTTP when a PORT env var is present, stdio otherwise)
  • PORT - Port to listen on in HTTP mode; takes precedence over GUIDES_PORT (Cloud Run injects this)
  • GUIDES_HOST - Bind address in HTTP mode (default: 0.0.0.0)
  • GUIDES_HTTP_PATH - MCP endpoint path (default: /mcp)
  • GUIDES_STATELESS_HTTP - Handle each request independently (default: true; required when replicas autoscale)
  • GUIDES_ALLOWED_HOSTS - Host header allowlist enabling DNS-rebinding protection (default: empty = no Host validation)

Behavior

  1. Network available + GitHub configured: Fetches guides from GitHub and caches them locally
  2. Network unavailable: Uses local cache if available
  3. No cache available: Falls back to local guides_dir if configured

Remote deployment (Google Cloud Run)

The same image serves both transports: it speaks stdio over a pipe by default, and switches to Streamable HTTP when a PORT env var is present — which Cloud Run always injects. No separate image or entrypoint is needed.

1. Publish the image

bash
docker build -t delian/codeguide-mcp:0.1.0 -t delian/codeguide-mcp:latest .docker push delian/codeguide-mcp:0.1.0docker push delian/codeguide-mcp:latest

2. Deploy

bash
gcloud run deploy codeguide-mcp \  --image=docker.io/delian/codeguide-mcp:0.1.0 \  --region=europe-west1 \  --allow-unauthenticated \  --port=8080 \  --set-env-vars=GUIDES_TRANSPORT=streamable-http,GUIDES_GITHUB_REPO= \  --memory=512Mi --cpu=1 \  --min-instances=0 --max-instances=4 --concurrency=40

GUIDES_GITHUB_REPO= (empty) makes the service serve the guides baked into the image. Leaving GitHub enabled adds a network round-trip per guide and runs into the unauthenticated GitHub API limit of 60 requests/hour per egress IP, after which the server silently falls back to those same baked-in files anyway.

The MCP endpoint is then https://<service-url>/mcp:

bash
gcloud run services describe codeguide-mcp --region=europe-west1 \  --format='value(status.url)'

Cloud Run answers on two hostnames for the same service — the SERVICE-PROJECTNUMBER.REGION.run.app form printed by gcloud run deploy, and the older SERVICE-HASH-REGIONCODE.a.run.app form that status.url reports. Both are equivalent; either works in a client config.

3. Point clients at it

See Connecting to a remote server below for the per-client configuration.

Pulling from Docker Hub

Cloud Run deploys public Docker Hub images directly, but caches them for only an hour and re-pulls anonymously afterwards, so a scale-up can hit Docker Hub's anonymous pull limits and fail to start instances. For anything beyond casual use, mirror through an Artifact Registry remote repository:

bash
gcloud artifacts repositories create dockerhub \  --repository-format=docker --location=europe-west1 \  --mode=remote-repository --remote-docker-repo=DOCKER-HUB
gcloud run deploy codeguide-mcp \  --image=europe-west1-docker.pkg.dev/PROJECT_ID/dockerhub/delian/codeguide-mcp:0.1.0 \  ...

Notes on running it publicly

  • --allow-unauthenticated makes the endpoint world-callable. The server is read-only, but the clear_cache prompt is reachable by any caller and drops the in-memory caches, and traffic drives autoscaling cost — keep --max-instances capped. To restrict access, omit the flag and have clients send an identity token, or front the service with Cloud Armor / API Gateway.
  • GUIDES_STATELESS_HTTP must stay true unless you also enable session affinity, since Cloud Run may route a session's requests to different instances.
  • GET / returns 404 by design; only /mcp is served. Cloud Run's default startup probe is a TCP check on $PORT, so this is fine — don't configure an HTTP health check on /.
  • Set GUIDES_ALLOWED_HOSTS to your service hostname to enable Host-header validation if you expose the service under a custom domain.

Publishing to the MCP Registry

The MCP servers list in the VS Code Extensions view (type @mcp in the search bar) is fed by the GitHub MCP Registry, which ingests from the official MCP Registry. Publishing there is therefore how this server becomes discoverable in VS Code — no VS Code extension of its own is required.

server.json holds the registry metadata: the Docker image for clients that want to run it locally, and the hosted URL for clients that would rather not. Ownership of the image is proven by the io.modelcontextprotocol.server.name label in the Dockerfile, whose value must equal .name in server.json.

Authenticate once (an interactive device-code flow), then run the publish script:

bash
mcp-publisher login github     # namespace io.github.<your-username>/*tools/publish.sh

tools/publish.sh does the whole release: it checks the required tooling and Docker login, verifies that server.json and pyproject.toml agree on the version and that the Dockerfile label matches the server name, builds and pushes :VERSION and :latest, validates server.json against the live registry, publishes, then reads the entry back to confirm.

bash
tools/publish.sh --dry-run          # everything except push and publishtools/publish.sh --version 0.2.0    # bump server.json + pyproject + image tag, then releasetools/publish.sh --skip-build       # reuse images already on Docker Hub

Install mcp-publisher from the registry quickstart if you do not have it. After publishing, inclusion in GitHub's curated list may need a request to [email protected].

Adding Guides

Using GitHub (Recommended)

If you've configured github_repo, simply add Markdown files to the specified directory in your GitHub repository. The server will automatically fetch and cache them.

Using Local Directory

Add Markdown files to the guides/ directory. Each file will be automatically available as a resource.

Example:

bash
echo "# Python Style Guide\n\nUse PEP 8..." > guides/python.md

Usage with MCP Clients

The server can be consumed two ways:

ModeTransportHow the client reaches it
LocalstdioClient spawns python main.py or docker run -i and talks over a pipe
RemoteStreamable HTTPClient makes HTTPS requests to a hosted …/mcp URL

Local mode needs no network and no hosting; remote mode lets a team share one deployment and keeps the guides identical for everyone.

Connecting to a remote server

A deployed instance exposes its MCP endpoint at /mcp. The snippets below use the reference deployment:

https://codeguide-mcp-86057491046.europe-west1.run.app/mcp

It is public and needs no credentials. Substitute your own URL if you run the service yourself — see Remote deployment.

VS Code — .vscode/mcp.json for one workspace, or your user mcp.json for every workspace:

json
{  "servers": {    "codeguide-mcp": {      "type": "http",      "url": "https://codeguide-mcp-86057491046.europe-west1.run.app/mcp"    }  }}

Claude Code:

bash
claude mcp add --transport http codeguide-mcp \  https://codeguide-mcp-86057491046.europe-west1.run.app/mcp

Cursor — ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project):

json
{  "mcpServers": {    "codeguide-mcp": {      "url": "https://codeguide-mcp-86057491046.europe-west1.run.app/mcp"    }  }}

Claude Desktop — add it as a custom connector in Settings, or bridge the remote endpoint into a stdio client with mcp-remote:

json
{  "mcpServers": {    "codeguide-mcp": {      "command": "npx",      "args": ["-y", "mcp-remote", "https://codeguide-mcp-86057491046.europe-west1.run.app/mcp"]    }  }}

Any client that speaks Streamable HTTP works — point it at the /mcp URL. For servers behind authentication, pass a token with --header "Authorization: Bearer $(gcloud auth print-identity-token)" (Claude Code) or the client's equivalent headers block.

Verifying a remote endpoint

A single curl confirms a deployment is live and public:

bash
curl -s -X POST https://codeguide-mcp-86057491046.europe-west1.run.app/mcp \  -H 'Content-Type: application/json' \  -H 'Accept: application/json, text/event-stream' \  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{       "protocolVersion":"2025-06-18","capabilities":{},       "clientInfo":{"name":"curl","version":"1"}}}'

A healthy server replies with an SSE event: message frame containing its capabilities and instructions. Note that GET / returns 404 by design — only /mcp is served.

To exercise every resource, tool, and prompt over HTTP instead:

bash
uv run python verify_server.py --http https://codeguide-mcp-86057491046.europe-west1.run.app/mcp

Local usage

Claude Desktop

Add to your mcp.json:

json
{  "mcpServers": {    "coding-guides": {      "command": "python",      "args": ["-m", "main"]    }  }}

or

json
{  "mcpServers": {    "coding-guides": {      "command": "docker",      "args": ["run", "--rm", "-i", "docker.io/delian/codeguide-mcp"]    }  }}

Other MCP Clients

Run the server and connect via stdio:

bash
python main.py

Development

bash
# Install development dependenciesuv pip install -e ".[dev]"
# Run pre-commit hookspre-commit installpre-commit run --all-files
# Run the serverpython main.py

License

MIT

Contributing

Contributions welcome! Please open an issue or pull request.

來源:README.md,提交 ffc9927

工具

1

get_guide

Get the content of a specific coding guide.

輸入參數guide_name必填

版本歷史

1
  1. v0.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。