MCP
The Spreedly Model Context Protocol (MCP) documentation server enables AI-powered code editors like Cursor and VScode, plus general-purpose tools like Claude Code, to interact directly with the Spreedly API and documentation.
In addition to documentation, Spreedly maintains a self-hosted MCP server that provides AI assistants with direct access to core API functionality. This MCP enables LLMs to manage gateways, process transactions, tokenize payment methods, and more through structured, validated tool calls.
What is MCP?
Model Context Protocol (MCP) is an open standard that allows AI applications to securely access external data sources and tools. The Spreedly MCP servers provides AI agents with:
- Direct API access to Spreedly functionality
- Documentation search capabilities
- Real-time data from your Spreedly environment
- Code generation assistance for Spreedly integrations
Self-hosted Spreedly MCP setup
Spreedly's MCP server is available on GitHub. To get started, add the following your MCP client configuration:
Edit .cursor/mcp.json in your project root:
{
"mcpServers": {
"spreedly": {
"command": "npx",
"args": ["-y", "@spreedly/spreedly-mcp@latest"],
"env": {
"SPREEDLY_ENVIRONMENT_KEY": "<your-environment-key>",
"SPREEDLY_ACCESS_SECRET": "<your-access-secret>"
}
}
}
}Getting credentials
The self-hosted MCP server tools require authentication. To obtain the API credentials for your desired environment:
- Log into https://app.spreedly.com
- Copy your Environment Key from the environment's settings page
- Create or find an Access Secret under your environment's access secrets
For details, see Spreedly's documentation on credentials.
Tool access
The server controls which tools are available through three environment variable flags. All default to false with only read-only tools enabled out of the box. Enable the categories you need to support your use case:
| Variable | Default | Features |
|---|---|---|
PAYMENT_METHOD_TOKENIZATION_ENABLED | false | Creating and recaching payment methods (sends PAN/CVV data) |
TRANSACTION_INITIATION_ENABLED | false | Authorizing, purchasing, capturing, voiding, refunding, and other third-party actions on a given payment method. Note: authorize, purchase, and confirm can accept optional pass-in PAN/CVV data if a merchant's Spreedly environment permits it. -- see Cardholder Data Flow. |
ADMINISTRATIVE_ENABLED | false | Creating/updating gateways, environments, certificates, merchant profiles, SCA providers, or sub-merchants |
By enabling or disabling the above variables, merchants can achieve different configuration profiles to suit their needs. Review the MCP repository for recommended configuration profiles and a complete list of available tools grouped by function.
Common MCP workflows
Tokenize and charge a card
- Create a payment method:
spreedly_payment_method_create - Authorize against a gateway:
spreedly_gateway_authorize - Capture the authorization:
spreedly_transaction_capture
Authorize then Capture (two-step)
- Authorize:
spreedly_gateway_authorize - Capture later:
spreedly_transaction_capture
Refund a transaction
- Find the transaction:
spreedly_transaction_show - Issue a refund:
spreedly_transaction_credit
Complete details on audit logging, implementation steps, security considerations, and an MCP eval. suite are available in Spreedly's MCP repository.
Spreedly docs MCP server setup
Spreedly hosts the remote documentation-focused MCP server at https://developer.spreedly.com/mcp. Configure your AI development tools to connect. For APIs requiring authentication, you can pass in headers via query parameters or however headers are configured in your MCP client.
Add to~/.cursor/mcp.json:
{
"mcpServers": {
"spreedly-docs": {
"url": "https://developer.spreedly.com/mcp"
}
}
}These tools do not generally require authentication and provide supplemental context using details grounded in Spreedly's full documentation site and API specification.
Features and functionality
Spreedly's docs MCP server includes routes for every API endpoint. There are currently 9 MCP tools available on each endpoint route:
list-endpoints- Browse all API paths and methodsget-endpoint- Get detailed endpoint informationget-request-body- View request body schemasget-response-schema- View response schemaslist-security-schemes- See authentication optionssearch-specs- Search across paths, operations, and schemasget-code-snippet- Retrieve code examples for specific endpointssearch- Search Spreedly's documentationfetch- Get detailed content from our API guides
Sample questions
API discovery & documentation:
- "What endpoints does Spreedly have for managing gateways?"
- "Show me all the available payment method endpoints."
- "What authentication methods does Spreedly support?"
- "How do I structure a request to tokenize a credit card?"
- "What's the response schema for creating a transaction?"
Integration assistance:
- "Generate a Node.js code snippet for creating a gateway."
- "Show me a Python example for tokenizing a payment method."
- "Give me a Ruby code sample for running a
purchasecall." - "What's the curl command to retrieve a transaction token?"
Schema & parameter details:
- "What parameters are required to create a receiver?"
- "What specific fields are returned in a gateway's response?"
- "Show me the request body schema for authorizing a payment."
- "What optional parameters can I pass when updating a payment method?"
Search & exploration:
- "Find documentation about 3DS authentication."
- "Provide more information about network tokens."
- "What guides are available for PCI compliance?"
- "Show me the documentation for fraud services."
Testing MCP setup
Once configured, you can test your MCP server connection:
- Open your AI editor (Cursor, VS code, etc.)
- Start a new chat with an AI assistant
- Ask about Spreedly - interact with API endpoints to find context/answers using natural language
The AI should now have access to your Spreedly environment, data and documentation through the MCP server.
Updated 10 minutes ago
