Skip to main content

Overview

The MCP (Model Context Protocol) server provides a standardized interface for AI agents to interact with the Agentic Wallet platform. It exposes curated tools and a generic gateway proxy for schema-validated API access. Port: 3008 (default)

Architecture

The MCP server acts as a tool invocation layer between AI agents and the API Gateway.

Endpoints

List Tools

Get all available MCP tools with descriptions.
Response:

Call Tool

Invoke a specific MCP tool with arguments.
Response:

Available Tools

The MCP server provides 70+ curated tools across all platform capabilities.

Wallet Tools

Example:

Transaction Tools

Example:

Policy Tools

Example:

Agent Tools

Example:

Protocol Tools

Example:

Risk Tools

Example:

Strategy & Treasury Tools

Example:

Audit Tools

Example:

Gateway Request Tool

The gateway.request tool provides schema-validated access to any /api/v1 endpoint.

Usage

Request Format

Schema Validation

The tool validates:
  • path must match /^/api/v1/[a-zA-Z0-9/_:-]*$/
  • method must be valid HTTP method
  • query must be record of string/number/boolean
  • body must be valid JSON object

Examples

Error Handling

MCP tools return normalized error responses.

Input Validation Errors

Invalid Tool
Missing Required Argument
Invalid Schema

Gateway Errors

When the underlying gateway request fails:
Gateway Error

Authentication

The MCP server uses environment-configured credentials to authenticate with the API Gateway.
Environment Configuration
Headers sent to gateway:
  • x-api-key: From API_KEY env var
  • x-tenant-id: From TENANT_ID env var (if set)
  • content-type: application/json

Health Check

Response:

Using the SDK

The TypeScript SDK includes an MCP client for tool invocation.
SDK MCP Client

Integration Patterns

AI Agent Tool Use

Agent Integration

Orchestrator Pattern

Workflow Orchestration

Tool Discovery

Agents can dynamically discover available tools at runtime.
Dynamic Tool Discovery

Best Practices

Prefer named tools like wallet.create instead of gateway.request for better type safety and validation.
Always wrap MCP calls in try-catch and parse error messages for structured error codes and stages.
Call mcp.tools() once at startup and cache the result rather than fetching on every operation.
Validate tool arguments client-side before calling to reduce round-trips and error noise.

Next Steps

CLI Integration

Use the command-line interface

SDK Integration

Integrate with TypeScript SDK

SKILLS Contract

Review agent integration contract

API Reference

Explore REST API endpoints