After cloning, copy the example config files and fill in your local paths:
cp opencode.json.example opencode.json
cp .mcp.json.example .mcp.jsonEdit both files to replace <path-to-pytorchinsight> with the absolute path to your local PyTorchInsight clone, and <your-github-pat> with your GitHub Personal Access Token.
# With uv (recommended)
uv pip install -e ".[dev]"
# Or with pip
pip install -e ".[dev]"Configure the following environment variables for each platform:
export GITHUB_TOKEN="ghp_..."Create a Personal Access Token with repo scope (read-only is sufficient).
export DISCOURSE_API_KEY="your-api-key"
export DISCOURSE_API_USERNAME="your-username"Generate an API key at discuss.pytorch.org admin settings.
No authentication required. These tools work out of the box.
# From the project directory (no pre-install needed)
uv run pytorch-community-mcp
# Or if already installed
pytorch-community-mcpAdd to your MCP settings (works from any directory):
{
"mcpServers": {
"pytorch-community": {
"command": "uv",
"args": ["run", "--directory", "/absolute/path/to/PyTorchInsight", "pytorch-community-mcp"],
"env": {
"GITHUB_TOKEN": "ghp_..."
}
}
}
}Replace
/absolute/path/to/PyTorchInsightwith the actual path where you cloned this repo.
| Tool | Description | Required Config |
|---|---|---|
get_prs |
PyTorch PRs by date/module | GITHUB_TOKEN |
get_issues |
PyTorch issues by date/module/state | GITHUB_TOKEN |
get_commits |
PyTorch commits by date/author | GITHUB_TOKEN |
get_rfcs |
PyTorch RFCs from pytorch/pytorch + pytorch/rfcs | GITHUB_TOKEN |
get_pr_detail |
Detailed info for a single PR | GITHUB_TOKEN |
get_issue_detail |
Detailed info for a single issue | GITHUB_TOKEN |
get_discussions |
Discourse forum topics | None (optional DISCOURSE_API_KEY) |
get_events |
PyTorch community events | None |
get_blog_news |
PyTorch blog RSS feed | None |
get_key_contributors_activity |
Cross-platform contributor summary | GITHUB_TOKEN (Discourse optional) |
pytest tests/