Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
@@ -1,139 +1,140 @@
|
|
1 |
-
---
|
2 |
-
title: MCP GitHub PR Opportunity Server
|
3 |
-
emoji: π
|
4 |
-
colorFrom: blue
|
5 |
-
colorTo: indigo
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 5.33.1
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
tag: mcp-server-track
|
11 |
-
license: mit
|
12 |
-
---
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
-
|
21 |
-
-
|
22 |
-
-
|
23 |
-
-
|
24 |
-
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
-
|
48 |
-
-
|
49 |
-
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
}
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
-
|
78 |
-
- Set
|
79 |
-
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
"
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
-
|
99 |
-
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
"
|
110 |
-
"
|
111 |
-
"
|
112 |
-
"
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
"
|
126 |
-
"
|
127 |
-
"
|
128 |
-
"
|
129 |
-
"
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
|
|
139 |
MIT
|
|
|
1 |
+
---
|
2 |
+
title: MCP GitHub PR Opportunity Server
|
3 |
+
emoji: π
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: indigo
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: 5.33.1
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
tag: mcp-server-track
|
11 |
+
license: mit
|
12 |
+
---
|
13 |
+
# Video Link: https://drive.google.com/file/d/1FaYPqtoYWmUBsjiSFexPNyPARvFsixsh/view?usp=sharing
|
14 |
+
|
15 |
+
# MCP GitHub PR Opportunity Server
|
16 |
+
|
17 |
+
A Gradio-based MCP server that searches GitHub repositories for possible PR opportunities (open issues labeled 'good first issue' or 'help wanted'), supporting search by keyword and topic, with authentication.
|
18 |
+
|
19 |
+
## Features
|
20 |
+
- Search GitHub repos by keyword and topic
|
21 |
+
- Find open issues labeled 'good first issue' or 'help wanted'
|
22 |
+
- Supports GitHub authentication via token
|
23 |
+
- Gradio MCP server for LLM integration
|
24 |
+
- Interactive web interface
|
25 |
+
- Compatible with n8n workflows
|
26 |
+
|
27 |
+
## Local Setup
|
28 |
+
|
29 |
+
1. **Clone the repo and install dependencies:**
|
30 |
+
```bash
|
31 |
+
cd mcp_github_server
|
32 |
+
pip install -r requirements.txt
|
33 |
+
```
|
34 |
+
|
35 |
+
2. **Configure GitHub Token:**
|
36 |
+
- Set `GITHUB_TOKEN` in your environment variables, or
|
37 |
+
- Enter the token in the web interface
|
38 |
+
|
39 |
+
3. **Run the server:**
|
40 |
+
```bash
|
41 |
+
python app.py
|
42 |
+
```
|
43 |
+
|
44 |
+
## Hugging Face Spaces Deployment
|
45 |
+
|
46 |
+
1. **Create a new Space:**
|
47 |
+
- Go to [Hugging Face Spaces](https://huggingface.co/spaces)
|
48 |
+
- Click "Create new Space"
|
49 |
+
- Choose "Gradio" as the SDK
|
50 |
+
- Name your space (e.g., "mcp-github-pr-server")
|
51 |
+
|
52 |
+
2. **Configure Environment Variables:**
|
53 |
+
- In your Space settings, add `GITHUB_TOKEN` as a secret
|
54 |
+
- Set your GitHub token as the value
|
55 |
+
|
56 |
+
3. **Deploy:**
|
57 |
+
- Push your code to the Space repository
|
58 |
+
- Hugging Face will automatically build and deploy your application
|
59 |
+
|
60 |
+
## Using with MCP Clients
|
61 |
+
|
62 |
+
Add this configuration to your MCP client (e.g., Claude Desktop, Cursor, or Cline):
|
63 |
+
|
64 |
+
```json
|
65 |
+
{
|
66 |
+
"mcpServers": {
|
67 |
+
"github-pr-finder": {
|
68 |
+
"url": "https://akinyemiar-mcp-github-pr-server.hf.space/gradio_api/mcp/sse"
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
```
|
73 |
+
|
74 |
+
## Using with n8n
|
75 |
+
|
76 |
+
1. **Add HTTP Request Node:**
|
77 |
+
- In your n8n workflow, add an "HTTP Request" node
|
78 |
+
- Set the URL to your Hugging Face Space URL (e.g., `https://akinyemiar-mcp-github-pr-server.hf.space/api/predict`)
|
79 |
+
- Set Method to POST
|
80 |
+
- Add Headers:
|
81 |
+
```
|
82 |
+
Content-Type: application/json
|
83 |
+
```
|
84 |
+
- Set Body to JSON:
|
85 |
+
```json
|
86 |
+
{
|
87 |
+
"data": [
|
88 |
+
"fastapi",
|
89 |
+
"python",
|
90 |
+
5,
|
91 |
+
1,
|
92 |
+
"YOUR_GITHUB_TOKEN"
|
93 |
+
]
|
94 |
+
}
|
95 |
+
```
|
96 |
+
|
97 |
+
2. **Process Response:**
|
98 |
+
- The response will contain opportunities and total_count
|
99 |
+
- Use n8n's "Set" node to process the response data
|
100 |
+
- Add additional nodes to handle the opportunities as needed
|
101 |
+
|
102 |
+
## API Usage
|
103 |
+
|
104 |
+
The server provides both a web interface and an API endpoint at `/api/predict`. The API accepts POST requests with the following parameters:
|
105 |
+
|
106 |
+
```json
|
107 |
+
{
|
108 |
+
"data": [
|
109 |
+
"keyword", // optional
|
110 |
+
"topic", // optional
|
111 |
+
"per_page", // default: 5
|
112 |
+
"page", // default: 1
|
113 |
+
"token" // GitHub token
|
114 |
+
]
|
115 |
+
}
|
116 |
+
```
|
117 |
+
|
118 |
+
Response:
|
119 |
+
```json
|
120 |
+
{
|
121 |
+
"data": [
|
122 |
+
{
|
123 |
+
"opportunities": [
|
124 |
+
{
|
125 |
+
"repo_name": "tiangolo/fastapi",
|
126 |
+
"repo_url": "https://github.com/tiangolo/fastapi",
|
127 |
+
"issue_title": "Add more examples",
|
128 |
+
"issue_url": "https://github.com/tiangolo/fastapi/issues/1234",
|
129 |
+
"issue_labels": ["good first issue"],
|
130 |
+
"issue_body": "Please add more examples to the docs..."
|
131 |
+
}
|
132 |
+
],
|
133 |
+
"total_count": 123
|
134 |
+
}
|
135 |
+
]
|
136 |
+
}
|
137 |
+
```
|
138 |
+
|
139 |
+
## License
|
140 |
MIT
|