Build with AI
Overview
Building with large language models (LLMs) is an approach to software development that uses AI coding assistants to accelerate your API integrations. AI coding assistants equipped with the right tools can help you find information faster, write more accurate code, and test integrations easily.
StoneX provides tools to enable these capabilities for your AI coding assistants through the StoneX API Model Context Protocol (MCP) server.
Instead of manually reading API documentation and writing boilerplate integration code, developers can connect an AI agent directly to StoneX Payments FX APIs. The agent can then discover available operations, generate code, validate payloads, and execute multi‑step workflows using natural language prompts.
For installation instructions, configuration examples, and usage details, see StoneX API MCP Server
What is Model Context Protocol (MCP)?
Model Context Protocol (MCP) is an open standard that allows AI agents to discover, understand, and invoke tools in a structured, machine‑readable way.
Traditional API documentation is written for humans. MCP adds an additional semantic layer so that AI agents can:
- Understand what an operation does
- Determine when to use it
- Generate valid request payloads
- Chain multiple operations into workflows
When an AI model needs to perform StoneX API operations, the MCP client handles communication between the model and server, invoking the appropriate tools and returning results.
How MCP Differs from Direct API Integration
| MCP | Traditional API |
|---|---|
| Designed for AI agents | Designed for human developers |
| Semantic tool descriptions | Swagger / OpenAPI specs |
| Autonomous workflow execution | Explicit hand‑written code |
| Natural language driven | Code‑first integration |
MCP complements, rather than replaces, traditional API integrations, giving developers a faster, AI‑assisted option where appropriate.
When Should You Use the StoneX MCP Server?
The MCP Server is ideal if you want to:
- Accelerate API integration using AI
- Prototype workflows rapidly
- Reduce boilerplate and manual coding
- Explore StoneX APIs interactively
For fully custom, hand‑coded integrations, traditional REST APIs remain available.
Benefits
LLM-assisted development addresses common challenges in API integration:
- Faster development: Perform FX trading operations, manage investigations, and test integrations using natural language prompts, eliminating context switching between tools.
- Reduced errors: AI models equipped with current StoneX API specifications can generate more accurate code, reducing integration bugs and development time.
- Workflow automation: Automate common tasks like getting quotes, booking trades, creating investigations, and managing webhooks directly from your coding environment.
- Multi-tenant support: Built-in X-Client-Id header support enables seamless multi-tenant operations for enterprise integrations.
- Audit logging: Comprehensive audit logging captures all MCP requests and StoneX API interactions for compliance and debugging
- Improved productivity: Contextual assistance delivered directly to coding assistants helps you write better code faster, reducing integration time from weeks to days.
Limitations
LLM-assisted development has inherent limitations:
- Model dependency: The quality of responses depends on the AI model your coding assistant uses. Different models produce varying results, and no model is perfect.
- Sandbox only: The StoneX Payments API MCP server is only available for use in sandbox environments for testing and development.
- Authentication: All tools (except authenticate) require a valid access token. Tokens must be obtained through the authenticate tool and managed by the client application.
- Hallucination: While providing current API specifications reduces incorrect responses, AI models can still generate inaccurate code. Generated code must always be reviewed, validated, and tested before use in production.
- File handling: File upload tools require base64-encoded content, which may not be suitable for very large files due to token limits in AI models.
- Rate limiting: The StoneX API enforces rate limits. The MCP server does not implement rate limiting, so high-frequency operations may be throttled by the API.
Updated 3 days ago
