|
| 1 | +# Poutine MCP Server Integration Guide |
| 2 | + |
| 3 | +The Poutine MCP (Model Context Protocol) server allows AI coding assistants to analyze repositories and CI/CD pipelines for security vulnerabilities directly from your development environment. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +1. **Install Poutine**: Follow the [installation guide](README.md) to install Poutine |
| 8 | +2. **GitHub Authentication**: Set up GitHub CLI authentication |
| 9 | + ```bash |
| 10 | + gh auth login |
| 11 | + ``` |
| 12 | +3. **Set GitHub Token Environment Variable**: Before launching your AI coding assistant, export the GitHub token: |
| 13 | + ```bash |
| 14 | + export GH_TOKEN=$(gh auth token) |
| 15 | + ``` |
| 16 | + |
| 17 | + The Poutine MCP server will automatically pick up the `GH_TOKEN` environment variable from your shell session. |
| 18 | + |
| 19 | +## Setup |
| 20 | + |
| 21 | +### Claude Code |
| 22 | + |
| 23 | +```bash |
| 24 | +claude mcp add poutine poutine mcp-server |
| 25 | +``` |
| 26 | + |
| 27 | +### Gemini CLI |
| 28 | + |
| 29 | +```bash |
| 30 | +gemini mcp add poutine poutine mcp-server |
| 31 | +``` |
| 32 | + |
| 33 | +### Other MCP-Compatible Clients |
| 34 | + |
| 35 | +Add the following configuration to your MCP-compatible AI coding assistant: |
| 36 | + |
| 37 | +```json |
| 38 | +"mcpServers": { |
| 39 | + "poutine": { |
| 40 | + "type": "stdio", |
| 41 | + "command": "poutine", |
| 42 | + "args": [ |
| 43 | + "mcp-server" |
| 44 | + ], |
| 45 | + } |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +**Note**: The Poutine MCP server will automatically pick up the `GH_TOKEN` environment variable from your shell session. Make sure you've set it (see Prerequisites) before launching your AI coding assistant. |
| 50 | + |
| 51 | +## Available MCP Tools |
| 52 | + |
| 53 | +Once configured, the following tools are available to your AI assistant: |
| 54 | + |
| 55 | +### `analyze_org` |
| 56 | +Scan all repositories in a GitHub/GitLab organization. |
| 57 | + |
| 58 | +**Parameters:** |
| 59 | +- `org` (required): Organization name |
| 60 | +- `scm_provider` (optional): "github" or "gitlab" (default: "github") |
| 61 | +- `scm_base_url` (optional): Base URL for self-hosted instances |
| 62 | +- `threads` (optional): Number of parallel threads (default: 2) |
| 63 | +- `ignore_forks` (optional): Skip forked repositories (default: false) |
| 64 | + |
| 65 | +### `analyze_repo` |
| 66 | +Scan a specific repository. |
| 67 | + |
| 68 | +**Parameters:** |
| 69 | +- `repo` (required): Repository name in format "org/repo" |
| 70 | +- `scm_provider` (optional): "github" or "gitlab" (default: "github") |
| 71 | +- `scm_base_url` (optional): Base URL for self-hosted instances |
| 72 | +- `ref` (optional): Git branch or commit to analyze (default: "HEAD") |
| 73 | + |
| 74 | +### `analyze_local` |
| 75 | +Scan a local repository by file path. |
| 76 | + |
| 77 | +**Parameters:** |
| 78 | +- `path` (required): Local file system path to the repository |
| 79 | + |
| 80 | +### `analyze_repo_stale_branches` |
| 81 | +Scan repository branches for `pull_request_target` vulnerabilities. |
| 82 | + |
| 83 | +**Parameters:** |
| 84 | +- `repo` (required): Repository name in format "org/repo" |
| 85 | +- `scm_provider` (optional): "github" or "gitlab" (default: "github") |
| 86 | +- `scm_base_url` (optional): Base URL for self-hosted instances |
| 87 | +- `threads` (optional): Number of parallel threads (default: 5) |
| 88 | +- `expand` (optional): Expand output to full format (default: false) |
| 89 | +- `regex` (optional): Regex pattern for workflow matching (default: "pull_request_target") |
| 90 | + |
| 91 | +### `analyze_manifest` |
| 92 | +Analyze CI/CD pipeline manifest content for security issues. |
| 93 | + |
| 94 | +**Parameters:** |
| 95 | +- `content` (required): The complete YAML manifest content |
| 96 | +- `manifest_type` (required): Type of manifest - "github-actions", "gitlab-ci", "azure-pipelines", or "tekton" |
| 97 | + |
| 98 | +**Note**: This tool is automatically called when AI assistants generate or modify CI/CD workflows to ensure security best practices. |
| 99 | + |
| 100 | +## Example AI Assistant Prompts |
| 101 | + |
| 102 | +Here are some example prompts you can use with your AI coding assistant: |
| 103 | + |
| 104 | +**Organization-wide scan:** |
| 105 | +``` |
| 106 | +Use Poutine to scan all repositories in the <your_org> organization |
| 107 | +``` |
| 108 | + |
| 109 | +**Single repository analysis:** |
| 110 | +``` |
| 111 | +Analyze the security of the repository actions/checkout |
| 112 | +``` |
| 113 | + |
| 114 | +**Local repository scan:** |
| 115 | +``` |
| 116 | +Scan the repository at /Users/me/projects/myapp for supply chain vulnerabilities |
| 117 | +``` |
| 118 | + |
| 119 | +**Stale branch analysis:** |
| 120 | +``` |
| 121 | +Check the myorg/myrepo repository for pull_request_target vulnerabilities in stale branches |
| 122 | +``` |
| 123 | + |
| 124 | +**Workflow generation with automatic security validation:** |
| 125 | +``` |
| 126 | +Create a GitHub Actions workflow that runs tests on pull requests |
| 127 | +``` |
| 128 | +*(The AI will automatically use `analyze_manifest` to validate the generated workflow)* |
| 129 | + |
| 130 | +## Additional Resources |
| 131 | + |
| 132 | +- [Model Context Protocol Specification](https://spec.modelcontextprotocol.io/) |
| 133 | +- [Poutine Documentation](README.md) |
| 134 | +- [Claude Code MCP Guide](https://docs.claude.com/en/docs/claude-code/mcp) |
| 135 | +- [Gemini CLI MCP Guide](https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md) |
0 commit comments