legacy2mcp
This MCP server exposes three read-only SOAP operations from an "Orders" service, letting an AI agent look up orders and inventory.
Look up a single order —
orders_GetOrdertakes a required integerorderIdand returns that order's details.List orders —
orders_ListOrdersreturns orders, optionally filtered by an optionalstatusstring.Check stock for a SKU —
orders_GetInventorytakes a requiredskustring and reports inventory for it.Strict, predictable inputs — every tool rejects unknown parameters (
additionalProperties: false) and enforces its required fields, so calls are schema-validated before hitting the backend.Safe scope — all three are retrieval operations; nothing here writes, updates, or deletes data.
Uses a Postman collection as the source contract for an interface that benefits from a review step, writing a config and generating an MCP server with the same test chat and client connection snippet (legacy2mcp discover).
Discovers OpenAPI/Swagger specifications from a REST API (e.g. legacy2mcp init --rest-url "https://petstore3.swagger.io/api/v3") and generates one typed MCP tool per allowlisted endpoint, splitting validated arguments into path, query, and body parameters.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@legacy2mcp What operations does the demo calculator service expose?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OWASP legacy2mcp
Understand any codebase, then turn the flows you approve into a safe MCP server. Python and JavaScript/TypeScript. Offline, no API key, nothing executed or uploaded.
What is legacy2mcp?
Make your existing app AI-ready in seconds. No rewrite, no risk.
legacy2mcp is an OWASP Incubator Project that gives AI agents safe access to the applications you already have. Point it at a Python or JavaScript/TypeScript codebase and it generates an MCP server, with guardrails built in, for just the parts you approve.
How it works
flowchart LR
A["Your codebase<br/>Python · JS/TS"] --> B["analyze<br/>entry points, flows,<br/>side effects"]
B --> C{"Risk per flow"}
C -->|read-only| D["report.html<br/>you tick the tools"]
C -->|low-risk write| D
C -->|high-risk| D
D -->|selections.json| E["generate<br/>config.yaml"]
E --> F["MCP server<br/>schema-validated,<br/>audit-logged"]
F --> G["AI agent /<br/>MCP client"]Map: finds every entry point (HTTP routes, CLI commands, scheduled jobs, queue consumers) and the business flow behind it.
Rate: labels each flow read-only, low-risk write, or high-risk, with the file and line behind every reason.
Report: proposes MCP tools, an agent setup with approval points, and a phased roadmap.
Generate: builds a server for only the flows you approve. Read-only by default, every call schema-validated and audit-logged.
Why teams use it
No hand-written MCP adapters for every endpoint
No dangerous operations slipping through unnoticed
Works with the code you already have
Private by design. Everything runs locally. Your code is parsed, never imported or executed, and nothing is uploaded. Optional AI enrichment is off unless you provide a key, and it only runs after you confirm. See Data flow and privacy and the analyze guide.
Related MCP server: SOAP MCP Server
Quick start
You need Python 3.10+ and a local Python or JavaScript/TypeScript project. No API key. Nothing in your project is run or uploaded.
1. Install
pip install "legacy2mcp[analyze]"2. Analyze your project
legacy2mcp analyze ./my-app --no-aiThis creates a legacy2mcp-analysis/ folder with report.html in it.
3. Review the report
Open legacy2mcp-analysis/report.html in your browser. Every business flow is
labelled read-only, low-risk write or high-risk, with the file and
line behind each label. Under Proposed MCP tools, tick the tools you want
(read-only tools are ticked for you) and click Export selections.json.
4. Generate the server config
legacy2mcp generate ./legacy2mcp-analysis \
--selections ~/Downloads/selections.json \
--base-url https://staging.my-app.example--selections: the file you exported in step 3. Leave it out to use the read-only tools only.--base-url: where your app is running, so the tools can call it.
This writes config.yaml. Write tools stay hidden unless you add --allow-writes.
5. Connect it to your AI client
Check the tools, then add this to your MCP client's config (Claude Desktop, Cursor, VS Code, Claude Code):
legacy2mcp inspect --config config.yaml{
"mcpServers": {
"legacy2mcp": {
"command": "legacy2mcp",
"args": ["run", "--config", "/absolute/path/to/config.yaml"]
}
}
}Per-client setup: docs/clients.md.
What the report shows
Every entry point (HTTP routes, CLI commands, scheduled jobs, queue consumers), what it calls, and its side effects: database writes, outbound HTTP, email, payments, queues, auth changes.
A risk label and reasons for every flow, linked to the source line.
The proposed MCP tools, an agent setup with approval points on every write, and a phased roadmap.
See a sample report from a real open-source app.
Supported frameworks
Python: Flask, FastAPI, Django, click/typer, Celery, APScheduler
JavaScript / TypeScript: Express, Next.js API routes, commander, node-cron, BullMQ, amqplib, kafkajs
Full list, AI enrichment (optional, bring your own key) and every flag: analyze guide.
Safe by default
Nothing in the scanned repo is imported, executed or sent anywhere.
Generated servers are read-only unless you opt in to writes.
Every tool call is schema-validated before it reaches your backend and written to an audit log.
AI enrichment is off unless you provide a key; it never changes a risk level or which tools are selected.
See the security model.
Already have a SOAP service, database, REST API or website instead of a
codebase?legacy2mcp init connects to it directly. See the
CLI guide.
Documentation
Community and contributing
OWASP Slack:
#project-legacy2mcpIssues: https://github.com/OWASP/legacy2mcp/issues · good starting points are labeled
good first issueContributing: see CONTRIBUTING.md and the Code of Conduct
Security issues: report privately per the security policy
Authors & maintainers
Balaji Venkatasubramaniyar: Project Creator and Lead Maintainer
See AUTHORS and MAINTAINERS.md.
How to cite
Use GitHub's "Cite this repository" button (CITATION.cff), or:
@software{legacy2mcp,
author = {Venkatasubramaniyar, Balaji},
title = {OWASP legacy2mcp: Safe, Typed, Audit-Logged MCP Servers for Legacy Systems},
url = {https://github.com/OWASP/legacy2mcp},
license = {Apache-2.0}
}License
Apache 2.0. See LICENSE.
Available Tools
3 toolsorders_GetInventoryC
SOAP operation 'GetInventory' on service 'Orders' (adapter: orders).
Inputs: sku (required).
orders_GetOrderC
SOAP operation 'GetOrder' on service 'Orders' (adapter: orders).
Inputs: orderId (required).
orders_ListOrdersD
SOAP operation 'ListOrders' on service 'Orders' (adapter: orders).
Inputs: status.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
GetOrder and ListOrders clearly target order retrieval differently, and GetInventory targets a separate resource. Minor overlap in the 'Get' prefix does not meaningfully confuse selection.
All tools follow a consistent adapter-prefixed PascalCase SOAP operation pattern: orders_GetOrder, orders_ListOrders, orders_GetInventory. The mixed Get/List verbs are minor and reflect the underlying SOAP operation names.
Three tools is borderline thin for an orders service, though it may accurately reflect the exposed legacy SOAP operations. It feels scoped but limited.
The surface only supports reading orders and inventory, with no create, update, cancel, or other lifecycle operations. For an order management domain this is a significant gap that would block common agent workflows.
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
Related MCP Servers
- AlicenseCqualityDmaintenanceExposes SOAP-based web services as MCP servers by parsing WSDL files. Enables AI assistants to interact with legacy SOAP/WS-\* web services through the Model Context Protocol.214MIT
- AlicenseNot gradedqualityDmaintenanceExposes 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.MIT
- FlicenseCqualityDmaintenanceWraps a legacy SOAP + stored-procedure backend with governed MCP tools, including a semantic data dictionary, compensation for transactionless writes, and load protection, enabling AI agents to safely operate on enterprise systems.10-
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to call any SOAP/WSDL web service as MCP tools, automatically converting each WSDL operation into a callable tool with authentication and security controls.2AGPL 3.0