Skip to content

Commit 73e485e

Browse files
feat: version/user-agent and doc changes to use public images (#30)
* feat: version and user agent * docs: added public docker info to the README.md * docs: nits
1 parent e6a12e7 commit 73e485e

File tree

8 files changed

+64
-36
lines changed

8 files changed

+64
-36
lines changed

.cursorignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,12 @@ authorized_keys
7272
config/*
7373

7474
# Documentation and Notes
75-
*.md
7675
*.mdx
7776
*.rst
7877
*.txt
7978
docs/*
80-
README*
8179
CHANGELOG*
8280
LICENSE*
83-
CONTRIBUTING*
8481

8582
# Database Files
8683
*.sql

.github/workflows/docker-publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ jobs:
4343
platforms: linux/amd64,linux/arm64
4444
push: true
4545
tags: ${{ steps.vars.outputs.tags }}
46+
build-args: |
47+
VERSION=${{ github.ref_name }}

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ RUN go mod download
88

99
COPY . .
1010

11-
RUN CGO_ENABLED=0 GOOS=linux go build -o razorpay-mcp-server ./cmd/razorpay-mcp-server
11+
ARG VERSION="dev"
12+
13+
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X main.version=${VERSION} -X main.commit=$(git rev-parse HEAD) -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" -o razorpay-mcp-server ./cmd/razorpay-mcp-server
1214

1315
FROM alpine:latest
1416

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
VERSION ?= $(shell git describe --tags --always --dirty --match="v*" 2> /dev/null || echo "dev")
33
BUILD_DATE = $(shell date -u '+%Y-%m-%d')
44
COMMIT = $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
5-
LDFLAGS = -ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.buildDate=$(BUILD_DATE)"
5+
LDFLAGS = -ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(BUILD_DATE)"
66

77
# Go variables
88
GO = go
@@ -17,7 +17,10 @@ all: verify fmt test lint build
1717

1818
# Build docker image
1919
build:
20-
docker build -t $(IMAGE):$(TAG) .
20+
docker build \
21+
--build-arg VERSION="$(VERSION)" \
22+
-t $(IMAGE):$(TAG) \
23+
.
2124

2225
# Run docker container
2326
run:
@@ -31,7 +34,7 @@ local-run:
3134
$(GO) run ./cmd/razorpay-mcp-server
3235

3336
local-build:
34-
$(GO) build -v ./cmd/razorpay-mcp-server
37+
$(GO) build $(LDFLAGS) -v -o razorpay-mcp-server ./cmd/razorpay-mcp-server
3538

3639
# Verify dependencies
3740
verify:

README.md

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -60,33 +60,15 @@ Currently, the Razorpay MCP Server provides the following tools:
6060

6161
To run the Razorpay MCP server, use one of the following methods:
6262

63-
### Using Docker (Recommended)
63+
### Using Public Docker Image (Recommended)
6464

65-
You need to clone the Github repo and build the image for Razorpay MCP Server using `docker`. Do make sure `docker` is installed and running in your system.
65+
You can use the public Razorpay image directly. No need to build anything yourself - just copy-paste the configurations below and make sure Docker is already installed.
6666

67-
```bash
68-
# Run the server
69-
git clone https://github.com/razorpay/razorpay-mcp-server.git
70-
cd razorpay-mcp-server
71-
docker build -t razorpay-mcp-server:latest .
72-
```
67+
> **Note:** To use a specific version instead of the latest, replace `razorpay/mcp` with `razorpay/mcp:v1.0.0` (or your desired version tag) in the configurations below. Available tags can be found on [Docker Hub](https://hub.docker.com/r/razorpay/mcp/tags).
7368
74-
Post this razorpay-mcp-server:latest docker image would be ready in your system.
69+
#### Usage with Claude Desktop
7570

76-
### Build from source
77-
78-
```bash
79-
# Clone the repository
80-
git clone https://github.com/razorpay/razorpay-mcp-server.git
81-
cd razorpay-mcp-server
82-
83-
# Build the binary
84-
go build -o razorpay-mcp-server ./cmd/razorpay-mcp-server
85-
```
86-
87-
Binary `razorpay-mcp-server` would be present in your system post this.
88-
89-
## Usage with Claude Desktop
71+
This will use the public razorpay image
9072

9173
Add the following to your `claude_desktop_config.json`:
9274

@@ -103,7 +85,7 @@ Add the following to your `claude_desktop_config.json`:
10385
"RAZORPAY_KEY_ID",
10486
"-e",
10587
"RAZORPAY_KEY_SECRET",
106-
"razorpay-mcp-server:latest"
88+
"razorpay/mcp"
10789
],
10890
"env": {
10991
"RAZORPAY_KEY_ID": "your_razorpay_key_id",
@@ -118,7 +100,7 @@ Please replace the `your_razorpay_key_id` and `your_razorpay_key_secret` with yo
118100
- Learn about how to configure MCP servers in Claude desktop: [Link](https://modelcontextprotocol.io/quickstart/user)
119101
- How to install Claude Desktop: [Link](https://claude.ai/download)
120102

121-
## Usage with VS Code
103+
#### Usage with VS Code
122104

123105
Add the following to your VS Code settings (JSON):
124106

@@ -150,7 +132,7 @@ Add the following to your VS Code settings (JSON):
150132
"RAZORPAY_KEY_ID",
151133
"-e",
152134
"RAZORPAY_KEY_SECRET",
153-
"razorpay-mcp-server:latest"
135+
"razorpay/mcp"
154136
],
155137
"env": {
156138
"RAZORPAY_KEY_ID": "${input:razorpay_key_id}",
@@ -164,6 +146,46 @@ Add the following to your VS Code settings (JSON):
164146

165147
Learn more about MCP servers in VS Code's [agent mode documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers).
166148

149+
### Build from Docker (Alternative)
150+
151+
You need to clone the Github repo and build the image for Razorpay MCP Server using `docker`. Do make sure `docker` is installed and running in your system.
152+
153+
```bash
154+
# Run the server
155+
git clone https://github.com/razorpay/razorpay-mcp-server.git
156+
cd razorpay-mcp-server
157+
docker build -t razorpay-mcp-server:latest .
158+
```
159+
160+
Once the razorpay-mcp-server:latest docker image is built, you can replace the public image(`razorpay/mcp`) with it in the above configurations.
161+
162+
### Build from source
163+
164+
You can directly build from the source instead of using docker by following these steps:
165+
166+
```bash
167+
# Clone the repository
168+
git clone https://github.com/razorpay/razorpay-mcp-server.git
169+
cd razorpay-mcp-server
170+
171+
# Build the binary
172+
go build -o razorpay-mcp-server ./cmd/razorpay-mcp-server
173+
```
174+
Once the build is ready, you need to specify the path to the binary executable in the `command` option. Here's an example for VS Code settings:
175+
176+
```json
177+
{
178+
"razorpay": {
179+
"command": "/path/to/razorpay-mcp-server",
180+
"args": ["stdio","--log-file=/path/to/rzp-mcp.log"],
181+
"env": {
182+
"RAZORPAY_KEY_ID": "<YOUR_ID>",
183+
"RAZORPAY_KEY_SECRET" : "<YOUR_SECRET>"
184+
}
185+
}
186+
}
187+
```
188+
167189
## Configuration
168190

169191
The server requires the following configuration:

cmd/razorpay-mcp-server/stdio.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ var stdioCmd = &cobra.Command{
3636
secret := viper.GetString("secret")
3737
client := rzpsdk.NewClient(key, secret)
3838

39+
client.SetUserAgent("razorpay-mcp/" + version + "/stdio")
40+
3941
// Get toolsets to enable from config
4042
enabledToolsets := viper.GetStringSlice("toolsets")
4143

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/go-test/deep v1.1.1
77
github.com/gorilla/mux v1.8.1
88
github.com/mark3labs/mcp-go v0.23.1
9-
github.com/razorpay/razorpay-go v1.3.3
9+
github.com/razorpay/razorpay-go v1.3.4
1010
github.com/spf13/cobra v1.9.1
1111
github.com/spf13/viper v1.20.1
1212
github.com/stretchr/testify v1.10.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0
2828
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
2929
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
3030
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
31-
github.com/razorpay/razorpay-go v1.3.3 h1:htVhJPI8SXx7X9POcoGg2uMVzbn8hzv7UP9VvbMYYdw=
32-
github.com/razorpay/razorpay-go v1.3.3/go.mod h1:VcljkUylUJAUEvFfGVv/d5ht1to1dUgF4H1+3nv7i+Q=
31+
github.com/razorpay/razorpay-go v1.3.4 h1:A9DZ18GZDn/bGRjQ9SesTGUNIAEw+IB27512l3I81aI=
32+
github.com/razorpay/razorpay-go v1.3.4/go.mod h1:VcljkUylUJAUEvFfGVv/d5ht1to1dUgF4H1+3nv7i+Q=
3333
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
3434
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
3535
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=

0 commit comments

Comments
 (0)