How to connect a SOAP/WSDL service to an MCP server

By Balaji Venkatasubramaniyar · October 12, 2026

Short answer: read the WSDL, turn each operation into an MCP tool, convert the XSD request types into JSON Schema inputs, and have the server build the SOAP envelope and parse the response back into JSON.

The mapping

SOAP / WSDLMCP
OperationTool
Operation documentationTool description
XSD input messageJSON Schema inputSchema
SOAP responseTool result (JSON)
SOAP faultTool error

Steps

  1. Parse the WSDL. Collect services, ports, operations and the XSD types they use.
  2. Generate tool definitions. One tool per operation, with a clear name and description. Good descriptions matter: they are what the agent reads to decide when to call a tool.
  3. Convert types. Map XSD elements to JSON Schema, preserving required fields, enumerations and basic constraints.
  4. Build the call. Validate JSON input, serialize it into a SOAP envelope, send it, and parse the XML response into JSON.
  5. Handle failures. Return SOAP faults as structured errors the agent can reason about.
  6. Add guardrails. Decide which operations are read-only and which change data, and log every call. See safe defaults.

Doing it automatically

Hand-writing this for dozens of operations is tedious. legacy2mcp automates it: its WSDL/SOAP adapter generates the MCP server for you, with JSON Schema validation and audit logging built in. Code and docs are on GitHub.

FAQ

Do I need to change the SOAP service?

No. The MCP server is a client of the service.

What about authentication?

Keep credentials in the MCP server's configuration, never in the agent's prompt or tool arguments.

Can the same approach work for databases or queues?

Yes, in principle. That is why legacy2mcp uses an adapter interface; see the adapter pattern.