Skip to content

Instantly share code, notes, and snippets.

@hashtagchris
Last active April 15, 2025 02:28
Show Gist options
  • Save hashtagchris/f77867de90f6d46a95f05c17a53ed794 to your computer and use it in GitHub Desktop.
Save hashtagchris/f77867de90f6d46a95f05c17a53ed794 to your computer and use it in GitHub Desktop.

MCP protocol example

Log into ghcr.io

% export CR_PAT=<PAT with packages:read for the github org>
% echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
> Login Succeeded

Start the GitHub MCP Server in a container

% export GITHUB_PERSONAL_ACCESS_TOKEN=<Your PAT>
% docker run -i -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
GitHub MCP Server running on stdio

Send commands

Send these commands one-by-one to the docker container and inspect the responses

{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2025-03-26"},"id":1}
{"jsonrpc":"2.0","method":"tools/list","id":2}
{"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_me"},"id":3}

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment