SOAP MCP Server

SOAP MCP Server

Exposes SOAP web services as Model Context Protocol (MCP) servers, allowing AI models to interact with legacy SOAP services through automatic method discovery and type mapping.

Category
访问服务器

README

SOAP MCP Server

Python License Status

Expose SOAP web services as Model Context Protocol (MCP) servers. Bridge the gap between legacy SOAP/WSDL services and modern AI applications.

Overview

SOAP MCP Server is a proof-of-concept that enables you to expose any SOAP-based web service as an MCP server. This allows AI models and MCP clients to interact with legacy SOAP services through a standardized protocol.

Why?

Many organizations still rely on SOAP-based web services built in the early 2000s. Rather than rewriting these services, SOAP MCP Server provides a modern wrapper that:

  • ✨ Exposes SOAP methods as MCP tools
  • 🔗 Provides HTTP-based MCP protocol support
  • 🚀 Makes legacy services accessible to AI applications
  • 📦 Requires zero changes to existing SOAP services

Features

  • Automatic Method Discovery: Parses WSDL to automatically discover and expose all SOAP methods
  • HTTP MCP Protocol: Native HTTP transport for MCP communication
  • Type Mapping: Automatically converts SOAP/XML types to JSON Schema
  • Error Handling: Comprehensive error handling and logging
  • Production Ready: Runs on FastAPI + Uvicorn

Prerequisites

  • Python 3.13+
  • WSDL file URL (local file path or HTTP endpoint)
  • uv (recommended) or standard Python virtual environment

Installation

Using uv (recommended)

git clone https://github.com/mayankgupta7673/soap-mcp-server.git
cd soap-mcp-server
uv sync

Using pip

git clone https://github.com/mayankgupta7673/soap-mcp-server.git
cd soap-mcp-server
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e .

Quick Start

1. Start the Server

With uv:

uv run --project pyproject.toml main.py https://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL

With Python:

python main.py https://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL

The server will start on http://localhost:8000/mcp

2. Configure MCP Client

Update your MCP client configuration (e.g., .vscode/mcp.json):

{
  "servers": {
    "soap-service": {
      "url": "http://localhost:8000/mcp",
      "type": "http"
    }
  }
}

3. Use in MCP Client

Your MCP client can now:

  • List all available SOAP methods as tools
  • Call any SOAP method with parameters
  • Receive results as structured JSON

Usage

usage: soap-mcp [-h] [--port PORT] [--host HOST] [--log-file LOG_FILE] [--log-level {DEBUG,INFO,WARNING,ERROR}] WSDL

Expose SOAP web services as Model Context Protocol (MCP) servers

positional arguments:
  WSDL                  URL or file path of the WSDL file

options:
  --port PORT           Port to listen on (default: 8000)
  --host HOST           Host to bind to (default: 127.0.0.1)
  --log-file LOG_FILE   Log file path (default: soap_mcp.log)
  --log-level {DEBUG,INFO,WARNING,ERROR}
                        Logging level (default: INFO)

Examples

Start server on default port (8000):

python main.py https://example.com/service.wsdl

Start server on custom port:

python main.py https://example.com/service.wsdl --port 9000

Enable debug logging:

python main.py https://example.com/service.wsdl --log-level DEBUG

Use local WSDL file:

python main.py file:///path/to/service.wsdl

Architecture

┌─────────────────────────────────────────────────────┐
│          MCP Client (e.g., IDE, AI App)             │
└─────────────────────────────────────────────────────┘
                    │
                    │ HTTP/MCP
                    ↓
┌─────────────────────────────────────────────────────┐
│   SOAP MCP Server (FastAPI + Uvicorn)              │
├─────────────────────────────────────────────────────┤
│ • initialize          - MCP protocol handshake     │
│ • tools/list         - List all SOAP methods       │
│ • tools/call         - Execute SOAP method         │
├─────────────────────────────────────────────────────┤
│   SOAP Client (SUDS Library)                        │
└─────────────────────────────────────────────────────┘
                    │
                    │ SOAP/HTTP
                    ↓
┌─────────────────────────────────────────────────────┐
│   Legacy SOAP Web Service (Existing)                │
└─────────────────────────────────────────────────────┘

Type Mapping

XML Schema types are automatically mapped to JSON Schema types:

XSD Type JSON Type
xs:int, xs:integer integer
xs:string string
xs:boolean boolean
xs:double, xs:float number
xs:decimal number
(others) string (default)

Development

Install Development Dependencies

uv pip install -e ".[dev]"

Project Structure

soap-mcp-server/
├── src/
│   └── soap_mcp/
│       ├── __init__.py      # Package initialization
│       ├── cli.py           # CLI interface
│       ├── server.py        # Core server logic
├── examples/                # Example configurations
├── main.py                  # Entry point
├── pyproject.toml           # Project metadata & dependencies
├── LICENSE                  # MIT License
└── README.md               # This file

API Endpoints

POST /mcp

Main MCP protocol endpoint. Accepts JSON-RPC 2.0 requests:

Initialize:

{
  "jsonrpc": "2.0",
  "method": "initialize",
  "params": {...},
  "id": 1
}

List Tools:

{
  "jsonrpc": "2.0",
  "method": "tools/list",
  "params": {},
  "id": 2
}

Call Tool:

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "MethodName",
    "arguments": {"param1": "value1"}
  },
  "id": 3
}

GET /health

Health check endpoint.

Configuration

See examples/ directory for sample MCP configurations for different clients.

Limitations & Future Work

  • Currently supports SOAP services with HTTP binding
  • Complex nested types may require additional transformation
  • No caching of WSDL parsing (reloaded on each request)
  • SSE transport not yet supported

Troubleshooting

WSDL Loading Fails

Error loading WSDL: ...
  • Verify the WSDL URL is accessible
  • Check network/firewall settings
  • Ensure the WSDL file is valid

Port Already in Use

Address already in use

Use a different port:

python main.py <WSDL_URL> --port 8001

Debug Logging

Enable debug output:

python main.py <WSDL_URL> --log-level DEBUG

Check logs in soap_mcp.log

Contributing

Contributions welcome! Please feel free to submit issues and pull requests.

License

MIT License - see LICENSE file for details

References

Acknowledgments

This project bridges legacy SOAP services with modern AI through the Model Context Protocol.


For example, if you have a WSDL at `http://www.dneonline.com/calculator.asmx?wsdl`:

```bash
uv run main.py http://www.dneonline.com/calculator.asmx?wsdl

This tool has been tested with these random WSDL files I found on the internet:

  • http://www.dneonline.com/calculator.asmx?wsdl
  • http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL

Configure your agentic coding tool

Configure your MCP client (e.g., Gemini CLI, or an IDE extension) to run this script.

Example generic MCP config:

{
  "mcpServers": {
    "soap-service": {
      "command": "uv",
      "args": [
        "run",
        "--project",
        "/path/to/mcp2ws/pyproject.toml",
        "/path/to/mcp2ws/main.py",
        "http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL"
      ]
    }
  }
}

Example Session

In Gemini CLI, using the http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL service:

> What is the capital city of France? Use the soap tool.

✦ I will find the ISO code for France and then use it to get the capital city.

╭────────────────────────────────────────────────────────────────────────╮
│ ✓  CountryISOCode (soap-service MCP Server) {"sCountryName":"France"}  │
│                                                                        │
│ FR                                                                     │
╰────────────────────────────────────────────────────────────────────────╯
✦ I will now retrieve the capital city of France using its ISO code.
╭────────────────────────────────────────────────────────────────────────╮
│ ✓  CapitalCity (soap-service MCP Server) {"sCountryISOCode":"FR"}      │
│                                                                        │
│ Paris                                                                  │
╰────────────────────────────────────────────────────────────────────────╯
✦ The capital city of France is Paris.

TODO

  • Expose <documentation/> tags from WSDL in the tool listing. I don't know how standard this is, but I've seen these tags in .ASMX WSDL files.
  • Better support for mapping XML schema to JSON schema for input. Currently only primitive types are supported.
  • Add tests.
  • Run evals and optimize the how the tools are described in the MCP protocol.
  • Implement support for more web service standards like WS-* and UDDI. This probably won't happen because this stops being a fun joke and starts being a job.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选