Preface¶
In DSH, enabling agents to access GitHub, the common approach is to prepare Git or gh CLI locally first, then let the model call these command-line tools; another approach is to connect to the GitHub MCP server via DSH’s MCP bridge. The latter route lacks a local command-line intermediate layer, but the existing bridge drops file contents.
dsh-github-mcp bridges this path: exposes the GitHub official MCP server as DSH native tools, and provides the github_file_read tool to read file contents.
What is this¶
dsh-github-mcp is a DSH plugin maintained by GitRuozhi, licensed under MIT, with version 1.1.0 in package.json.
It registers the GitHub official MCP server as DSH native tools. After installation, GitHub is primarily accessed through two entry points:
- the
mcp__github__*tool family; - the
github_file_readtool.
The plugin uses the GitHub hosted endpoint:
https://api.githubcopilot.com/mcp/
The facts state that it does not require a local Git or gh CLI intermediate layer. package.json declares two peer dependencies:
"@deepseek-ai/dsh-mcp-client": ">=0.1.0-rc.6",
"@deepseek-ai/dsh-tools": ">=0.1.0-rc.6"
Core Features¶
Exposing GitHub Official MCP Tools¶
After installation, DSH can invoke the mcp__github__* tool family. The documentation states these tools come from the GitHub official MCP server, totaling 44 tools.
Examples verifiable in this article include:
search_repositories
get_file_contents
list_issues
create_pull_request
merge_pull_request
The names seen by the model all carry the mcp__github__ prefix.
Reading File Contents or Directories¶
github_file_read is used to read file contents or list directories.
Verified documentation states: file contents are decoded to UTF-8 text. Private repository support requires GITHUB_TOKEN.
Using GitHub hosted MCP endpoint¶
The plugin uses:
https://api.githubcopilot.com/mcp/
Therefore, the access method does not rely on a local Git repository nor on the local gh CLI as an intermediate layer.
Installation & Activation¶
First, execute the plugin installation command:
dsh plugin --profile web add github:GitRuozhi/dsh-github-mcp
This step adds dsh-github-mcp under the web profile.
If you need to use private repositories, set GITHUB_TOKEN and restart dsh web:
Set GITHUB_TOKEN and restart dsh web
If gh is already logged in on the local machine, the documentation suggests that DSH can configure it for you directly.
Typical Usage¶
Below are several usage paths verifiable from verified sources.
Using mcp__github__* Tools¶
After installation, you can directly use the mcp__github__* tool family in DSH. Example tool names include:
search_repositories
get_file_contents
list_issues
create_pull_request
merge_pull_request
These tool names correspond to tools on the GitHub official MCP server, with the model side uniformly carrying the mcp__github__ prefix.
Using github_file_read to Read Files or Directories¶
github_file_read can be used to read file contents and can also be used to list directories.
The suitable scenario is: you want DSH to directly obtain the text of files in a repository, rather than just obtaining paths, metadata, or empty content after being dropped by the bridge.
Using Private Repositories¶
Private repositories require setting GITHUB_TOKEN and then restarting dsh web.
Minimal preset & Tool Filtering¶
dsh-github-mcp registers tools globally, so all presets will inherit GitHub tools, including minimal presets.
If you want to exclude these tools in a specific preset, it is recommended to filter at the system-prompt/assemble stage rather than taking a one-time snapshot of ctx.tools.schemas() at the apply stage. The reason is that plugin tool registration is asynchronous, involving MCP discovery and ctx.effect registration; taking a one-time snapshot at apply might result in empty results, causing the filtering logic to not take effect. Assembly-time filtering does not rely on the specific registration timing; filtering can be done when assembling the request.
Verified suggestions are: DSH’s built-in minimal preset cannot mask global plugins; you need to create a custom minimal preset to achieve isolation.
Below is the filtering example from the README.
This JS file is used to remove mcp__github__* and github_file_read during system prompt assembly:
// restrict-github.js
const name = 'restrict-github';
const inject = ['tools'];
function apply(ctx) {
ctx.on('system-prompt/assemble', async (_assembly, _context, next) => {
const assembled = await next();
try {
const tools = assembled && Array.isArray(assembled.tools) ? assembled.tools : [];
const filtered = tools.filter((tool) => {
const toolName = tool && typeof tool.name === 'string' ? tool.name : '';
return !(toolName.startsWith('mcp__github__') || toolName === 'github_file_read');
});
if (filtered.length === tools.length) return assembled;
return { ...assembled, tools: filtered };
} catch (error) {
// A filter bug must never brick a session: keep every tool.
return assembled;
}
});
}
export { apply, inject, name };
Mount this filter in the corresponding preset’s agent.cordis.yml:
# in that preset's agent.cordis.yml
- id: restrict-github
name: ./restrict-github.js
Applicable Scenarios & Notes¶
Suitable for users like:
- Want DSH to directly invoke the
mcp__github__*tools of the GitHub official MCP server; - Need to read file contents in GitHub repositories, rather than relying solely on local Git or
ghCLI; - Need to access GitHub in a private repository scenario via
GITHUB_TOKEN; - Need to control whether a specific preset inherits global GitHub tools.
Before use, you need to confirm:
- Plugin license is MIT;
package.jsonrequires@deepseek-ai/dsh-mcp-client >=0.1.0-rc.6and@deepseek-ai/dsh-tools >=0.1.0-rc.6;- Private repositories require
GITHUB_TOKEN; - Plugin tools are registered globally by default, and all presets will inherit;
- The plugin runs with the permissions of the current
dshprocess; it is recommended to check the source code, dependencies, and license before installing.
Summary¶
The core value of dsh-github-mcp is to expose the GitHub official MCP server as DSH native tools and use github_file_read to fill in the gap of reading file contents. After installation, you can directly use the mcp__github__* tool family and github_file_read, and enable private repositories via GITHUB_TOKEN.
Repository address:
https://github.com/GitRuozhi/dsh-github-mcp
Directory page (from plugin clues, not further verified in the data scraped this time):
https://www.skillhub.cn/plugins/GitRuozhi/dsh-github-mcp