@rapay/mcp-server 1.2.4 → 1.2.5

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 MCP Contributors
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.
package/README.md CHANGED
@@ -1,343 +1,153 @@
1
- # Ra Pay MCP Server
2
-
3
- MCP (Model Context Protocol) server for AI agent payment automation. Enables Claude Desktop, Claude API, and ChatGPT to execute payments via Ra Pay CLI.
4
-
5
- **Status:** Perplexity Security Review APPROVED (98% confidence)
6
-
7
- ## Features
8
-
9
- - 6 MVP tools for payment operations
10
- - Subprocess isolation (credentials never leave keyring)
11
- - Response sanitization (prevents prompt injection)
12
- - Rate limiting (1 payment/min, 10 queries/min)
13
- - Audit logging
14
-
15
- ## Installation
16
-
17
- ### Prerequisites
18
-
19
- - Node.js 18+
20
- - Ra Pay CLI installed and authenticated (`ra link-bank`)
21
-
22
- ### Setup
23
-
24
- ```bash
25
- cd rapay/mcp-server
26
- npm install
27
- npm run build
28
- ```
29
-
30
- ### Claude Desktop Configuration
31
-
32
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
33
-
34
- ```json
35
- {
36
- "mcpServers": {
37
- "rapay": {
38
- "command": "node",
39
- "args": ["/Users/yourname/rapay/mcp-server/dist/index.js"]
40
- }
41
- }
42
- }
43
- ```
44
-
45
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
46
-
47
- ```json
48
- {
49
- "mcpServers": {
50
- "rapay": {
51
- "command": "node",
52
- "args": ["C:\\Users\\yourname\\rapay\\mcp-server\\dist\\index.js"]
53
- }
54
- }
55
- }
56
- ```
57
-
58
- **With custom CLI path:**
59
-
60
- ```json
61
- {
62
- "mcpServers": {
63
- "rapay": {
64
- "command": "node",
65
- "args": ["/path/to/rapay/mcp-server/dist/index.js"],
66
- "env": {
67
- "RAPAY_CLI_PATH": "/custom/path/to/ra"
68
- }
69
- }
70
- }
71
- }
72
- ```
73
-
74
- After adding, restart Claude Desktop. You should see "rapay" in the MCP servers list.
75
-
76
- ## Tools
77
-
78
- ### Payment Operations (SENSITIVE)
79
-
80
- | Tool | Description |
81
- |------|-------------|
82
- | `ra_send` | Execute a payment transaction |
83
- | `ra_subscribe` | Create a subscription for a customer |
84
- | `ra_refund` | Open Stripe Dashboard for refunds |
85
-
86
- ### Query Operations
87
-
88
- | Tool | Description |
89
- |------|-------------|
90
- | `ra_balance` | Check available balance |
91
- | `ra_history` | Get transaction history |
92
- | `ra_whoami` | Check account status |
93
-
94
- ## Security
95
-
96
- ### Subprocess Isolation
97
-
98
- MCP server spawns Ra Pay CLI as subprocess. Credentials remain in OS keyring - MCP server never sees them directly.
99
-
100
- ### Response Sanitization
101
-
102
- All CLI output is sanitized to prevent prompt injection:
103
- - ANSI escape sequences removed
104
- - System markers filtered (`[SYSTEM]`, `[USER]`, etc.)
105
- - Control characters stripped
106
-
107
- ### Rate Limiting
108
-
109
- Defense-in-depth layer at MCP level:
110
-
111
- | Tool | Limit |
112
- |------|-------|
113
- | `ra_send` | 1 per 60 seconds |
114
- | `ra_subscribe` | 1 per 60 seconds |
115
- | `ra_refund` | 5 per 60 seconds |
116
- | `ra_balance` | 10 per 60 seconds |
117
- | `ra_history` | 10 per 60 seconds |
118
- | `ra_whoami` | 20 per 60 seconds |
119
-
120
- Note: Backend also enforces velocity controls (account-tier daily limits).
121
-
122
- ## Privacy & Data Storage
123
-
124
- Ra Pay is designed as a "dumb pipe" to Stripe:
125
-
126
- **What Ra Pay stores:**
127
- - Your user ID
128
- - Your Stripe account ID (encrypted)
129
- - Action logs: "payment sent", "balance checked" (no amounts)
130
- - Transaction audit trail with Stripe transfer IDs
131
-
132
- **What Ra Pay does NOT store:**
133
- - Your payment amounts
134
- - Recipient details
135
- - Payment descriptions
136
- - Your account balance
137
- - Any personally identifiable information (Stripe handles KYC)
138
-
139
- **What MCP server adds:**
140
- - Client type tracking ("called via Claude Desktop")
141
- - Tool call audit logs (same privacy level as above)
142
- - No new PII storage
143
-
144
- ## Configuration
145
-
146
- ### Environment Variables
147
-
148
- | Variable | Description | Default |
149
- |----------|-------------|---------|
150
- | `RAPAY_CLI_PATH` | Path to Ra Pay CLI executable | `ra` |
151
-
152
- ### Audit Logging
153
-
154
- Logs are written to `~/.rapay/mcp-audit.log` with 7-day retention:
155
- - Tool name, timestamp, duration
156
- - Result (success/error/rate_limited)
157
- - Sanitized inputs (amounts redacted, emails masked)
158
-
159
- ## Error Handling
160
-
161
- ### Error Codes
162
-
163
- | Code | Description | Retryable |
164
- |------|-------------|-----------|
165
- | `RATE_LIMIT_EXCEEDED` | MCP rate limit hit | No (wait) |
166
- | `CLI_NOT_FOUND` | Ra Pay CLI not installed | No |
167
- | `TOS_ACCEPTANCE_REQUIRED` | ToS not accepted | No |
168
- | `ACCOUNT_NOT_LINKED` | Stripe account not linked | No |
169
- | `VELOCITY_EXCEEDED` | Daily limit exceeded | No |
170
- | `TIMEOUT` | Request timed out | Yes |
171
- | `NETWORK_ERROR` | Network connectivity issue | Yes |
172
- | `EXECUTION_FAILED` | Generic CLI error | No |
173
-
174
- ### Rate Limit Error
175
-
176
- ```json
177
- {
178
- "error": "rate_limit_exceeded",
179
- "code": "RATE_LIMIT_EXCEEDED",
180
- "message": "Too many requests. Please wait 60 seconds.",
181
- "retry_after_seconds": 60,
182
- "retryable": false
183
- }
184
- ```
185
-
186
- ### CLI Not Found Error
187
-
188
- ```json
189
- {
190
- "error": "cli_not_found",
191
- "code": "CLI_NOT_FOUND",
192
- "message": "Ra Pay CLI not found. Please install it first.",
193
- "retryable": false
194
- }
195
- ```
196
-
197
- ### ToS Required Error
198
-
199
- ```json
200
- {
201
- "error": "tos_required",
202
- "code": "TOS_ACCEPTANCE_REQUIRED",
203
- "message": "Terms of Service must be accepted. Run 'ra accept-tos' first.",
204
- "retryable": false
205
- }
206
- ```
207
-
208
- ### For Claude API Callers: Exponential Backoff
209
-
210
- If you receive `RATE_LIMIT_EXCEEDED`, implement exponential backoff:
211
-
212
- ```typescript
213
- const maxRetries = 3;
214
- let delay = 60; // seconds
215
-
216
- for (let attempt = 0; attempt < maxRetries; attempt++) {
217
- try {
218
- return await mcp.callTool('ra_send', params);
219
- } catch (error) {
220
- if (error.code === 'RATE_LIMIT_EXCEEDED') {
221
- console.log(`Rate limited. Waiting ${delay}s before retry...`);
222
- await sleep(delay * 1000);
223
- delay *= 2; // exponential backoff
224
- } else {
225
- throw error;
226
- }
227
- }
228
- }
229
-
230
- // DO NOT:
231
- // - Retry immediately (wastes time, still rate limited)
232
- // - Retry more than 3 times (indicates genuine rate limit)
233
- // - Ignore retry_after_seconds field
234
- ```
235
-
236
- Note: MCP rate limiting is client-side defense-in-depth. Backend also enforces velocity controls per account tier.
237
-
238
- ## Data Flow
239
-
240
- ```
241
- You (Claude Desktop/API)
242
- |
243
- v
244
- MCP Server (this package)
245
- | - Logs tool calls (no amounts/PII)
246
- | - Rate limits requests
247
- | - Sanitizes responses
248
- v
249
- Ra Pay CLI (subprocess)
250
- | - Credentials in OS keyring
251
- | - Adds replay protection
252
- v
253
- Ra Pay Backend
254
- | - Validates requests
255
- | - Enforces velocity limits
256
- v
257
- Stripe API
258
- | - Owns all PII
259
- | - Processes payments
260
- v
261
- Recipient's Bank
262
- ```
263
-
264
- All sensitive data flows directly to Stripe. Ra Pay only records that an action occurred.
265
-
266
- ## Security Model
267
-
268
- This section documents the security posture of the published npm package.
269
-
270
- ### What's Published to npm
271
-
272
- | Category | Included | Excluded |
273
- |----------|----------|----------|
274
- | Compiled JavaScript | Yes | - |
275
- | TypeScript declarations | Yes | - |
276
- | Source maps (.js.map) | No | Excluded for code privacy |
277
- | Source code (src/) | No | Development only |
278
-
279
- ### Intentionally Public Information
280
-
281
- | Metadata | Value | Rationale |
282
- |----------|-------|-----------|
283
- | Repository | github.com/Ra-Pay-AI/rapay | Open source by design |
284
- | Author | Ra Pay | Company name |
285
- | License | MIT | Standard permissive license |
286
- | Keywords | mcp, payments, stripe, claude | Discoverability |
287
-
288
- ### Security Features Exposed (By Design)
289
-
290
- These are documented for users and do not represent vulnerabilities:
291
-
292
- - **Rate limiting rules** - Users need to know limits to implement backoff
293
- - **Error codes** - Required for proper error handling
294
- - **Tool schemas** - Required by MCP protocol specification
295
- - **Audit log location** (~/.rapay/mcp-audit.log) - Users may need to inspect
296
-
297
- ### What Is NOT Exposed
298
-
299
- | Category | Protection |
300
- |----------|------------|
301
- | API keys/secrets | Never in code (OS keyring only) |
302
- | Backend URLs | Only public rapay.ai endpoints |
303
- | User data | Subprocess isolation, never in MCP process |
304
- | Payment amounts | Redacted as `[redacted]` in all logs |
305
- | Email addresses | Masked (j***@example.com) in audit logs |
306
-
307
- ### Subprocess Isolation Model
308
-
309
- ```
310
- ┌─────────────────────┐
311
- │ AI Agent (Claude) │
312
- └─────────┬───────────┘
313
- │ MCP Protocol (stdio)
314
-
315
- ┌─────────────────────┐
316
- │ MCP Server (npm) │ ← No credentials here
317
- │ - Rate limiting │
318
- │ - Input validation │
319
- │ - Response sanitize│
320
- └─────────┬───────────┘
321
- │ Spawns subprocess
322
-
323
- ┌─────────────────────┐
324
- │ Ra Pay CLI │ ← Credentials in OS keyring
325
- │ - Session tokens │
326
- │ - Stripe API calls │
327
- └─────────────────────┘
328
- ```
329
-
330
- The MCP server never has access to credentials. All sensitive operations are delegated to the CLI subprocess, which reads credentials directly from the OS keyring.
331
-
332
- ## Development
333
-
334
- ```bash
335
- npm run dev # Watch mode
336
- npm run build # Build
337
- npm run lint # Lint
338
- npm run test # Test
339
- ```
340
-
341
- ## License
342
-
343
- MIT
1
+ # MCP Registry
2
+
3
+ The MCP registry provides MCP clients with a list of MCP servers, like an app store for MCP servers.
4
+
5
+ [**📤 Publish my MCP server**](docs/modelcontextprotocol-io/quickstart.mdx) | [**⚡️ Live API docs**](https://registry.modelcontextprotocol.io/docs) | [**👀 Ecosystem vision**](docs/design/ecosystem-vision.md) | 📖 **[Full documentation](./docs)**
6
+
7
+ ## Development Status
8
+
9
+ **2025-10-24 update**: The Registry API has entered an **API freeze (v0.1)** 🎉. For the next month or more, the API will remain stable with no breaking changes, allowing integrators to confidently implement support. This freeze applies to v0.1 while development continues on v0. We'll use this period to validate the API in real-world integrations and gather feedback to shape v1 for general availability. Thank you to everyone for your contributions and patience—your involvement has been key to getting us here!
10
+
11
+ **2025-09-08 update**: The registry has launched in preview 🎉 ([announcement blog post](https://blog.modelcontextprotocol.io/posts/2025-09-08-mcp-registry-preview/)). While the system is now more stable, this is still a preview release and breaking changes or data resets may occur. A general availability (GA) release will follow later. We'd love your feedback in [GitHub discussions](https://github.com/modelcontextprotocol/registry/discussions/new?category=ideas) or in the [#registry-dev Discord](https://discord.com/channels/1358869848138059966/1369487942862504016) ([joining details here](https://modelcontextprotocol.io/community/communication)).
12
+
13
+ Current key maintainers:
14
+ - **Adam Jones** (Anthropic) [@domdomegg](https://github.com/domdomegg)
15
+ - **Tadas Antanavicius** (PulseMCP) [@tadasant](https://github.com/tadasant)
16
+ - **Toby Padilla** (GitHub) [@toby](https://github.com/toby)
17
+ - **Radoslav (Rado) Dimitrov** (Stacklok) [@rdimitrov](https://github.com/rdimitrov)
18
+
19
+ ## Contributing
20
+
21
+ We use multiple channels for collaboration - see [modelcontextprotocol.io/community/communication](https://modelcontextprotocol.io/community/communication).
22
+
23
+ Often (but not always) ideas flow through this pipeline:
24
+
25
+ - **[Discord](https://modelcontextprotocol.io/community/communication)** - Real-time community discussions
26
+ - **[Discussions](https://github.com/modelcontextprotocol/registry/discussions)** - Propose and discuss product/technical requirements
27
+ - **[Issues](https://github.com/modelcontextprotocol/registry/issues)** - Track well-scoped technical work
28
+ - **[Pull Requests](https://github.com/modelcontextprotocol/registry/pulls)** - Contribute work towards issues
29
+
30
+ ### Quick start:
31
+
32
+ #### Pre-requisites
33
+
34
+ - **Docker**
35
+ - **Go 1.24.x**
36
+ - **ko** - Container image builder for Go ([installation instructions](https://ko.build/install/))
37
+ - **golangci-lint v2.4.0**
38
+
39
+ #### Running the server
40
+
41
+ ```bash
42
+ # Start full development environment
43
+ make dev-compose
44
+ ```
45
+
46
+ This starts the registry at [`localhost:8080`](http://localhost:8080) with PostgreSQL. The database uses ephemeral storage and is reset each time you restart the containers, ensuring a clean state for development and testing.
47
+
48
+ **Note:** The registry uses [ko](https://ko.build) to build container images. The `make dev-compose` command automatically builds the registry image with ko and loads it into your local Docker daemon before starting the services.
49
+
50
+ By default, the registry seeds from the production API with a filtered subset of servers (to keep startup fast). This ensures your local environment mirrors production behavior and all seed data passes validation. For offline development you can seed from a file without validation with `MCP_REGISTRY_SEED_FROM=data/seed.json MCP_REGISTRY_ENABLE_REGISTRY_VALIDATION=false make dev-compose`.
51
+
52
+ The setup can be configured with environment variables in [docker-compose.yml](./docker-compose.yml) - see [.env.example](./.env.example) for a reference.
53
+
54
+ <details>
55
+ <summary>Alternative: Running a pre-built Docker image</summary>
56
+
57
+ Pre-built Docker images are automatically published to GitHub Container Registry:
58
+
59
+ ```bash
60
+ # Run latest stable release
61
+ docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:latest
62
+
63
+ # Run latest from main branch (continuous deployment)
64
+ docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:main
65
+
66
+ # Run specific release version
67
+ docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:v1.0.0
68
+
69
+ # Run development build from main branch
70
+ docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:main-20250906-abc123d
71
+ ```
72
+
73
+ **Available tags:**
74
+ - **Releases**: `latest`, `v1.0.0`, `v1.1.0`, etc.
75
+ - **Continuous**: `main` (latest main branch build)
76
+ - **Development**: `main-<date>-<sha>` (specific commit builds)
77
+
78
+ </details>
79
+
80
+ #### Publishing a server
81
+
82
+ To publish a server, we've built a simple CLI. You can use it with:
83
+
84
+ ```bash
85
+ # Build the latest CLI
86
+ make publisher
87
+
88
+ # Use it!
89
+ ./bin/mcp-publisher --help
90
+ ```
91
+
92
+ See [the publisher guide](./docs/modelcontextprotocol-io/quickstart.mdx) for more details.
93
+
94
+ #### Other commands
95
+
96
+ ```bash
97
+ # Run lint, unit tests and integration tests
98
+ make check
99
+ ```
100
+
101
+ There are also a few more helpful commands for development. Run `make help` to learn more, or look in [Makefile](./Makefile).
102
+
103
+ <!--
104
+ For Claude and other AI tools: Always prefer make targets over custom commands where possible.
105
+ -->
106
+
107
+ ## Architecture
108
+
109
+ ### Project Structure
110
+
111
+ ```
112
+ ├── cmd/ # Application entry points
113
+ │ └── publisher/ # Server publishing tool
114
+ ├── data/ # Seed data
115
+ ├── deploy/ # Deployment configuration (Pulumi)
116
+ ├── docs/ # Documentation
117
+ ├── internal/ # Private application code
118
+ │ ├── api/ # HTTP handlers and routing
119
+ │ ├── auth/ # Authentication (GitHub OAuth, JWT, namespace blocking)
120
+ │ ├── config/ # Configuration management
121
+ │ ├── database/ # Data persistence (PostgreSQL)
122
+ │ ├── service/ # Business logic
123
+ │ ├── telemetry/ # Metrics and monitoring
124
+ │ └── validators/ # Input validation
125
+ ├── pkg/ # Public packages
126
+ │ ├── api/ # API types and structures
127
+ │ │ └── v0/ # Version 0 API types
128
+ │ └── model/ # Data models for server.json
129
+ ├── scripts/ # Development and testing scripts
130
+ ├── tests/ # Integration tests
131
+ └── tools/ # CLI tools and utilities
132
+ └── validate-*.sh # Schema validation tools
133
+ ```
134
+
135
+ ### Authentication
136
+
137
+ Publishing supports multiple authentication methods:
138
+ - **GitHub OAuth** - For publishing by logging into GitHub
139
+ - **GitHub OIDC** - For publishing from GitHub Actions
140
+ - **DNS verification** - For proving ownership of a domain and its subdomains
141
+ - **HTTP verification** - For proving ownership of a domain
142
+
143
+ The registry validates namespace ownership when publishing. E.g. to publish...:
144
+ - `io.github.domdomegg/my-cool-mcp` you must login to GitHub as `domdomegg`, or be in a GitHub Action on domdomegg's repos
145
+ - `me.adamjones/my-cool-mcp` you must prove ownership of `adamjones.me` via DNS or HTTP challenge
146
+
147
+ ## Community Projects
148
+
149
+ Check out [community projects](docs/community-projects.md) to explore notable registry-related work created by the community.
150
+
151
+ ## More documentation
152
+
153
+ See the [documentation](./docs) for more details if your question has not been answered here!
package/dist/index.d.ts CHANGED
@@ -13,5 +13,5 @@
13
13
  * - Privacy preserved (dumb pipe model intact)
14
14
  * - No blockers
15
15
  */
16
- export declare const SERVER_VERSION = "1.2.4";
16
+ export declare const SERVER_VERSION = "1.2.5";
17
17
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import { checkForUpdates } from "./version-check.js";
23
23
  * Server metadata
24
24
  */
25
25
  const SERVER_NAME = "rapay-mcp";
26
- export const SERVER_VERSION = "1.2.4";
26
+ export const SERVER_VERSION = "1.2.5";
27
27
  /**
28
28
  * Initialize MCP server
29
29
  */
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@rapay/mcp-server",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
+ "mcpName": "ai.rapay/mcp-server",
4
5
  "description": "Ra Pay MCP Server for Claude Desktop and Claude Code - AI Agent Payment Infrastructure",
5
6
  "type": "module",
6
7
  "main": "dist/index.js",