get-proxy-config
Retrieve the current proxy configuration to manage network settings for the CCXT MCP Server, ensuring efficient cryptocurrency exchange integration.
Instructions
Get the current proxy configuration
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get-proxy-config"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/config.ts:20-39 (registration)Registration of the 'get-proxy-config' MCP tool on the server, including inline handler implementation that reads proxy configuration from environment variables and returns it as formatted text content, intentionally omitting the password for security.
server.tool("get-proxy-config", "Get the current proxy configuration", {}, async () => { const useProxy = process.env.USE_PROXY === 'true'; const proxyUrl = process.env.PROXY_URL || ''; const proxyUsername = process.env.PROXY_USERNAME || ''; // Don't return the password for security reasons return { content: [{ type: "text", text: JSON.stringify({ enabled: useProxy, url: proxyUrl, username: proxyUsername, isConfigured: useProxy && !!proxyUrl }, null, 2) }] }; } ); - src/tools/config.ts:21-38 (handler)The inline asynchronous handler function for the 'get-proxy-config' tool. It extracts proxy settings from process.env (USE_PROXY, PROXY_URL, PROXY_USERNAME), omits PROXY_PASSWORD for security, and returns an MCP-formatted response with the configuration as JSON text.
async () => { const useProxy = process.env.USE_PROXY === 'true'; const proxyUrl = process.env.PROXY_URL || ''; const proxyUsername = process.env.PROXY_USERNAME || ''; // Don't return the password for security reasons return { content: [{ type: "text", text: JSON.stringify({ enabled: useProxy, url: proxyUrl, username: proxyUsername, isConfigured: useProxy && !!proxyUrl }, null, 2) }] }; } - src/exchange/manager.ts:67-81 (helper)Supporting helper function 'getProxyConfig' imported in config.ts and used in other proxy-related tools and exchange initialization. Provides full proxy configuration including password, unlike the tool handler which omits it.
export function getProxyConfig(): { url: string; username?: string; password?: string } | null { const useProxy = process.env.USE_PROXY === 'true'; if (!useProxy) return null; const url = process.env.PROXY_URL; if (!url) { log(LogLevel.WARNING, 'USE_PROXY is true but PROXY_URL is not set'); return null; } const username = process.env.PROXY_USERNAME || undefined; const password = process.env.PROXY_PASSWORD || undefined; return { url, username, password }; }