Whatever message this page gives is out now! Go check it out!

Configure Bulk MCP Servers

Last update:
May 18, 2026
Load multiple servers from external JSON configuration file.
Load multiple MCP servers (Jira, Wiki, GitHub, internal MCPs) from a JSON config file instead of hard-coding. This decouples environment changes (dev vs prod) from your CFML code.
Example mcpServers.json:

{
    "mcpServers": {
        "weather-server": {
            "url": "http://localhost:8500/mcp/weather.cfm",
            "disabled": false
        },
        "database-server": {
            "url": "http://localhost:8500/mcp/database.cfm",
            "disabled": false
        },
        "external-api": {
            "url": "https://api.example.com/mcp",
            "disabled": true
        }
    }
}
            
  1. Configure the client to load servers from the JSON file.
    ADDITIONAL INFORMATION:

<cfscript>

configData = {

    configFile: "/path/to/mcpServers.json",

    clientInfo: {
        name: "bulk-client",
        version: "1.0.0"
    },

    capabilities: {
        sampling: true,
        roots: true
    },

    requestTimeout: 30
};

// Returns array of MCP clients (one per enabled server)
mcpClients = MCPClient(configData);

</cfscript>
                    
  1. Returns an array of MCP clients (one per enabled server).
  2. Complete example with all handlers.
    ADDITIONAL INFORMATION:

<cfscript>

function samplingHandler(request) {
    return {
        modelname: "gpt-4o",
        result: callOpenAI(request.messages)
    };
}

function elicitationHandler(request) {
    return {
        action: "accept",
        content: collectUserInput(request.message)
    };
}

function loggingHandler(loggingMessage) {
    writeLog(
        type = loggingMessage.level,
        text = loggingMessage.data
    );
    return "Logged";
}

configData = {

    transport: {
        type: "http",
        url: "http://localhost:8500/mcp/server.cfm"
    },

    clientInfo: {
        name: "my-ai-client",
        version: "1.0.0"
    },

    capabilities: {
        sampling: true,
        roots: true,
        elicitation: true
    },

    samplingConsumer: samplingHandler,
    elicitationConsumer: elicitationHandler,
    loggingConsumer: loggingHandler
};

mcpClient = MCPClient(configData);

// Use the client
tools = mcpClient.listTools();

result = mcpClient.callTool({
    name: "get_weather",
    arguments: { location: "New York" }
});

</cfscript>
                    
Result
Your CFML application now manages multiple MCP servers from an external JSON configuration file.

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page