Skip to content

Commit 5e89eab

Browse files
committed
Fix: Add github mcp server action
1 parent baf44b7 commit 5e89eab

File tree

22 files changed

+3782
-103
lines changed

22 files changed

+3782
-103
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Build and Publish GitHub MCP Server
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Package version (e.g. 0.0.1)'
8+
required: true
9+
default: '0.0.1'
10+
type: string
11+
uipath_access_token:
12+
description: 'UiPath Access Token'
13+
required: true
14+
type: string
15+
uipath_url:
16+
description: 'UiPath URL'
17+
required: true
18+
default: 'https://alpha.uipath.com/ada/byoa'
19+
type: string
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
repository: github/github-mcp-server
29+
30+
- name: Set up Go
31+
uses: actions/setup-go@v5
32+
with:
33+
go-version: '1.21'
34+
35+
- name: Build MCP Server
36+
run: |
37+
cd cmd/github-mcp-server
38+
go build
39+
40+
- name: Set up Python
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: '3.10'
44+
45+
- name: Install UV
46+
run: pip install uv
47+
48+
- name: Prepare package directory
49+
run: |
50+
mkdir -p temp
51+
cp cmd/github-mcp-server/github-mcp-server temp
52+
chmod +x temp/github-mcp-server
53+
54+
- name: Create MCP config file
55+
run: |
56+
cat > temp/mcp.json << EOF
57+
{
58+
"servers": {
59+
"github": {
60+
"command": "/bin/sh",
61+
"args": ["-c", "chmod +x github-mcp-server && ./github-mcp-server stdio"],
62+
"env": {
63+
"GITHUB_PERSONAL_ACCESS_TOKEN": "x"
64+
}
65+
}
66+
}
67+
}
68+
EOF
69+
70+
- name: Create pyproject.toml
71+
run: |
72+
cat > temp/pyproject.toml << EOF
73+
[project]
74+
name = "mcp-github-server"
75+
version = "${{ github.event.inputs.version }}"
76+
description = "Official GitHub MCP Server"
77+
authors = [{ name = "John Doe" }]
78+
dependencies = [
79+
"uipath-mcp==0.0.74",
80+
]
81+
requires-python = ">=3.10"
82+
EOF
83+
84+
- name: Create .env file
85+
run: |
86+
cat > temp/.env << EOF
87+
UIPATH_ACCESS_TOKEN=${{ github.event.inputs.uipath_access_token }}
88+
UIPATH_URL=${{ github.event.inputs.uipath_url }}
89+
EOF
90+
91+
- name: Setup Python environment and package
92+
working-directory: ./temp
93+
run: |
94+
# Create and activate virtual environment
95+
uv venv -p 3.10 .venv
96+
source .venv/bin/activate
97+
98+
# Install dependencies
99+
uv sync
100+
101+
# Initialize uipath
102+
uipath init
103+
104+
# Modify uipath.json to add settings
105+
python -c "import json; f=open('uipath.json','r'); data=json.load(f); f.close(); data['settings']={'filesIncluded':['github-mcp-server']}; f=open('uipath.json','w'); json.dump(data,f,indent=4); f.close(); print('Updated uipath.json')"
106+
107+
# Show the modified file
108+
cat uipath.json
109+
110+
# Continue with packing
111+
uipath pack
112+
113+
- name: Upload artifact
114+
uses: actions/upload-artifact@v4
115+
with:
116+
name: mcp-github-server-${{ github.event.inputs.version }}
117+
path: temp/.uipath/mcp-github-server.${{ github.event.inputs.version }}.nupkg
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: GitHub Helper Agent
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_review_comment:
6+
types: [created]
7+
jobs:
8+
trigger-uipath-agent:
9+
if: startsWith(github.event.comment.body, '/help')
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Install Python dependencies
13+
run: pip install requests
14+
- name: Trigger UiPath Agent
15+
env:
16+
COMMENT_BODY: ${{ toJson(github.event.comment.body) }}
17+
run: |
18+
python -c "import requests; import json; import os; import re; import base64; comment_json = os.environ['COMMENT_BODY']; comment = json.loads(comment_json); command = re.search(r'/help\s+(\w+)', comment); command_value = command.group(1) if command else 'help'; number = ${{ github.event.issue.number || github.event.pull_request.number || 0 }}; payload = json.dumps({'owner': '${{ github.repository_owner }}', 'repo': '${{ github.event.repository.name }}', 'pullNumber': number, 'command': command_value, 'commentNumber': ${{ github.event.comment.id }}}); resp = requests.post('${{ secrets.UIPATH_URL }}/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs', headers={'Authorization': 'Bearer ${{ secrets.UIPATH_ACCESS_TOKEN }}', 'Content-Type': 'application/json', 'X-UiPath-FolderPath': 'MCP Folder'}, json={'startInfo': {'releaseName': 'github-helper-agent', 'inputArguments': payload}}); print(f'Status code: {resp.status_code}'); print(f'Response: {resp.text}')"

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[project]
22
name = "uipath-mcp"
3-
version = "0.0.70"
3+
version = "0.0.75"
44
description = "UiPath MCP SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"
77
dependencies = [
88
"mcp==1.6.0",
99
"pysignalr==1.2.0",
10-
"uipath==2.0.18",
10+
"uipath==2.0.27",
1111
]
1212
classifiers = [
1313
"Development Status :: 3 - Alpha",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
UIPATH_MCP_SERVER_URL=***
2+
ANTHROPIC_API_KEY=***
3+
UIPATH_MCP_SERVER_URL=<server_url>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# GitHub Helper Agent
2+
3+
This project demonstrates how to create a GitHub Helper Agent using LangGraph with UiPathAzureChatOpenAI that interacts with Github via the official GitHub MCP Server deployed on UiPath infrastructure.
4+
5+
## Overview
6+
7+
The agent uses:
8+
- LangGraph for orchestration
9+
- UiPath hosted GitHub MCP server
10+
11+
## Architecture
12+
13+
```mermaid
14+
---
15+
config:
16+
flowchart:
17+
curve: linear
18+
---
19+
graph TD;
20+
__start__([<p>__start__</p>]):::first
21+
hydrate_history(hydrate_history)
22+
__end__(<p>__end__</p>)
23+
__start__ --> hydrate_history;
24+
hydrate_history -.-> developer_node___start__;
25+
hydrate_history -.-> reviewer_node___start__;
26+
hydrate_history -.-> __end__;
27+
subgraph reviewer_node
28+
reviewer_node___start__(<p>__start__</p>)
29+
reviewer_node_agent(agent)
30+
reviewer_node_tools(tools)
31+
reviewer_node___end__(<p>__end__</p>)
32+
reviewer_node___start__ --> reviewer_node_agent;
33+
reviewer_node_tools --> reviewer_node_agent;
34+
reviewer_node_agent -.-> reviewer_node_tools;
35+
reviewer_node_agent -.-> reviewer_node___end__;
36+
end
37+
subgraph developer_node
38+
developer_node___start__(<p>__start__</p>)
39+
developer_node_agent(agent)
40+
developer_node_tools(tools)
41+
developer_node___end__(<p>__end__</p>)
42+
developer_node___start__ --> developer_node_agent;
43+
developer_node_tools --> developer_node_agent;
44+
developer_node_agent -.-> developer_node_tools;
45+
developer_node_agent -.-> developer_node___end__;
46+
end
47+
classDef default fill:#f2f0ff,line-height:1.2
48+
classDef first fill-opacity:0
49+
classDef last fill:#bfb6fc
50+
```
51+
52+
## Prerequisites
53+
54+
- Python 3.10+
55+
- `langchain-mcp-adapters`
56+
- `langgraph`
57+
- `uipath-langchain`
58+
59+
## Installation
60+
61+
```bash
62+
uv venv -p 3.11 .venv
63+
.venv\Scripts\activate
64+
uv sync
65+
```
66+
67+
Set your MCP Remote Server URL as environment variables in .env
68+
69+
```bash
70+
UIPATH_MCP_SERVER_URL=https://cloud.uipath.com/account/tenant/mcp_/mcp/folder-key/github-mcp/sse
71+
```
72+
73+
## Debugging
74+
75+
For debugging issues:
76+
77+
1. Check logs for any connection or runtime errors:
78+
```bash
79+
uipath run agent '{"owner": "uipath", "repo": "uipath-mcp-python", "pullNumber": 78, "command": "summarize", "in_reply_to": 2060859623}'
80+
```
81+
82+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
config:
3+
flowchart:
4+
curve: linear
5+
---
6+
graph TD;
7+
__start__([<p>__start__</p>]):::first
8+
hydrate_history(hydrate_history)
9+
__end__(<p>__end__</p>)
10+
__start__ --> hydrate_history;
11+
hydrate_history -.-> developer_node___start__;
12+
hydrate_history -.-> reviewer_node___start__;
13+
hydrate_history -.-> __end__;
14+
subgraph reviewer_node
15+
reviewer_node___start__(<p>__start__</p>)
16+
reviewer_node_agent(agent)
17+
reviewer_node_tools(tools)
18+
reviewer_node___end__(<p>__end__</p>)
19+
reviewer_node___start__ --> reviewer_node_agent;
20+
reviewer_node_tools --> reviewer_node_agent;
21+
reviewer_node_agent -.-> reviewer_node_tools;
22+
reviewer_node_agent -.-> reviewer_node___end__;
23+
end
24+
subgraph developer_node
25+
developer_node___start__(<p>__start__</p>)
26+
developer_node_agent(agent)
27+
developer_node_tools(tools)
28+
developer_node___end__(<p>__end__</p>)
29+
developer_node___start__ --> developer_node_agent;
30+
developer_node_tools --> developer_node_agent;
31+
developer_node_agent -.-> developer_node_tools;
32+
developer_node_agent -.-> developer_node___end__;
33+
end
34+
classDef default fill:#f2f0ff,line-height:1.2
35+
classDef first fill-opacity:0
36+
classDef last fill:#bfb6fc
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"dependencies": ["."],
3+
"graphs": {
4+
"agent": "./main.py:make_graph"
5+
},
6+
"env": ".env"
7+
}

0 commit comments

Comments
 (0)