Skip to main content
Glama

set-proxy-config

Configure and manage proxy settings for all cryptocurrency exchanges on the CCXT MCP Server, enabling secure and controlled access to trading platforms. Define proxy URL, credentials, and clear cache for immediate changes.

Instructions

Configure proxy settings for all exchanges

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clearCacheNoClear exchange cache to apply changes immediately
enabledYesEnable or disable proxy
passwordNoProxy password (optional)
urlYesProxy URL (e.g., http://proxy-server:port)
usernameNoProxy username (optional)

Implementation Reference

  • The handler function that implements the set-proxy-config tool logic by setting environment variables for proxy configuration and optionally clearing the exchange cache.
    }, async ({ enabled, url, username, password, clearCache }) => { try { // For security and simplicity, we'll use environment variables // In a production app, you might want to use a more persistent storage method process.env.USE_PROXY = enabled.toString(); if (url) { process.env.PROXY_URL = url; } if (username !== undefined) { process.env.PROXY_USERNAME = username; } if (password !== undefined) { process.env.PROXY_PASSWORD = password; } log(LogLevel.INFO, `Proxy configuration updated. Enabled: ${enabled}`); // Clear exchange cache if requested if (clearCache) { clearExchangeCache(); log(LogLevel.INFO, "Exchange cache cleared to apply new proxy settings"); } return { content: [{ type: "text", text: JSON.stringify({ message: "Proxy configuration updated successfully", cacheCleared: clearCache, note: clearCache ? "Exchange cache was cleared. New proxy settings will be applied immediately." : "Changes will only affect newly created exchange instances. Use clear-exchange-cache tool for immediate effect." }, null, 2) }] }; } catch (error) { log(LogLevel.ERROR, `Error updating proxy configuration: ${error instanceof Error ? error.message : String(error)}`); return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } });
  • Zod input schema defining parameters for the set-proxy-config tool.
    enabled: z.boolean().describe("Enable or disable proxy"), url: z.string().describe("Proxy URL (e.g., http://proxy-server:port)"), username: z.string().optional().describe("Proxy username (optional)"), password: z.string().optional().describe("Proxy password (optional)"), clearCache: z.boolean().default(true).describe("Clear exchange cache to apply changes immediately")
  • The server.tool call that registers the set-proxy-config tool with schema and inline handler.
    server.tool("set-proxy-config", "Configure proxy settings for all exchanges", { enabled: z.boolean().describe("Enable or disable proxy"), url: z.string().describe("Proxy URL (e.g., http://proxy-server:port)"), username: z.string().optional().describe("Proxy username (optional)"), password: z.string().optional().describe("Proxy password (optional)"), clearCache: z.boolean().default(true).describe("Clear exchange cache to apply changes immediately") }, async ({ enabled, url, username, password, clearCache }) => { try { // For security and simplicity, we'll use environment variables // In a production app, you might want to use a more persistent storage method process.env.USE_PROXY = enabled.toString(); if (url) { process.env.PROXY_URL = url; } if (username !== undefined) { process.env.PROXY_USERNAME = username; } if (password !== undefined) { process.env.PROXY_PASSWORD = password; } log(LogLevel.INFO, `Proxy configuration updated. Enabled: ${enabled}`); // Clear exchange cache if requested if (clearCache) { clearExchangeCache(); log(LogLevel.INFO, "Exchange cache cleared to apply new proxy settings"); } return { content: [{ type: "text", text: JSON.stringify({ message: "Proxy configuration updated successfully", cacheCleared: clearCache, note: clearCache ? "Exchange cache was cleared. New proxy settings will be applied immediately." : "Changes will only affect newly created exchange instances. Use clear-exchange-cache tool for immediate effect." }, null, 2) }] }; } catch (error) { log(LogLevel.ERROR, `Error updating proxy configuration: ${error instanceof Error ? error.message : String(error)}`); return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/doggybee/mcp-server-ccxt'

If you have feedback or need assistance with the MCP directory API, please join our Discord server