Skip to main content
Glama
ericmusa-ibm-public

erm-github-mcp

erm-github-mcp

一个用 TypeScript 编写的极简 Model Context Protocol (MCP) 服务器。设计为从源码构建、使用 Docker 容器化,并部署到 IBM Code Engine。


目录


Related MCP server: My Awesome MCP

概述

该服务器支持两种传输方式:

传输方式

使用场景

激活方式

stdio

本地开发 / Bob 桌面端

默认(无需设置环境变量)

HTTP Streamable

Docker / Code Engine

MCP_TRANSPORT=http

HTTP 传输方式在 GET /health 上暴露了一个 /health 端点,用于存活探针。


项目结构

.
├── src/
│   └── index.ts          # Server entry point — add tools here
├── build/                # Compiled output (git-ignored)
├── .github/
│   └── workflows/
│       └── build-push.yml  # CI: typecheck → build → push to GHCR
├── Dockerfile            # Multi-stage build (builder + runtime)
├── docker-compose.yml    # Local container testing
├── tsconfig.json
└── package.json

工具

工具

描述

ping

健康检查 — 返回 pong,并回显一条可选消息

get_server_info

返回服务器名称、版本、传输方式、Node 版本和运行时长


本地开发

前置条件

  • Node.js 20+

  • npm 10+

安装并构建

npm install
npm run build

以 stdio 模式运行(供 Bob 桌面端使用)

node build/index.js

在本地以 HTTP 模式运行

MCP_TRANSPORT=http PORT=3000 node build/index.js

测试健康端点:

curl http://localhost:3000/health

使用 Docker 运行

构建镜像

docker build -t erm-github-mcp .

运行容器

docker run -p 3000:3000 erm-github-mcp

使用 Docker Compose

docker compose up --build

GitHub Actions CI/CD

位于 .github/workflows/build-push.yml 的工作流会在每次推送到 main 分支以及版本标签(v*)时运行:

  1. TypeScript 构建 — npm ci + tsc(遇到类型错误时快速失败)

  2. Docker 构建与推送 — 多平台镜像(linux/amd64、linux/arm64)会推送到 GitHub Container Registry (GHCR)

镜像发布为:

ghcr.io/<your-github-username>/erm-github-mcp:<tag>

无需配置任何密钥 — 工作流使用内置的 GITHUB_TOKEN。

将软件包设为公开

首次推送后,进入 GitHub → Packages → erm-github-mcp → Package settings,将可见性设为 Public,这样 Code Engine 就可以在无需凭据的情况下拉取它。


部署到 IBM Code Engine

前置条件

  • 安装了 Code Engine 插件的 IBM Cloud CLI:

    ibmcloud plugin install code-engine
  • 一个 IBM Cloud 账户和一个 Code Engine 项目

步骤

1 — 指定你的项目

ibmcloud ce project select --name <your-project-name>

2 — 部署应用

将 <tag> 替换为你想要部署的镜像标签(例如 main 或 v0.1.0):

ibmcloud ce application create \
  --name erm-github-mcp \
  --image ghcr.io/<your-github-username>/erm-github-mcp:<tag> \
  --port 3000 \
  --min-scale 0 \
  --max-scale 5 \
  --env MCP_TRANSPORT=http \
  --env PORT=3000

3 — 获取公共 URL

ibmcloud ce application get --name erm-github-mcp --output url

4 — 推送新镜像后更新

ibmcloud ce application update \
  --name erm-github-mcp \
  --image ghcr.io/<your-github-username>/erm-github-mcp:<new-tag>

环境变量

变量

默认值

描述

MCP_TRANSPORT

stdio

在容器中设置为 http

PORT

3000

服务器监听的 HTTP 端口


连接到 Bob (IBM Bob Desktop)

HTTP(远程 — 部署到 Code Engine 之后)

将以下内容添加到你的 Bob mcp.json:

{
  "mcpServers": {
    "erm-github-mcp": {
      "url": "https://<your-code-engine-url>"
    }
  }
}

stdio(本地 — 用于开发)

{
  "mcpServers": {
    "erm-github-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/erm-github-mcp/build/index.js"]
    }
  }
}

扩展服务器

在 src/index.ts 中使用 server.tool() 添加新工具:

server.tool(
  "my_tool",
  "Description shown to the AI",
  {
    input_field: z.string().describe("What this field does"),
  },
  async ({ input_field }) => ({
    content: [{ type: "text", text: `Result: ${input_field}` }],
  })
);

然后重新构建:

npm run build

License

Apache 2.0

Available Tools

2 tools
get_server_infoA

Returns metadata about this running MCP server instance.

NameRequiredDescriptionDefault

No parameters

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. 'Returns metadata' implies a read-only operation, but it does not explicitly say so, nor does it disclose what the response contains or whether there are side effects. For a zero-parameter tool this is adequate, but it misses the chance to confirm non-mutating behavior and response shape.

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

Conciseness5/5

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

A single, front-loaded sentence with no wasted words. It states the verb, resource, and scope efficiently. Perfect for a zero-parameter tool.

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

Completeness4/5

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

For a simple read-only metadata tool with no parameters and no output schema, the description is mostly complete. It tells the agent what the tool does. However, it could be slightly more explicit about the types of metadata returned (e.g., server version, protocol, capabilities) and could mention that it is safe to call without side effects. The lack of any relationship to 'ping' also leaves a small gap.

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

Parameters4/5

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

The tool has zero parameters, so there is nothing for the description to explain beyond what the schema already shows (empty properties). The baseline is 4 because the schema fully covers parameters, and the description adds no ambiguity. No extra value needed.

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 states a clear verb ('Returns') and resource ('metadata about this running MCP server instance'). It distinguishes from ping (which implies liveness check), though 'metadata' is generic and could be more specific about what metadata (e.g., version, capabilities). Still, the purpose is unmistakable.

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 vs the sibling tool 'ping'. Both relate to server status, but the description doesn't explain which to call for what. An agent would have to infer that ping checks connectivity while this fetches metadata, but no explicit when/when-not is provided.

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

pingA

Health-check tool. Returns 'pong' and echoes the optional message back.

NameRequiredDescriptionDefault
messageNoOptional message to echo back

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden, and it discloses both the return value ('pong') and the side effect (echoing the message). 'Health-check' strongly implies a non-mutating, safe operation. It does not explicitly state non-destructiveness, but for a ping the disclosed behavior is effectively complete.

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

Conciseness5/5

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

Two short sentences, no filler, with the purpose front-loaded before the return-behavior detail. Every word earns its place; this is a model of concise health-check documentation.

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

Completeness5/5

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

For a tool this simple — one optional parameter, no required fields, no nested objects, no output schema — the description tells an agent everything needed to call it correctly and predict the response. Nothing meaningful is missing.

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 coverage is 100%, so the single message parameter is already documented ('Optional message to echo back'). The description reinforces the echo behavior in prose, which adds marginal context beyond the schema but does not materially expand on it, landing at the baseline for high-coverage schemas.

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 states a specific purpose ('health-check tool') and the precise behavior ('returns pong and echoes the optional message back'). This is clear, specific, and inherently distinguishes it from the get_server_info sibling, whose name implies returning server details rather than a liveness signal.

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 'health-check tool' phrasing implies when it should be used, and it is self-evident for a ping utility. However, there is no explicit guidance on when to prefer this over get_server_info or any stated exclusions. For a trivial tool the context is clear enough, but it stops short of explicit alternative routing.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv0.1.0
    • First observedget_server_info
    • First observedping

TDQS

A3.5/5.0

Scored across 2 tools

Disambiguation5/5

The two tools serve clearly distinct purposes: ping is a health check, while get_server_info provides instance metadata. There is zero overlap between them.

Naming Consistency5/5

Both tools follow a consistent verb_noun naming pattern (ping, get_server_info) with snake_case, matching the expected convention.

Tool Count1/5

With only two generic tools and a server name indicating GitHub integration, the count is severely inadequate. The tools are trivial and unrelated to the apparent domain, representing an extreme mismatch.

Completeness1/5

The server name implies GitHub functionality, but the tool surface offers only health check and server info. No GitHub operations exist, leaving obvious and critical gaps.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    Not graded
    maintenance
    A minimal reference implementation of an MCP server that responds with "Hello, World" via Streamable HTTP. Serves as a baseline for integration testing and MCP client development with production-ready features including health checks, metrics, and containerized deployment.
    3
    47,219 npm
    -
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    A basic MCP server built with FastMCP framework that provides example tools including message echoing and server information retrieval. Supports both stdio and HTTP transports with Docker deployment capabilities.
    -
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    A basic MCP server built with FastMCP framework that provides example tools for echoing messages and retrieving server information. Supports both stdio and HTTP transports with Docker deployment capabilities.
    -
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    A basic MCP server built with FastMCP framework that provides simple utility tools including message echoing and server information retrieval. Supports both stdio and HTTP transports with Docker deployment capabilities.
    -