[shawn] feat: add GitHub MCP integration

This commit is contained in:
TheAchiever6823
2026-05-16 23:14:59 -07:00
parent af63029ebd
commit 55516fc4d7
3 changed files with 94 additions and 1 deletions
+30
View File
@@ -240,6 +240,36 @@ bash scripts/setup-linkedin-mcp.sh
---
## GitHub (`github-mcp-server`) (optional)
The official [github/github-mcp-server](https://github.com/github/github-mcp-server) (Go) ships as a pre-built 6.7 MB single binary. With `--toolsets=all` it exposes **79 tools** covering repos, issues, pull requests, gists, workflows, code search, security, projects, notifications, and more. Auth is a GitHub Personal Access Token passed as `GITHUB_PERSONAL_ACCESS_TOKEN`.
### One-time install
From the repo root:
```bash
bash scripts/setup-github-mcp.sh
```
The script detects your platform (macOS/Linux × x86_64/arm64), downloads the latest release tarball from GitHub Releases, and installs the binary at `~/.openswarm/bin/github-mcp-server`. Re-running it upgrades to the latest version.
### Connect from the UI
1. Create a Personal Access Token at https://github.com/settings/tokens. Fine-grained tokens are recommended; pick the scopes you want the agent to have.
2. Open the **Tools** page in the sidebar.
3. Find the **GitHub** tile and click **Connect GitHub**.
4. Paste the token and confirm. The tile flips to **Connected** and the server is spawned on demand for tool calls.
### Notes
* No background daemon. The binary is spawned by OpenSwarm only when an agent invokes a GitHub tool.
* The token is stored locally in OpenSwarm's tool config and passed as an env var to the binary at spawn time.
* To rotate the token, click the **Connected** chip to disconnect, then reconnect with the new value.
* For read-only mode (safer default for unattended agents), edit the tool's `mcp_config.args` to include `--read-only`.
---
## Project structure
```
+25 -1
View File
@@ -309,6 +309,30 @@ const INTEGRATIONS: Integration[] = [
),
authType: 'oauth2',
},
{
id: 'github',
name: 'GitHub',
description:
'GitHub repos, issues, PRs, code, workflows, gists, security, projects. 79 tools from the official github/github-mcp-server. Run scripts/setup-github-mcp.sh once to install the binary, then paste a Personal Access Token.',
mcp_config: {
type: 'stdio',
command: 'bash',
args: ['-c', 'exec "$HOME/.openswarm/bin/github-mcp-server" stdio --toolsets=all'],
},
color: '#181717',
website: 'https://github.com/github/github-mcp-server',
connectLabel: 'Connect GitHub',
connectInstructions: 'Create a Personal Access Token at https://github.com/settings/tokens (fine-grained recommended) with the repo, read:org, and workflow scopes you want the agent to use. Then paste it below. First time only: run `bash scripts/setup-github-mcp.sh` in a terminal to download the github-mcp-server binary to ~/.openswarm/bin/.',
credentialFields: [
{ key: 'GITHUB_PERSONAL_ACCESS_TOKEN', label: 'GitHub Personal Access Token', placeholder: 'ghp_... or github_pat_...', type: 'password' },
],
icon: (
<svg viewBox="0 0 24 24" width="22" height="22">
<rect x="0" y="0" width="24" height="24" rx="4" fill="#181717" />
<path d="M12 4.3c-3.83 0-6.94 3.11-6.94 6.94 0 3.07 1.99 5.67 4.75 6.59.35.06.48-.15.48-.34 0-.17-.01-.61-.01-1.2-1.93.42-2.34-.93-2.34-.93-.32-.8-.77-1.02-.77-1.02-.63-.43.05-.42.05-.42.7.05 1.06.71 1.06.71.62 1.06 1.62.75 2.02.58.06-.45.24-.76.44-.93-1.54-.17-3.17-.77-3.17-3.43 0-.76.27-1.38.72-1.86-.07-.17-.31-.88.07-1.84 0 0 .58-.18 1.91.71.55-.15 1.15-.23 1.74-.23.59 0 1.18.08 1.74.23 1.33-.89 1.91-.71 1.91-.71.38.96.14 1.67.07 1.84.45.48.72 1.1.72 1.86 0 2.66-1.63 3.26-3.18 3.43.25.21.47.63.47 1.28 0 .92-.01 1.67-.01 1.89 0 .19.13.4.49.34 2.76-.92 4.74-3.52 4.74-6.59 0-3.83-3.11-6.94-6.94-6.94z" fill="#fff" />
</svg>
),
},
{
id: 'linkedin',
name: 'LinkedIn',
@@ -638,7 +662,7 @@ const Tools: React.FC = () => {
// browse the long tail.
const CURATED_MCP_NAMES = useMemo(() => new Set([
'google-workspace', 'microsoft-365', 'slack', 'discord',
'notion', 'airtable', 'hubspot', 'reddit', 'youtube', 'instagram', 'linkedin',
'notion', 'airtable', 'hubspot', 'reddit', 'youtube', 'instagram', 'linkedin', 'github',
]), []);
const regServers = useMemo(() => {
if (regSource !== 'curated') return regServersRaw;
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
# One-time setup for the GitHub MCP server (github/github-mcp-server).
# Downloads the latest pre-built single binary for the current platform from
# the project's GitHub Releases and installs it at ~/.openswarm/bin/.
# OpenSwarm's GitHub tool tile spawns that binary directly (stdio transport).
# Re-running this is safe and is how you upgrade to a newer release.
set -euo pipefail
DEST_DIR="$HOME/.openswarm/bin"
DEST="$DEST_DIR/github-mcp-server"
TAG="$(curl -fsSL https://api.github.com/repos/github/github-mcp-server/releases/latest \
| python3 -c "import json,sys; print(json.load(sys.stdin)['tag_name'])")"
OS="$(uname -s)"
ARCH="$(uname -m)"
case "$OS-$ARCH" in
Darwin-arm64) ASSET="github-mcp-server_Darwin_arm64.tar.gz" ;;
Darwin-x86_64) ASSET="github-mcp-server_Darwin_x86_64.tar.gz" ;;
Linux-x86_64) ASSET="github-mcp-server_Linux_x86_64.tar.gz" ;;
Linux-aarch64|Linux-arm64) ASSET="github-mcp-server_Linux_arm64.tar.gz" ;;
*) echo "error: unsupported platform $OS-$ARCH" >&2; exit 1 ;;
esac
URL="https://github.com/github/github-mcp-server/releases/download/$TAG/$ASSET"
TMP="$(mktemp -d)"
trap 'rm -rf "$TMP"' EXIT
echo "Downloading github-mcp-server $TAG ($OS-$ARCH)..."
curl -fSL "$URL" -o "$TMP/$ASSET"
tar -xzf "$TMP/$ASSET" -C "$TMP"
mkdir -p "$DEST_DIR"
mv -f "$TMP/github-mcp-server" "$DEST"
chmod +x "$DEST"
echo "Installed: $DEST"
"$DEST" --version 2>/dev/null || true