PayPal Java MCP Server

PayPal Java MCP Server

paypal-java-mcp-server•bykumartheashwani

A Java implementation of a PayPal MCP server offering tools for analyzing and improving payment processing.

License: MIT License•Runtime: Awaiting documentation review•Category: finance crypto

WHAT IT DOES

  • •Serves MCP tools over a JSON-RPC HTTP API and a JSON-RPC stdio interface for Smithery integration.
  • •Provides an authorization rate improvement tool that analyzes transaction data and recommends improvements.
  • •Includes a calculator tool for basic math operations (add, subtract, multiply, divide) for testing.

BEST FOR

  • •Merchants wanting recommendations to improve PayPal card authorization rates by merchant ID, timeframe, and transaction type.
  • •Testing MCP tool execution over JSON-RPC, such as running the calculate function with add, subtract, multiply, or divide.

ABOUT PAYPAL-JAVA-MCP-SERVER

PayPal Java MCP Server is cataloged as an MCP server attributed to kumartheashwani. A Java implementation of a PayPal MCP server offering tools for analyzing and improving payment processing. It is categorized under finance crypto. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for PayPal Java MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What parameters does the authorization rate improvement tool take?

It requires a merchantId and optionally accepts a timeframe (default last_30_days) and a transactionType filter (default all).

Which JSON-RPC methods does the server support?

It supports initialize, getTools, and executeFunction JSON-RPC methods.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 9036a96d6da6 · 采集于 2026-11-13 12:53:44 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

PayPal Java MCP Server

This is a Java implementation of a PayPal MCP (Merchant Capability Platform) server that provides tools for analyzing and improving payment processing.

Features

  • JSON-RPC over HTTP API for web clients
  • JSON-RPC over stdio interface for Smithery integration
  • Tools for analyzing authorization rates
  • Basic calculator functionality for testing

Running the Server

Web Mode (Default)

To run the server in web mode, which exposes a REST API on port 8080:

java -jar target/paypal-java-mcp-server-0.0.1-SNAPSHOT.jar

In this mode, you can access the API at http://localhost:8080/api/mcp.

JSON-RPC over stdio Mode

To run the server in stdio mode, which uses JSON-RPC over standard input/output:

java -Dspring.profiles.active=stdio -Dspring.main.web-application-type=NONE -Djsonrpc.stdio.interactive=true -jar target/paypal-java-mcp-server-0.0.1-SNAPSHOT-stdio.jar

In this mode, the server reads JSON-RPC requests from stdin and writes responses to stdout. All logs are written to stderr and a log file.

IMPORTANT: The JSON-RPC stdio interface requires stdin/stdout connectivity. When deploying, ensure that the process has access to stdin/stdout, typically by running it in interactive mode.

You can test the stdio mode using the provided test script:

./test-stdio.sh

Running in Non-Interactive Environments

If you need to run the server in a non-interactive environment (where stdin/stdout connectivity is not available), you can use the provided start-non-interactive.sh script:

./start-non-interactive.sh

This script:

  1. Creates named pipes for stdin and stdout
  2. Starts background processes to handle the pipes
  3. Starts the server with the -Djsonrpc.stdio.interactive=false flag
  4. Automatically sends an initialize request to the server
  5. Provides the pipe paths for you to interact with the server

The server will pre-initialize all capabilities and tools, so it's ready to respond to requests even without initial input. You can then interact with the server by writing to the input pipe and reading from the output pipe:

# Send a request
echo '{"jsonrpc":"2.0","method":"getTools","id":"1"}' > /path/to/input_pipe

# Read responses
cat /path/to/output_pipe

Running with Docker

When running the server in a Docker container, you MUST use the -i flag to provide stdin connectivity:

docker run -i paypal-mcp-jsonrpc

The provided run-docker.sh script handles this for you:

./run-docker.sh

JSON-RPC Protocol

The server supports the following JSON-RPC methods:

initialize

Initializes the server and returns its capabilities:

{"jsonrpc":"2.0","method":"initialize","id":"1"}

getTools

Returns a list of available tools:

{"jsonrpc":"2.0","method":"getTools","id":"2"}

executeFunction

Executes a function with the specified arguments:

{"jsonrpc":"2.0","method":"executeFunction","params":{"function":"calculate","arguments":{"operation":"add","a":5,"b":3}},"id":"3"}

Deployment with Smithery

This server is designed to be deployed with Smithery, which requires the JSON-RPC over stdio interface.

To prepare the server for Smithery deployment:

./prepare-smithery.sh

This will create a smithery-deploy directory with all the necessary files for deployment, including:

  • The server JAR file
  • The Smithery configuration file
  • Scripts for running in interactive and non-interactive modes
  • A README with deployment instructions

Smithery Configuration

The server includes a smithery-config.json file that configures the server for Smithery:

{
  "name": "paypal-java-mcp-server",
  "type": "stdio",
  "interactive": true,
  "command": "java",
  "args": [
    "-Dspring.profiles.active=stdio",
    "-Dspring.main.web-application-type=NONE",
    "-DLOG_FILE=/logs/mcp-server.log",
    "-Dlogging.config=classpath:logback-stdio.xml",
    "-Djsonrpc.stdio.interactive=true",
    "-jar",
    "/app/app.jar"
  ]
}

CRITICAL: When using the server with Smithery, ensure that:

  1. The "interactive": true flag is set in the Smithery configuration
  2. The -Djsonrpc.stdio.interactive=true argument is included in the startup command
  3. You are using the JSON-RPC over stdio interface and not attempting to connect to the server via HTTP
  4. If your environment does not support interactive processes, use the start-non-interactive.sh script instead

Non-Interactive Deployment

If your Smithery environment does not support interactive processes, you have two options:

  1. Use the start-non-interactive.sh script: This script creates named pipes and handles the stdin/stdout connectivity for you.

  2. Modify the Smithery configuration: Set "interactive": false in the Smithery configuration and ensure the server is started with the -Djsonrpc.stdio.interactive=false flag.

Prerequisites

  • Java 17 or higher
  • Maven 3.6 or higher

Getting Started

Configuration

Configure the application in application.properties:

# Server configuration
server.port=8080

# Logging
logging.level.com.example.mcpserver=DEBUG

Building and Running

Build the application:

mvn clean package

API Usage

REST API

Health Check

curl http://localhost:8080/api/v1/health

Completions Endpoint

curl -X POST http://localhost:8080/api/v1/completions \
  -H "Content-Type: application/json" \
  -d '{
    "query": "How can I improve my authorization rate?",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful PayPal assistant."
      },
      {
        "role": "user",
        "content": "I need to improve my authorization rate. My merchant ID is MERCH123."
      }
    ],
    "context": {
      "merchantId": "MERCH123"
    }
  }'

Authorization Rate Improvement Tool

curl -X POST http://localhost:8080/api/v1/tools/improveAuthorizationRate/execute \
  -H "Content-Type: application/json" \
  -d '{
    "merchantId": "MERCH123",
    "timeframe": "last_30_days",
    "transactionType": "card"
  }'

Calculator Tool

curl -X POST http://localhost:8080/api/v1/tools/calculate/execute \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "multiply",
    "a": 6,
    "b": 7
  }'

JSON-RPC over stdio

The JSON-RPC over stdio interface accepts JSON-RPC 2.0 requests on stdin and writes responses to stdout. Each request and response is a single line of JSON.

Completions Request

{"jsonrpc":"2.0","method":"completions","params":{"query":"How can I improve my authorization rate?","messages":[{"role":"system","content":"You are a helpful PayPal assistant."},{"role":"user","content":"I need to improve my authorization rate. My merchant ID is MERCH123."}],"context":{"merchantId":"MERCH123"}},"id":"1"}

Execute Function Request

{"jsonrpc":"2.0","method":"executeFunction","params":{"function":"improveAuthorizationRate","arguments":{"merchantId":"MERCH123","timeframe":"last_30_days","transactionType":"card"}},"id":"2"}
{"jsonrpc":"2.0","method":"executeFunction","params":{"function":"calculate","arguments":{"operation":"multiply","a":6,"b":7}},"id":"3"}

Response Format

REST API Response

{
  "content": "Based on the analysis of your authorization rates, here are the recommendations:

Current Authorization Rate: 85.3%
Current Decline Rate: 14.7%
Total Transactions: 12500

Top Decline Reasons:
- insufficient funds: 42.5%
- risk triggers: 23.8%
- expired card: 12.3%
- invalid data: 10.7%
- other: 10.7%

Recommendations to Improve Authorization Rate:
1. Implement Account Updater (Priority: high, Est. Impact: +3.5%)
   Use PayPal's Account Updater service to automatically update expired or replaced cards

2. Optimize AVS Settings (Priority: medium, Est. Impact: +2.1%)
   Adjust Address Verification Service settings to reduce false declines

3. Implement Intelligent Retry Logic (Priority: high, Est. Impact: +4.2%)
   Add smart retry logic for declined transactions with specific reason codes

4. Review Risk Rules (Priority: medium, Est. Impact: +2.8%)
   Analyze and adjust risk rules to reduce false positives",
  "toolCalls": [
    {
      "id": "12345-67890",
      "type": "function",
      "function": {
        "name": "improveAuthorizationRate",
        "arguments": "{\"merchantId\":\"MERCH123\",\"timeframe\":\"last_30_days\",\"transactionType\":\"all\"}"
      }
    }
  ],
  "metadata": {
    "merchantId": "MERCH123",
    "timeframe": "last_30_days"
  }
}

JSON-RPC Response

{"jsonrpc":"2.0","result":{"content":"Based on the analysis of your authorization rates, here are the recommendations:\n\nCurrent Authorization Rate: 85.3%\nCurrent Decline Rate: 14.7%\nTotal Transactions: 12500\n\nTop Decline Reasons:\n- insufficient funds: 42.5%\n- risk triggers: 23.8%\n- expired card: 12.3%\n- invalid data: 10.7%\n- other: 10.7%\n\nRecommendations to Improve Authorization Rate:\n1. Implement Account Updater (Priority: high, Est. Impact: +3.5%)\n   Use PayPal's Account Updater service to automatically update expired or replaced cards\n\n2. Optimize AVS Settings (Priority: medium, Est. Impact: +2.1%)\n   Adjust Address Verification Service settings to reduce false declines\n\n3. Implement Intelligent Retry Logic (Priority: high, Est. Impact: +4.2%)\n   Add smart retry logic for declined transactions with specific reason codes\n\n4. Review Risk Rules (Priority: medium, Est. Impact: +2.8%)\n   Analyze and adjust risk rules to reduce false positives","toolCalls":[{"id":"12345-67890","type":"function","function":{"name":"improveAuthorizationRate","arguments":"{\"merchantId\":\"MERCH123\",\"timeframe\":\"last_30_days\",\"transactionType\":\"all\"}"}}],"metadata":{"merchantId":"MERCH123","timeframe":"last_30_days"}},"id":"1"}

Available Tools

Authorization Rate Improvement Tool

This tool analyzes transaction data and provides recommendations to improve authorization rates.

Parameters:

  • merchantId (required): The merchant ID to analyze
  • timeframe (optional): The timeframe for analysis (default: "last_30_days")
  • transactionType (optional): Transaction type filter (default: "all")

Calculator Tool

This tool performs basic math operations.

Parameters:

  • operation (required): The operation to perform (add, subtract, multiply, divide)
  • a (required): First operand
  • b (required): Second operand

Docker Deployment

The project includes Docker support for both the REST API server and the JSON-RPC stdio server.

Building Docker Images

Build Both Images Using Docker Compose

docker-compose build

Build REST API Server Image Only

docker build --target rest-api -t paypal-mcp-rest-api .

Build JSON-RPC Server Image Only

docker build -f Dockerfile.smithery -t paypal-mcp-jsonrpc .

Running with Docker

Run REST API Server

docker run -p 8080:8080 paypal-mcp-rest-api

Run JSON-RPC Server

The JSON-RPC server reads from stdin and writes to stdout, so it MUST be run with interactive mode:

docker run -i paypal-mcp-jsonrpc

Or use the provided script:

./run-docker.sh

Using Docker Compose

Start the REST API server:

docker-compose up rest-api

Note: The JSON-RPC stdio server is not typically run directly with docker-compose since it requires stdin/stdout interaction.

Troubleshooting

Common Issues

"The server's tool list is not accessible"

If you see an error indicating that the server's tool list is not accessible via a network connection, this is likely because:

  1. You're trying to access the server via HTTP when it's running in stdio mode
  2. The server is not running in interactive mode, so it can't receive input or send output
  3. The -Djsonrpc.stdio.interactive=true flag is missing from the startup command

Solution:

  • Ensure you're using the JSON-RPC over stdio interface
  • Run the server with the -i flag if using Docker
  • Add the -Djsonrpc.stdio.interactive=true flag to the startup command
  • Use the start-non-interactive.sh script if running in a non-interactive environment

"Server fails to initialize in a non-interactive environment"

If the server fails to initialize in a non-interactive environment:

  1. Use the start-non-interactive.sh script, which is specifically designed for non-interactive environments
  2. Run the server with the -Djsonrpc.stdio.interactive=false flag
  3. Ensure the named pipes are properly set up and accessible

Solution:

./start-non-interactive.sh

"No response from server"

If the server doesn't respond to requests:

  1. Check that the server is running in the correct mode
  2. Verify that stdin/stdout are properly connected
  3. Check the logs for any errors

Solution:

  • Run the server with the test-stdio.sh script to verify it works correctly
  • Use the start-non-interactive.sh script and check the named pipes
  • Check the log file for any errors

License

This project is licensed under the MIT License - see the LICENSE file for details.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for PayPal Java MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/paypal-java-mcp-server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related finance crypto MCP Servers

Alternative and complementary servers in the same category

View all in finance crypto →
USA Spending MCP Server
usaspending-mcp-server•thsmale

A stateless streamable HTTP MCP server for interacting with the official source of government spending data.

Repository stats unavailable
Finance & Analytics
Fortnox MCP server — More AI
more-ai-chatgpt-claude-mcp-fortnox•amor3

A hosted, remote MCP server for Fortnox that lets AI assistants answer questions from a company's bookkeeping and propose changes for approval before writing them.

0
Finance & Analytics

OptimistFi is a read-only remote MCP server that provides perpetual futures market data, perps prop firm rules and pricing, and US equity investment research.

Repository stats unavailable
Finance & Analytics