diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 000000000..c3a7401ce --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,51 @@ +# https://docs.github.com/en/copilot/customizing-copilot/customizing-the-development-environment-for-copilot-coding-agent +name: "Copilot Setup Steps" + +on: + workflow_dispatch: + push: + paths: + - .github/workflows/copilot-setup-steps.yml + pull_request: + paths: + - .github/workflows/copilot-setup-steps.yml + +jobs: + copilot-setup-steps: + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Download Go dependencies + run: go mod download + + - name: Build server + run: go build -v ./cmd/github-mcp-server + + - name: Install goimports + run: go install golang.org/x/tools/cmd/goimports@latest + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: Install MCP Inspector + run: npm install -g @modelcontextprotocol/inspector@0.7.0 + + - name: Verify tools + run: | + echo "Go version: $(go version)" + echo "goimports: $(which goimports)" + echo "MCP Inspector: $(which mcp-inspector || echo 'installed via npx')" + echo "Server binary: $(ls -la github-mcp-server)" diff --git a/.github/copilot-instructions.md b/AGENTS.md similarity index 90% rename from .github/copilot-instructions.md rename to AGENTS.md index f1b4cf9cb..81b185d75 100644 --- a/.github/copilot-instructions.md +++ b/AGENTS.md @@ -1,4 +1,16 @@ -# GitHub MCP Server - Copilot Instructions +# GitHub MCP Server - Agent Instructions + +> This file follows the [agents.md](https://agents.md) convention for AI agent instructions. + +## AI Disclosure Requirement + +> **If you are using AI assistance to contribute to this repository, you must disclose it in the pull request or issue body.** + +Include a brief statement like: +- "This PR was written with assistance from [agent name]." +- "I used [tool] to help generate this code." + +This helps maintainers understand the context and apply appropriate review scrutiny. ## Project Overview @@ -59,6 +71,29 @@ go test ./pkg/github -v go test ./pkg/github -run TestGetMe ``` +### Testing with MCP Inspector + +Use the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) CLI to test the server: + +```bash +# Build the server first +go build -v ./cmd/github-mcp-server + +# List available tools +npx @modelcontextprotocol/inspector@0.7.0 --cli \ + --config '{"mcpServers":{"github":{"command":"./github-mcp-server","args":["stdio"],"env":{"GITHUB_PERSONAL_ACCESS_TOKEN":"your-token"}}}}' \ + --server github \ + --method tools/list + +# Call a specific tool (e.g., get authenticated user) +npx @modelcontextprotocol/inspector@0.7.0 --cli \ + --config '{"mcpServers":{"github":{"command":"./github-mcp-server","args":["stdio"],"env":{"GITHUB_PERSONAL_ACCESS_TOKEN":"your-token"}}}}' \ + --server github \ + --method tools/call --tool-name get_me +``` + +Note: Replace `your-token` with a valid GitHub Personal Access Token. + ## Project Structure ### Directory Layout diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6c16cd27d..132fbcb9c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,3 +56,18 @@ Here are a few things you can do that will increase the likelihood of your pull - [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) - [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) - [GitHub Help](https://help.github.com) + +## AI Contributions + +We welcome contributions that use AI assistance. However, **if you are using any kind of AI assistance** (e.g., GitHub Copilot, Claude, ChatGPT, or other AI agents), **you must disclose this in your pull request or issue**. + +Include a brief statement describing: +- Which AI tool(s) you used +- The extent of AI assistance (e.g., "code generation", "documentation help", "debugging suggestions") + +Example disclosures: +> This PR was written with assistance from GitHub Copilot. + +> I used Claude to help draft the initial implementation, which I then reviewed and modified. + +This transparency helps maintainers understand context and apply appropriate review. Trivial fixes (typos, formatting) don't require disclosure.