Skip to content

Commit 46ccd2e

Browse files
committed
docs: add SETUP.MD
Adds a top-level SETUP.MD documenting how to provision a clean development environment, run the build, execute the tests, and validate a sample code change end-to-end through a coded agent. PRODEV-622
1 parent 6271d28 commit 46ccd2e

1 file changed

Lines changed: 135 additions & 0 deletions

File tree

SETUP.MD

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# SETUP.MD
2+
3+
This file documents how to provision a clean development environment for `uipath-mcp`, run the build, execute the tests, and validate a sample code change end-to-end. It is intended both as a quick reference for human contributors and as a structured guide for automated environment-setup tooling.
4+
5+
## Prerequisites
6+
7+
- Python 3.11+
8+
- [uv](https://docs.astral.sh/uv/) 0.5+
9+
10+
### Supported platforms
11+
12+
`uv` is shell- and OS-agnostic, so the commands below run unchanged on every supported platform:
13+
14+
- [x] Linux
15+
- [x] Windows
16+
- [x] macOS
17+
18+
## Environment Variables
19+
20+
### Standard
21+
22+
None of the common shared environment variables (e.g. `AZURE_DEVOPS_PAT`, `GH_NPM_REGISTRY_TOKEN`) are required for environment setup, build, or unit tests.
23+
24+
### Project-specific
25+
26+
None. The unit-test suite under the `Test` section below runs fully offline and requires no external authentication.
27+
28+
## Setup
29+
30+
```bash
31+
# Install uv if not already on PATH
32+
python3 -m pip install --upgrade uv
33+
34+
# Sync the package with dev dependencies
35+
uv sync --all-extras
36+
```
37+
38+
## Verify Setup
39+
40+
```bash
41+
python3 --version
42+
uv --version
43+
uv run python -c "import uipath_mcp; print('uipath_mcp ok')"
44+
```
45+
46+
## Build
47+
48+
```bash
49+
# Compile every Python module to bytecode — fast syntax/import validation,
50+
# no publish artifacts produced.
51+
uv run python -m compileall src/
52+
```
53+
54+
## Test
55+
56+
```bash
57+
uv run pytest
58+
```
59+
60+
## Sample Code Change
61+
62+
### The change
63+
64+
Add a new `server_count` property to `McpConfig` in `src/uipath_mcp/_cli/_utils/_config.py`, immediately after the existing `get_server_names` method:
65+
66+
```python
67+
@property
68+
def server_count(self) -> int:
69+
"""Number of MCP servers currently loaded from configuration."""
70+
return len(self._servers)
71+
```
72+
73+
Then create `tests/test_config_server_count.py` with two pytest tests:
74+
75+
```python
76+
"""Tests for McpConfig.server_count."""
77+
78+
import json
79+
from pathlib import Path
80+
81+
from uipath_mcp._cli._utils._config import McpConfig
82+
83+
84+
def test_server_count_empty(tmp_path: Path) -> None:
85+
config_path = tmp_path / "mcp.json"
86+
config_path.write_text(json.dumps({"servers": {}}))
87+
cfg = McpConfig(str(config_path))
88+
assert cfg.server_count == 0
89+
90+
91+
def test_server_count_multiple(tmp_path: Path) -> None:
92+
config_path = tmp_path / "mcp.json"
93+
config_path.write_text(
94+
json.dumps(
95+
{
96+
"servers": {
97+
"alpha": {"command": "node", "args": ["alpha.js"]},
98+
"beta": {"command": "node", "args": ["beta.js"]},
99+
}
100+
}
101+
)
102+
)
103+
cfg = McpConfig(str(config_path))
104+
assert cfg.server_count == 2
105+
```
106+
107+
### Verification
108+
109+
```bash
110+
uv run pytest tests/test_config_server_count.py -v
111+
```
112+
113+
## Test with an agent (coded MCP for this example)
114+
115+
The unit tests above are necessary but not sufficient — they don't exercise the package end-to-end through a real agent. The flow below validates changes against a live MCP/agent runtime:
116+
117+
1. Apply the code changes locally.
118+
2. Run the unit tests (see the `Sample Code Change` section above).
119+
3. Scaffold a coded agent (or coded MCP) that exercises the changed code path.
120+
4. In the downstream project's `pyproject.toml`, add this local library as an editable dependency:
121+
122+
```toml
123+
[tool.uv.sources]
124+
uipath-mcp = { path = "../path/to/uipath-mcp-python", editable = true }
125+
```
126+
127+
5. Exercise the new behavior end-to-end:
128+
129+
```bash
130+
uv run uipath run <agent-name> --input '{...}'
131+
```
132+
133+
6. (Optional) Open a PR and apply the `build:dev` label — this publishes the development version to Test PyPI.
134+
7. The PR description is updated automatically with instructions for pointing the downstream agent at the Test PyPI dev version.
135+
8. Deploy the agent (or coded MCP) to Orchestrator / Studio Web and run it in cloud to confirm the changes behave correctly against the real platform.

0 commit comments

Comments
 (0)