Investec OpenAPI MCP Server
Enables AI assistants to interact with Investec banking accounts, transactions, payments, and programmable cards through natural language.
README
šµ Investec OpenAPI MCP Server
A premium, production-ready Model Context Protocol (MCP) server that wraps the official Investec OpenAPI. It enables AI coding assistants, developer agents (such as Claude Desktop, Cursor, or custom MCP clients), and automation scripts to interact directly and securely with your Investec personal, business, corporate, and programmable card accounts.
āāāāāāā āāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā āāāāāāā
āāāāāāāā āāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāā āāāāāā āāāāāāāāā āāāāāāāā āāā āāāāāā āāā
āāāāāāāāāāāāāāāāā āāāāāāāāāā āāāāāāāā āāā āāāāāā āāā
āāāāāā āāāāāā āāāāāāā āāāāāāāāāāāāāāāā āāā āāāāāāāāāāāāāāāā
āāāāāā āāāāā āāāāā āāāāāāāāāāāāāāāā āāā āāāāāāāā āāāāāāā
OPENAPI MCP SERVER
š Key Architecture Highlights
- š Secure In-Memory Token Management: Automatically performs the OAuth2 Client Credentials flow, safely caches tokens, and auto-refreshes them proactively before expiration. No tokens or secrets are ever written to disk or printed in terminal logs.
- š Zero-Config Sandbox Mode: Connects out-of-the-box using the official Investec public Sandbox credentials. You can test account balances, payments, statements, and transaction listings instantly without registering for an developer account first.
- š ļø Robust Typings: Exposes strict TypeScript type definitions for all API models, including complex payloads like batch payments (
paymultiple) and programmable card code compilation. - š Stdio Transport Protocol: Implements JSON-RPC 2.0 over standard I/O (stdio) compliant with the official Model Context Protocol (MCP) specifications.
š Repository Structure
investec-mcp-server/
āāā .github/workflows/ci.yml # Automated CI validation pipeline
āāā dist/ # Compiled JavaScript build outputs
āāā examples/ # Standalone SDK demo code
ā āāā pb-demo.ts # Demo of InvestecClient standalone usage
āāā src/ # TypeScript source code
ā āāā index.ts # MCP server declaration and tools router
ā āāā investec-client.ts # Core HTTP client & token manager
ā āāā types.ts # Strict TypeScript API schemas
āāā .env.example # Configuration settings template
āāā CONTRIBUTING.md # Open-source contribution guide
āāā LICENSE # Open source MIT License
āāā package.json # Build dependencies and commands
āāā tsconfig.json # TypeScript compilation rules
āļø Installation & Setup
1. Build from Source
Ensure you have Node.js (v18.0.0 or higher) installed on your system.
# Clone the repository
git clone https://github.com/Investec-Developer-Community/investec-mcp-server.git
cd investec-mcp-server
# Install package dependencies
npm install
# Compile TypeScript to JavaScript
npm run build
2. Verify Connectivity (Sandbox Mode)
Run the sandbox integration test suite to verify that the server connects to the Investec developer sandbox API, fetches mock accounts, and reads balance sheets:
npm run test-sandbox
š§ Environment Configuration
By default, the server runs in sandbox mode. To connect to your real live banking data, create a .env file in the root of the project (or copy .env.example to .env):
# 'production' to access live data, or 'sandbox' for mock accounts
INVESTEC_ENVIRONMENT=production
# Your Investec Developer credentials (obtained from Investec Online)
INVESTEC_CLIENT_ID=your_client_id
INVESTEC_CLIENT_SECRET=your_client_secret
INVESTEC_API_KEY=your_api_key
# Optional: Required for Advisor or Intermediary API scopes
INVESTEC_INTERMEDIARY_ID=your_intermediary_id
[!CAUTION] Keep your credentials secure! Never commit your
.envfile to public version control. The included.gitignoreis pre-configured to block.envuploads.
š¬ Claude Desktop Integration
To link the MCP server to your local Claude Desktop application, edit your claude_desktop_config.json:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Add the server specification under mcpServers:
{
"mcpServers": {
"investec-banking": {
"command": "node",
"args": [
"C:/path/to/investec-mcp-server/dist/index.js"
]
}
}
}
Note: Make sure to replace C:/path/to/investec-mcp-server with the absolute path to your local project directory.
š ļø Standalone SDK Usage
You can also import and use the underlying InvestecClient class as a standalone SDK in your own custom Node.js projects, independent of the MCP protocol:
import { InvestecClient } from "./src/investec-client";
async function main() {
// Uses .env variables or falls back to public Sandbox defaults
const client = new InvestecClient({ environment: "sandbox" });
// List Accounts
const response = await client.pbListAccounts();
const accounts = response.data.accounts;
console.log(`Found ${accounts.length} accounts.`);
}
main();
For a complete code demonstration, see [examples/pb-demo.ts](file:///c:/Users/jonel/Downloads/MCP_SERVER/examples/pb-demo.ts).
š§° Exposed Tools Reference
The server registers the following MCP tools:
š³ Private Banking (PB)
| Tool Name | Parameters | Description |
|---|---|---|
investec_pb_list_accounts |
None | List linked accounts ( cheque, savings, profiles ). |
investec_pb_get_account_balance |
accountId |
Get available, current, and currency balance detail. |
investec_pb_get_account_transactions |
accountId, fromDate?, toDate?, transactionType?, includePending? |
Fetch filtered transaction ledger feed. |
investec_pb_get_pending_transactions |
accountId |
List outstanding pending transactions (e.g. card swipes). |
investec_pb_list_profiles |
None | List online profiles associated with user identity. |
investec_pb_list_profile_accounts |
profileId |
List accounts associated with specific profile. |
investec_pb_list_beneficiaries |
None | Fetch registered payment beneficiaries. |
investec_pb_pay_multiple |
accountId, paymentList |
Make batch payments to list of beneficiaries. |
investec_pb_transfer_multiple |
accountId, paymentList |
Transfer funds between own accounts. |
investec_pb_get_documents |
accountId, fromDate?, toDate? |
Retrieve list of statements and tax certificates. |
investec_pb_get_document |
accountId, documentType, documentDate |
Fetch download link for specific statement PDF. |
š» Programmable Cards
| Tool Name | Parameters | Description |
|---|---|---|
investec_card_list_cards |
None | List credit and debit cards linked to account. |
investec_card_create_virtual_card |
accountNumber, embossName, embossName2? |
Issue virtual cards dynamically. |
investec_card_get_code |
cardKey |
Get draft/working card JS scripts. |
investec_card_update_code |
cardKey, code |
Upload new code draft for programmable cards. |
investec_card_publish_code |
cardKey |
Publish and activate code for card swipe authorization. |
investec_card_execute_code |
cardKey, authorizationModel |
Simulate card swipe swipe to test custom script logic. |
investec_card_get_execution_history |
cardKey |
Fetch execution history logs of script. |
investec_card_get_env_vars |
cardKey |
Retrieve script environment secrets. |
investec_card_update_env_vars |
cardKey, variables |
Update script key-value environment secrets. |
investec_card_toggle_programmable |
cardKey |
Turn programmable features on or off. |
š¢ Corporate & Institutional Banking (CIB)
| Tool Name | Parameters | Description |
|---|---|---|
investec_cib_list_accounts |
None | List corporate accounts. |
investec_cib_get_account_transactions |
accountId, fromDate?, toDate?, page? |
Get corporate transaction ledger with pagination. |
investec_cib_list_companies |
None | List company entities under profile. |
investec_cib_get_orders_shipments_report |
companyName |
Query current shipment and order status data. |
š License
This project is open-source and released under the MIT License. Feel free to fork, distribute, and integrate this project in commercial and private setups. For official API support, consult the Investec Developer Portal.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.