Skip to content

Commit 865105f

Browse files
authored
Merge pull request #29 from simonbaird/use-quay-image-maybe
Add new shorter "Quick start" method utilizing image from quay.io
2 parents 2bf3f97 + af28751 commit 865105f

File tree

8 files changed

+222
-83
lines changed

8 files changed

+222
-83
lines changed

.containerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.env
22
.venv
33
__pycache__
4-
*.pyc
4+
*.pyc

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[*]
2+
insert_final_newline = true
3+
trim_trailing_whitespace = true

Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ RUN pip install --no-cache-dir -r requirements.txt
1111
COPY . .
1212

1313
# Entrypoint
14-
CMD ["python", "server.py"]
14+
CMD ["python", "server.py"]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

Makefile

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,30 @@ _default: run
33

44
SHELL := /bin/bash
55
SCRIPT_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
6-
IMG := localhost/jira-mcp:latest
76
ENV_FILE := $(HOME)/.rh-jira-mcp.env
87
EXAMPLE_MCP := example.mcp.json
98

10-
.PHONY: build run clean test cursor-config setup
9+
# TODO: Find a better home for this
10+
PUBLIC_IMG := quay.io/sbaird/jira-mcp
11+
LOCAL_IMG := localhost/jira-mcp:latest
12+
13+
IMG := $(LOCAL_IMG)
1114

15+
# To use the pre-built main branch image from https://quay.io/repository/sbaird/jira-mcp?tab=tags
16+
# instead of your locally built image, uncomment this and re-run `make cursor-config`.
17+
#IMG := $(PUBLIC_IMG)
18+
19+
.PHONY: build
1220
build:
1321
@echo "🛠️ Building image"
14-
podman build -t $(IMG) .
22+
podman build -t $(LOCAL_IMG) .
1523

16-
# TODO: Find a better home for this
17-
PUBLIC_IMG := quay.io/sbaird/jira-mcp
24+
# This requires a push credential for quay.io/sbaird/jira-mcp
25+
.PHONY: push
1826
push:
1927
@echo "🛠️ Pushing to $(PUBLIC_IMG)"
2028
@for tag in latest git-$(shell git rev-parse --short HEAD); do \
21-
podman tag $(IMG) $(PUBLIC_IMG):$$tag; \
29+
podman tag $(LOCAL_IMG) $(PUBLIC_IMG):$$tag; \
2230
podman push $(PUBLIC_IMG):$$tag; \
2331
done
2432

@@ -27,9 +35,11 @@ push:
2735
# - The --tty option is used here since we might run this in a
2836
# terminal, but for the mcp.json version we don't use --tty.
2937
# - You can use Ctrl-D to quit nicely.
38+
.PHONY: run
3039
run:
3140
@podman run -i --tty --rm --env-file $(ENV_FILE) $(IMG)
3241

42+
.PHONY: clean
3343
clean:
3444
podman rmi -i $(IMG)
3545

@@ -43,6 +53,7 @@ IMG_ARG_IDX = $(shell yq '.mcpServers.jiraMcp.args|length - 1' $(EXAMPLE_MCP))
4353
# configure Cursor by adding or updating an entry in the ~/.cursor/mcp.json
4454
# file. Beware it might overwrite your customizations.
4555
MCP_JSON=$(HOME)/.cursor/mcp.json
56+
.PHONY: cursor-config
4657
cursor-config:
4758
@echo "🛠️ Modifying $(MCP_JSON)"
4859
@#
@@ -63,4 +74,30 @@ $(ENV_FILE):
6374
@cp example.env $@
6475
@echo "🛠️ Env file created. Edit $@ to add your Jira token"
6576

77+
.PHONY: setup
6678
setup: build cursor-config $(ENV_FILE)
79+
80+
VENV=.venv
81+
$(VENV):
82+
@# black is not in requirements.txt since we don't want it in the image
83+
@python -mvenv $@ && \
84+
source $@/bin/activate && \
85+
pip install --upgrade pip && \
86+
pip install -r requirements.txt && \
87+
pip install black
88+
@echo "Now do this:"
89+
@echo " source $@/bin/activate"
90+
91+
.PHONY: venv-setup
92+
venv-setup: $(VENV)
93+
94+
.PHONY: fmt
95+
fmt:
96+
@black *.py
97+
98+
.PHONY: fmt-check
99+
fmt-check:
100+
@black --check *.py
101+
102+
.PHONY: ci
103+
ci: fmt-check

README.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,43 @@ A containerized Python MCP server for Cursor to provide access to Jira.
1111
See also [redhat-ai-tools/jira-mcp-snowflake](https://github.com/redhat-ai-tools/jira-mcp-snowflake)
1212
which provides another way to access Red Hat Jira data.
1313

14-
## Prerequisites
14+
## Quick Start
15+
16+
1. **Prepare a Jira token**
17+
* Go to [Red Hat Jira Personal Access Tokens](https://issues.redhat.com/secure/ViewProfile.jspa?selectedTab=com.atlassian.pats.pats-plugin:jira-user-personal-access-tokens) and create a token
18+
* Create a .env file similar to [example.env](example.env)
1519

16-
- **podman** - Install with `sudo dnf install podman` (Fedora/RHEL) or `brew install podman` (macOS)
17-
- **make** - Usually pre-installed on most systems
18-
- **yq** - Install with `brew install yq` (macOS)
20+
2. **Configure Cursor**
21+
* In Cursor go to "Settings", "Tools & Integrations", and click "New MCP Server"
22+
* Paste in the following JSON, (or insert just the `jiraMcp` object under the `mcpServers` key).
23+
* Update `"/path/to/your/dotenv/file.env"` to point to the file from step 1.
24+
* Save
1925

20-
## Quick Start
26+
```
27+
{
28+
"mcpServers": {
29+
"jiraMcp": {
30+
"command": "podman",
31+
"args": [
32+
"run",
33+
"-i",
34+
"--rm",
35+
"--env-file",
36+
"/path/to/your/dotenv/file.env",
37+
"quay.io/sbaird/jira-mcp:latest"
38+
],
39+
"description": "A containerized MCP server to query Jira issues"
40+
}
41+
}
42+
}
43+
```
44+
45+
## Quick Start (for developers)
46+
47+
0. **Prerequisites**
48+
- **podman** - Install with `sudo dnf install podman` (Fedora/RHEL) or `brew install podman` (macOS)
49+
- **yq** - Install with `sudo dnf install yq` (Fedora/RHEL) or `brew install yq` (macOS)
50+
- **make** - Usually pre-installed on most systems
2151

2252
1. **Get the code**
2353
```bash
@@ -42,7 +72,7 @@ If you want to turn it on, edit the `.rh-jira-mcp.env` file in your home directo
4272

4373
5. **Check if it is working in Cursor**
4474

45-
To confirm it's working, run Cursor, go to Settings and click on "Tools & Integrations". Under MCP Tools you should see "jiraMcp" with 20 tools enabled if
75+
To confirm it's working, run Cursor, go to Settings and click on "Tools & Integrations". Under MCP Tools you should see "jiraMcp" with 20 tools enabled if
4676
`JIRA_ENABLE_WRITE=false` (the default value) or 30 tools enabled if `JIRA_ENABLE_WRITE=true`.
4777

4878
## Using with an HTTP-based MCP application

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[tool.black]
2+
line-length = 100

0 commit comments

Comments
 (0)