@mastercard/developers-agent-toolkit
v0.1.3
Published
Agent Toolkit for Mastercard Developers Platform
Maintainers
Readme
Mastercard Agent Toolkit - TypeScript
The Mastercard Developers Agent Toolkit allows popular agent frameworks (currently Model Context Protocol - MCP) to integrate with Mastercard Developers for service discovery and integration guides.
Installation
npm install --save @mastercard/developers-agent-toolkitRequirements
- Node 18+
Usage
You can optionally specify service or apiSpecification as part of the configuration.
service: URL of the documentation of a service that you want the MCP to focus on e.g.https://developer.mastercard.com/mdes-customer-service/documentationapiSpecification: URL of the API specification that you want the MCP tools to focus on e.g.https://static.developer.mastercard.com/content/match/swagger/match-pro.yaml. You can get the link fromDownload Specbutton in theAPI Referencepage of service. NOTE: This will override any value provided inserviceconfiguration.
If you specify service or api-specification then the get-services-list tool will be disabled.
import { MastercardDevelopersAgentToolkit } from '@mastercard/developers-agent-toolkit/mcp';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
const server = new MastercardDevelopersAgentToolkit({
configuration: {
service: 'https://developer.mastercard.com/open-finance-us/documentation',
},
});
async function main() {
const transport = new StdioServerTransport();
await server.connect(transport);
console.error('Mastercard Developers MCP Server running on stdio');
}
main().catch((error) => {
console.error('Fatal error in main():', error);
process.exit(1);
});