Skip to content

Commit 6eb2a57

Browse files
committed
Fix: Add github mcp server action
1 parent baf44b7 commit 6eb2a57

File tree

22 files changed

+3768
-103
lines changed

22 files changed

+3768
-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: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# LangGraph GitHub Helper Agent with Claude and GitHub MCP Server
2+
3+
This project demonstrates how to create a GitHub Helper Agent using LangGraph with Claude 3.5 Sonnet which connects to the GitHub MCP Server.
4+
5+
## Overview
6+
7+
The agent uses:
8+
- Claude 3.5 Sonnet as the language model
9+
- LangGraph for orchestration
10+
- Connects to a GitHub Remote MCP server via SSE
11+
12+
## Architecture
13+
14+
```mermaid
15+
---
16+
config:
17+
flowchart:
18+
curve: linear
19+
---
20+
graph TD;
21+
__start__([<p>__start__</p>]):::first
22+
hydrate_history(hydrate_history)
23+
__end__([<p>__end__</p>]):::last
24+
__start__ --> hydrate_history;
25+
agent___end__ --> __end__;
26+
hydrate_history --> agent___start__;
27+
subgraph agent
28+
agent___start__(<p>__start__</p>)
29+
agent_agent(agent)
30+
agent_tools(tools)
31+
agent___end__(<p>__end__</p>)
32+
agent___start__ --> agent_agent;
33+
agent_tools --> agent_agent;
34+
agent_agent -.-> agent_tools;
35+
agent_agent -.-> agent___end__;
36+
end
37+
classDef default fill:#f2f0ff,line-height:1.2
38+
classDef first fill-opacity:0
39+
classDef last fill:#bfb6fc
40+
```
41+
42+
## Prerequisites
43+
44+
- Python 3.10+
45+
- `langchain-anthropic`
46+
- `langchain-mcp-adapters`
47+
- `langgraph`
48+
- Anthropic API key set as an environment variable
49+
50+
## Installation
51+
52+
```bash
53+
uv venv -p 3.11 .venv
54+
.venv\Scripts\activate
55+
uv sync
56+
```
57+
58+
Set your API keys and MCP Remote Server URL as environment variables in .env
59+
60+
```bash
61+
ANTHROPIC_API_KEY=your_anthropic_api_key
62+
UIPATH_MCP_SERVER_URL=https://cloud.uipath.com/account/tenant/mcp_/mcp/folder-key/github-mcp/sse
63+
```
64+
65+
## Debugging
66+
67+
For debugging issues:
68+
69+
1. Check logs for any connection or runtime errors:
70+
```bash
71+
uipath run agent '{"owner": "uipath", "repo": "uipath-mcp-python", "pullNumber": 78, "command": "summarize", "in_reply_to": 2060859623}'
72+
```
73+
74+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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>]):::last
10+
__start__ --> hydrate_history;
11+
agent___end__ --> __end__;
12+
hydrate_history --> agent___start__;
13+
subgraph agent
14+
agent___start__(<p>__start__</p>)
15+
agent_agent(agent)
16+
agent_tools(tools)
17+
agent___end__(<p>__end__</p>)
18+
agent___start__ --> agent_agent;
19+
agent_tools --> agent_agent;
20+
agent_agent -.-> agent_tools;
21+
agent_agent -.-> agent___end__;
22+
end
23+
classDef default fill:#f2f0ff,line-height:1.2
24+
classDef first fill-opacity:0
25+
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)