An MCP (Model Context Protocol) server for the Solidgate payment gateway, with a full-featured Rust SDK.
- MCP Server: Expose Solidgate operations as tools for AI assistants (Claude Desktop, etc.)
- Rust SDK: Type-safe async client for the Solidgate API
- Payment Intent Encryption: AES-256-CBC encryption for secure form integration
- HMAC-SHA512 Signatures: Secure request signing
- Full API Coverage: Subscriptions, Card Payments, Alternative Payments, Prices, Webhooks
cargo build --releaseThe binary will be at target/release/solidgate-mcp.
Add to your claude_desktop_config.json:
{
"mcpServers": {
"solidgate": {
"command": "/path/to/solidgate-mcp",
"args": [],
"env": {
"SOLIDGATE_MERCHANT_ID": "your_merchant_id",
"SOLIDGATE_PRIVATE_KEY": "your_private_key"
}
}
}
}Add to your Claude Code MCP settings:
{
"mcpServers": {
"solidgate": {
"command": "/path/to/solidgate-mcp",
"env": {
"SOLIDGATE_MERCHANT_ID": "your_merchant_id",
"SOLIDGATE_PRIVATE_KEY": "your_private_key"
}
}
}
}# With environment variables
SOLIDGATE_MERCHANT_ID=your_merchant_id \
SOLIDGATE_PRIVATE_KEY=your_private_key \
./solidgate-mcp
# Or configure credentials via the tool at runtime
./solidgate-mcp| Tool | Description |
|---|---|
configure_credentials |
Set up API credentials (required if not using env vars) |
get_subscriptions |
List all subscriptions for a customer |
get_subscription_status |
Get detailed status of a subscription |
cancel_subscription |
Cancel a subscription (immediate or end of period) |
pause_subscription |
Pause a subscription for a time period |
restore_subscription |
Restore a cancelled subscription |
check_order_status |
Check card payment order status |
refund_order |
Refund a card payment (full or partial) |
Add to your Cargo.toml:
[dependencies]
solidgate-mcp = "0.1.0"use solidgate_mcp::SolidgateSDK;
use uuid::Uuid;
#[tokio::main]
async fn main() {
let sdk = SolidgateSDK::new("merchant_id", "private_key");
// Get subscriptions for a customer
let customer_id = Uuid::parse_str("...").unwrap();
let subscriptions = sdk.subscriptions()
.retrieve_subscriptions_by_customer_id(customer_id)
.await;
// Check order status
let status = sdk.card_payments()
.check_order_status("order-123")
.await;
}use solidgate_mcp::{SolidgateSDK, PaymentIntentRequest, Platform};
use uuid::Uuid;
let sdk = SolidgateSDK::new("merchant_id", "private_key_at_least_32_bytes");
let request = PaymentIntentRequest {
ip_address: "192.168.1.1".to_string(),
platform: Platform::Web,
order_id: Uuid::new_v4(),
order_description: "Premium subscription".to_string(),
amount: Some(1999),
currency: Some(Currency::Usd),
customer_email: Some("[email protected]".to_string()),
// ... other fields
..Default::default()
};
let merchant_data = sdk.form_merchant_data(request).unwrap();
// Use merchant_data.payment_intent, merchant_data.merchant, merchant_data.signature
// to initialize the Solidgate payment formsdk.subscriptions()- Subscription managementsdk.card_payments()- Card payment operationssdk.alternative_payments()- PayPal, UPI, and other payment methodssdk.prices()- Product and pricing managementsdk.webhooks()- Webhook endpoint configuration
# List subscriptions for a customer
SOLIDGATE_MERCHANT_ID=your_id \
SOLIDGATE_PRIVATE_KEY=your_key \
cargo run --example get_subscriptions -- <customer_uuid>
# Get subscription status
SOLIDGATE_MERCHANT_ID=your_id \
SOLIDGATE_PRIVATE_KEY=your_key \
cargo run --example get_subscriptions -- --status <subscription_uuid>| Variable | Description |
|---|---|
SOLIDGATE_MERCHANT_ID |
Your Solidgate merchant ID (API public key) |
SOLIDGATE_PRIVATE_KEY |
Your Solidgate private key (API secret key) |
MIT