iflow-mcp_sker65-testrail-mcp 0.1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- iflow_mcp_sker65_testrail_mcp-0.1.5/.github/workflows/python-publish.yml +29 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/.gitignore +174 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/Dockerfile +19 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/LICENSE +21 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/PKG-INFO +190 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/README.md +175 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/language.json +1 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/package_name +1 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/push_info.json +5 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/pyproject.toml +29 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/smithery.yaml +37 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/test_mcp.py +77 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/testrail_mcp/__init__.py +1 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/testrail_mcp/__main__.py +14 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/testrail_mcp/config.py +18 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/testrail_mcp/mcp_server.py +645 -0
- iflow_mcp_sker65_testrail_mcp-0.1.5/testrail_mcp/testrail_client.py +216 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Build and Publish Python Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [created]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
deploy:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v3
|
|
12
|
+
|
|
13
|
+
- name: Set up Python
|
|
14
|
+
uses: actions/setup-python@v4
|
|
15
|
+
with:
|
|
16
|
+
python-version: '3.13'
|
|
17
|
+
|
|
18
|
+
- name: Install dependencies
|
|
19
|
+
run: |
|
|
20
|
+
python -m pip install --upgrade pip
|
|
21
|
+
pip install build twine
|
|
22
|
+
|
|
23
|
+
- name: Build package
|
|
24
|
+
run: python -m build
|
|
25
|
+
|
|
26
|
+
- name: Publish package
|
|
27
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
28
|
+
with:
|
|
29
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
|
|
110
|
+
# pdm
|
|
111
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
112
|
+
#pdm.lock
|
|
113
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
114
|
+
# in version control.
|
|
115
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
116
|
+
.pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
121
|
+
__pypackages__/
|
|
122
|
+
|
|
123
|
+
# Celery stuff
|
|
124
|
+
celerybeat-schedule
|
|
125
|
+
celerybeat.pid
|
|
126
|
+
|
|
127
|
+
# SageMath parsed files
|
|
128
|
+
*.sage.py
|
|
129
|
+
|
|
130
|
+
# Environments
|
|
131
|
+
.env
|
|
132
|
+
.venv
|
|
133
|
+
env/
|
|
134
|
+
venv/
|
|
135
|
+
ENV/
|
|
136
|
+
env.bak/
|
|
137
|
+
venv.bak/
|
|
138
|
+
|
|
139
|
+
# Spyder project settings
|
|
140
|
+
.spyderproject
|
|
141
|
+
.spyproject
|
|
142
|
+
|
|
143
|
+
# Rope project settings
|
|
144
|
+
.ropeproject
|
|
145
|
+
|
|
146
|
+
# mkdocs documentation
|
|
147
|
+
/site
|
|
148
|
+
|
|
149
|
+
# mypy
|
|
150
|
+
.mypy_cache/
|
|
151
|
+
.dmypy.json
|
|
152
|
+
dmypy.json
|
|
153
|
+
|
|
154
|
+
# Pyre type checker
|
|
155
|
+
.pyre/
|
|
156
|
+
|
|
157
|
+
# pytype static type analyzer
|
|
158
|
+
.pytype/
|
|
159
|
+
|
|
160
|
+
# Cython debug symbols
|
|
161
|
+
cython_debug/
|
|
162
|
+
|
|
163
|
+
# PyCharm
|
|
164
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
165
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
166
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
167
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
168
|
+
#.idea/
|
|
169
|
+
|
|
170
|
+
# Ruff stuff:
|
|
171
|
+
.ruff_cache/
|
|
172
|
+
|
|
173
|
+
# PyPI configuration file
|
|
174
|
+
.pypirc
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
|
|
2
|
+
FROM python:3.10-slim
|
|
3
|
+
|
|
4
|
+
# Install system dependencies if any
|
|
5
|
+
RUN apt-get update && apt-get install -y --no-install-recommends gcc build-essential \
|
|
6
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
7
|
+
|
|
8
|
+
WORKDIR /app
|
|
9
|
+
|
|
10
|
+
# Copy the project files
|
|
11
|
+
COPY . /app
|
|
12
|
+
|
|
13
|
+
# Upgrade pip and install hatchling
|
|
14
|
+
RUN pip install --no-cache-dir --upgrade pip hatchling
|
|
15
|
+
|
|
16
|
+
# Install the package in editable mode
|
|
17
|
+
RUN pip install -e .
|
|
18
|
+
|
|
19
|
+
CMD ["python", "testrail_mcp/main.py"]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Stefan Rinke
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: iflow-mcp_sker65-testrail-mcp
|
|
3
|
+
Version: 0.1.5
|
|
4
|
+
Summary: TestRail MCP Server
|
|
5
|
+
Author-email: Stefan Rinke <sker65@gmail.com>
|
|
6
|
+
Maintainer-email: Stefan Rinke <sker65@gmail.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Requires-Dist: fastmcp
|
|
11
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
12
|
+
Requires-Dist: python-mcp>=1.0.0
|
|
13
|
+
Requires-Dist: requests>=2.31.0
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# TestRail MCP Server
|
|
17
|
+
|
|
18
|
+
[](https://smithery.ai/server/@sker65/testrail-mcp)
|
|
19
|
+
|
|
20
|
+
A Model Context Protocol (MCP) server for TestRail that allows interaction with TestRail's core entities through a standardized protocol.
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- Authentication with TestRail API
|
|
25
|
+
- Access to TestRail entities:
|
|
26
|
+
- Projects
|
|
27
|
+
- Cases
|
|
28
|
+
- Runs
|
|
29
|
+
- Results
|
|
30
|
+
- Datasets
|
|
31
|
+
- Full support for the Model Context Protocol
|
|
32
|
+
- Compatible with any MCP client (Claude Desktop, Cursor, Windsurf, etc.)
|
|
33
|
+
|
|
34
|
+
## See it in action together with Octomind MCP
|
|
35
|
+
|
|
36
|
+
[](https://www.youtube.com/watch?v=I7lc9I0S62Y)
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
### Installing via Smithery
|
|
41
|
+
|
|
42
|
+
To install testrail-mcp for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@sker65/testrail-mcp):
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx -y @smithery/cli install @sker65/testrail-mcp --client claude
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Manual Installation
|
|
49
|
+
1. Clone this repository:
|
|
50
|
+
```bash
|
|
51
|
+
git clone https://github.com/yourusername/testrail-mcp.git
|
|
52
|
+
cd testrail-mcp
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
2. Create and activate a virtual environment:
|
|
56
|
+
```bash
|
|
57
|
+
python -m venv .venv
|
|
58
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
3. Install dependencies:
|
|
62
|
+
```bash
|
|
63
|
+
pip install -e .
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Configuration
|
|
67
|
+
|
|
68
|
+
The TestRail MCP server requires specific environment variables to authenticate with your TestRail instance. These must be set before running the server.
|
|
69
|
+
|
|
70
|
+
1. Create a `.env` file in the root directory of the project:
|
|
71
|
+
```
|
|
72
|
+
TESTRAIL_URL=https://your-instance.testrail.io
|
|
73
|
+
TESTRAIL_USERNAME=your-email@example.com
|
|
74
|
+
TESTRAIL_API_KEY=your-api-key
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Important Notes:**
|
|
78
|
+
- `TESTRAIL_URL` should be the full URL to your TestRail instance (e.g., `https://example.testrail.io`)
|
|
79
|
+
- `TESTRAIL_USERNAME` is your TestRail email address used for login
|
|
80
|
+
- `TESTRAIL_API_KEY` is your TestRail API key (not your password)
|
|
81
|
+
- To generate an API key, log in to TestRail, go to "My Settings" > "API Keys" and create a new key
|
|
82
|
+
|
|
83
|
+
2. Verify that the configuration is loaded correctly:
|
|
84
|
+
```bash
|
|
85
|
+
uvx testrail-mcp --config
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
This will display your TestRail configuration information, including your URL, username, and the first few characters of your API key for verification.
|
|
89
|
+
|
|
90
|
+
If you're using this server with a client like Claude Desktop or Cursor, make sure the environment variables are accessible to the process running the server. You may need to set these variables in your system environment or ensure they're loaded from the `.env` file.
|
|
91
|
+
|
|
92
|
+
## Usage
|
|
93
|
+
|
|
94
|
+
### Running the Server
|
|
95
|
+
|
|
96
|
+
The server can be run directly using the installed script:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
uvx testrail-mcp
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
This will start the MCP server in stdio mode, which can be used with MCP clients that support stdio communication.
|
|
103
|
+
|
|
104
|
+
### Using with MCP Clients
|
|
105
|
+
|
|
106
|
+
#### Claude Desktop
|
|
107
|
+
|
|
108
|
+
In Claude Desktop, add a new server with the following configuration:
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"mcpServers": {
|
|
113
|
+
"testrail": {
|
|
114
|
+
"command": "uvx",
|
|
115
|
+
"args": [
|
|
116
|
+
"testrail-mcp"
|
|
117
|
+
],
|
|
118
|
+
"env": {
|
|
119
|
+
"TESTRAIL_URL": "https://your-instance.testrail.io",
|
|
120
|
+
"TESTRAIL_USERNAME": "your-email@example.com",
|
|
121
|
+
"TESTRAIL_API_KEY": "your-api-key"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### Cursor
|
|
129
|
+
|
|
130
|
+
In Cursor, add a new custom tool with the following configuration:
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"name": "TestRail MCP",
|
|
135
|
+
"command": "uvx",
|
|
136
|
+
"args": [
|
|
137
|
+
"testrail-mcp"
|
|
138
|
+
],
|
|
139
|
+
"env": {
|
|
140
|
+
"TESTRAIL_URL": "https://your-instance.testrail.io",
|
|
141
|
+
"TESTRAIL_USERNAME": "your-email@example.com",
|
|
142
|
+
"TESTRAIL_API_KEY": "your-api-key"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### Windsurf
|
|
148
|
+
|
|
149
|
+
In Windsurf, add a new tool with the following configuration:
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"name": "TestRail MCP",
|
|
154
|
+
"command": "uvx",
|
|
155
|
+
"args": [
|
|
156
|
+
"testrail-mcp"
|
|
157
|
+
],
|
|
158
|
+
"env": {
|
|
159
|
+
"TESTRAIL_URL": "https://your-instance.testrail.io",
|
|
160
|
+
"TESTRAIL_USERNAME": "your-email@example.com",
|
|
161
|
+
"TESTRAIL_API_KEY": "your-api-key"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### Testing with MCP Inspector
|
|
167
|
+
|
|
168
|
+
For testing and debugging, you can use the MCP Inspector:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
npx @modelcontextprotocol/inspector \
|
|
172
|
+
-e TESTRAIL_URL=<your-url> \
|
|
173
|
+
-e TESTRAIL_USERNAME=<your-username> \
|
|
174
|
+
-e TESTRAIL_API_KEY=<your-api-key> \
|
|
175
|
+
uvx testrail-mcp
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
This will open a web interface where you can explore and test all the available tools and resources.
|
|
179
|
+
|
|
180
|
+
## Development
|
|
181
|
+
|
|
182
|
+
This server is built using:
|
|
183
|
+
|
|
184
|
+
- [FastMCP](https://github.com/jlowin/fastmcp) - A Python framework for building MCP servers
|
|
185
|
+
- [Requests](https://requests.readthedocs.io/) - For HTTP communication with TestRail API
|
|
186
|
+
- [python-dotenv](https://github.com/theskumar/python-dotenv) - For environment variable management
|
|
187
|
+
|
|
188
|
+
## License
|
|
189
|
+
|
|
190
|
+
MIT
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# TestRail MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://smithery.ai/server/@sker65/testrail-mcp)
|
|
4
|
+
|
|
5
|
+
A Model Context Protocol (MCP) server for TestRail that allows interaction with TestRail's core entities through a standardized protocol.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Authentication with TestRail API
|
|
10
|
+
- Access to TestRail entities:
|
|
11
|
+
- Projects
|
|
12
|
+
- Cases
|
|
13
|
+
- Runs
|
|
14
|
+
- Results
|
|
15
|
+
- Datasets
|
|
16
|
+
- Full support for the Model Context Protocol
|
|
17
|
+
- Compatible with any MCP client (Claude Desktop, Cursor, Windsurf, etc.)
|
|
18
|
+
|
|
19
|
+
## See it in action together with Octomind MCP
|
|
20
|
+
|
|
21
|
+
[](https://www.youtube.com/watch?v=I7lc9I0S62Y)
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
### Installing via Smithery
|
|
26
|
+
|
|
27
|
+
To install testrail-mcp for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@sker65/testrail-mcp):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx -y @smithery/cli install @sker65/testrail-mcp --client claude
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Manual Installation
|
|
34
|
+
1. Clone this repository:
|
|
35
|
+
```bash
|
|
36
|
+
git clone https://github.com/yourusername/testrail-mcp.git
|
|
37
|
+
cd testrail-mcp
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
2. Create and activate a virtual environment:
|
|
41
|
+
```bash
|
|
42
|
+
python -m venv .venv
|
|
43
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
3. Install dependencies:
|
|
47
|
+
```bash
|
|
48
|
+
pip install -e .
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Configuration
|
|
52
|
+
|
|
53
|
+
The TestRail MCP server requires specific environment variables to authenticate with your TestRail instance. These must be set before running the server.
|
|
54
|
+
|
|
55
|
+
1. Create a `.env` file in the root directory of the project:
|
|
56
|
+
```
|
|
57
|
+
TESTRAIL_URL=https://your-instance.testrail.io
|
|
58
|
+
TESTRAIL_USERNAME=your-email@example.com
|
|
59
|
+
TESTRAIL_API_KEY=your-api-key
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Important Notes:**
|
|
63
|
+
- `TESTRAIL_URL` should be the full URL to your TestRail instance (e.g., `https://example.testrail.io`)
|
|
64
|
+
- `TESTRAIL_USERNAME` is your TestRail email address used for login
|
|
65
|
+
- `TESTRAIL_API_KEY` is your TestRail API key (not your password)
|
|
66
|
+
- To generate an API key, log in to TestRail, go to "My Settings" > "API Keys" and create a new key
|
|
67
|
+
|
|
68
|
+
2. Verify that the configuration is loaded correctly:
|
|
69
|
+
```bash
|
|
70
|
+
uvx testrail-mcp --config
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
This will display your TestRail configuration information, including your URL, username, and the first few characters of your API key for verification.
|
|
74
|
+
|
|
75
|
+
If you're using this server with a client like Claude Desktop or Cursor, make sure the environment variables are accessible to the process running the server. You may need to set these variables in your system environment or ensure they're loaded from the `.env` file.
|
|
76
|
+
|
|
77
|
+
## Usage
|
|
78
|
+
|
|
79
|
+
### Running the Server
|
|
80
|
+
|
|
81
|
+
The server can be run directly using the installed script:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
uvx testrail-mcp
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
This will start the MCP server in stdio mode, which can be used with MCP clients that support stdio communication.
|
|
88
|
+
|
|
89
|
+
### Using with MCP Clients
|
|
90
|
+
|
|
91
|
+
#### Claude Desktop
|
|
92
|
+
|
|
93
|
+
In Claude Desktop, add a new server with the following configuration:
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"mcpServers": {
|
|
98
|
+
"testrail": {
|
|
99
|
+
"command": "uvx",
|
|
100
|
+
"args": [
|
|
101
|
+
"testrail-mcp"
|
|
102
|
+
],
|
|
103
|
+
"env": {
|
|
104
|
+
"TESTRAIL_URL": "https://your-instance.testrail.io",
|
|
105
|
+
"TESTRAIL_USERNAME": "your-email@example.com",
|
|
106
|
+
"TESTRAIL_API_KEY": "your-api-key"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### Cursor
|
|
114
|
+
|
|
115
|
+
In Cursor, add a new custom tool with the following configuration:
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"name": "TestRail MCP",
|
|
120
|
+
"command": "uvx",
|
|
121
|
+
"args": [
|
|
122
|
+
"testrail-mcp"
|
|
123
|
+
],
|
|
124
|
+
"env": {
|
|
125
|
+
"TESTRAIL_URL": "https://your-instance.testrail.io",
|
|
126
|
+
"TESTRAIL_USERNAME": "your-email@example.com",
|
|
127
|
+
"TESTRAIL_API_KEY": "your-api-key"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
#### Windsurf
|
|
133
|
+
|
|
134
|
+
In Windsurf, add a new tool with the following configuration:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"name": "TestRail MCP",
|
|
139
|
+
"command": "uvx",
|
|
140
|
+
"args": [
|
|
141
|
+
"testrail-mcp"
|
|
142
|
+
],
|
|
143
|
+
"env": {
|
|
144
|
+
"TESTRAIL_URL": "https://your-instance.testrail.io",
|
|
145
|
+
"TESTRAIL_USERNAME": "your-email@example.com",
|
|
146
|
+
"TESTRAIL_API_KEY": "your-api-key"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### Testing with MCP Inspector
|
|
152
|
+
|
|
153
|
+
For testing and debugging, you can use the MCP Inspector:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npx @modelcontextprotocol/inspector \
|
|
157
|
+
-e TESTRAIL_URL=<your-url> \
|
|
158
|
+
-e TESTRAIL_USERNAME=<your-username> \
|
|
159
|
+
-e TESTRAIL_API_KEY=<your-api-key> \
|
|
160
|
+
uvx testrail-mcp
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
This will open a web interface where you can explore and test all the available tools and resources.
|
|
164
|
+
|
|
165
|
+
## Development
|
|
166
|
+
|
|
167
|
+
This server is built using:
|
|
168
|
+
|
|
169
|
+
- [FastMCP](https://github.com/jlowin/fastmcp) - A Python framework for building MCP servers
|
|
170
|
+
- [Requests](https://requests.readthedocs.io/) - For HTTP communication with TestRail API
|
|
171
|
+
- [python-dotenv](https://github.com/theskumar/python-dotenv) - For environment variable management
|
|
172
|
+
|
|
173
|
+
## License
|
|
174
|
+
|
|
175
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
python
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
iflow-mcp_sker65-testrail-mcp
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "iflow-mcp_sker65-testrail-mcp"
|
|
7
|
+
version = "0.1.5"
|
|
8
|
+
description = "TestRail MCP Server"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = [
|
|
11
|
+
{name = "Stefan Rinke", email = "sker65@gmail.com"}
|
|
12
|
+
]
|
|
13
|
+
maintainers = [
|
|
14
|
+
{name = "Stefan Rinke", email = "sker65@gmail.com"}
|
|
15
|
+
]
|
|
16
|
+
requires-python = ">=3.10"
|
|
17
|
+
license = {text = "MIT"}
|
|
18
|
+
dependencies = [
|
|
19
|
+
"requests>=2.31.0",
|
|
20
|
+
"python-dotenv>=1.0.0",
|
|
21
|
+
"python-mcp>=1.0.0",
|
|
22
|
+
"fastmcp",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.scripts]
|
|
26
|
+
testrail-mcp = "testrail_mcp.__main__:main"
|
|
27
|
+
|
|
28
|
+
[tool.hatch.build.targets.wheel]
|
|
29
|
+
packages = ["testrail_mcp"]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml
|
|
2
|
+
|
|
3
|
+
startCommand:
|
|
4
|
+
type: stdio
|
|
5
|
+
configSchema:
|
|
6
|
+
# JSON Schema defining the configuration options for the MCP.
|
|
7
|
+
type: object
|
|
8
|
+
required:
|
|
9
|
+
- testRailUrl
|
|
10
|
+
- testRailUsername
|
|
11
|
+
- testRailApiKey
|
|
12
|
+
properties:
|
|
13
|
+
testRailUrl:
|
|
14
|
+
type: string
|
|
15
|
+
description: The full URL to your TestRail instance.
|
|
16
|
+
testRailUsername:
|
|
17
|
+
type: string
|
|
18
|
+
description: Your TestRail username/email.
|
|
19
|
+
testRailApiKey:
|
|
20
|
+
type: string
|
|
21
|
+
description: Your TestRail API key.
|
|
22
|
+
commandFunction:
|
|
23
|
+
# A JS function that produces the CLI command based on the given config to start the MCP on stdio.
|
|
24
|
+
|-
|
|
25
|
+
(config) => ({
|
|
26
|
+
command: 'python',
|
|
27
|
+
args: ['testrail_mcp/main.py'],
|
|
28
|
+
env: {
|
|
29
|
+
TESTRAIL_URL: config.testRailUrl,
|
|
30
|
+
TESTRAIL_USERNAME: config.testRailUsername,
|
|
31
|
+
TESTRAIL_API_KEY: config.testRailApiKey
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
exampleConfig:
|
|
35
|
+
testRailUrl: https://example.testrail.io
|
|
36
|
+
testRailUsername: user@example.com
|
|
37
|
+
testRailApiKey: abcdef123456
|