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

Create an MCP Client

Last update:
May 18, 2026
Learn how to configure and initialize an MCP client in ColdFusion.
To create a client, you build a configData struct and pass it to MCPClient(configData). The function returns an array of clients. For single-server configs, this array contains a single client; for multi-server configs, it can contain one client per server.
Key fields in configData:
  • transport (or configFile for multi-server)
  • clientInfo
  • capabilities
  • initializationTimeout, requestTimeout
  • Optional consumer callbacks (sampling, elicitation, logging, root changes)
  1. Create a configData struct with the required configuration.
  2. Pass the configuration struct to MCPClient(configData).

Example


<cfscript>

    configData = {

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

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

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

        initializationTimeout: 10,
        requestTimeout: 30
    };

    mcpClient = MCPClient(configData);

</cfscript>
            

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