{"slug": "legacy-app-can-t-just-add-ai", "title": "Legacy app can't \"just add AI.\"", "summary": "The OWASP Incubator Project legacy2mcp released a tool that analyzes Python, JavaScript/TypeScript or Java codebases and generates a guardrailed MCP server exposing only the business flows a user approves, running entirely offline with no API key. The tool labels each flow read-only, low-risk write or high-risk, links every label to a file and line in an HTML report, and generates a schema-validated, audit-logged server that is read-only by default unless --allow-writes is passed. It requires Python 3.10+ and installs via pip install \"legacy2mcp[analyze]\", parsing code without importing or executing it or uploading anything.", "body_md": "**Understand any codebase, then turn the flows you approve into a safe MCP server.**\n\nPython, JavaScript/TypeScript and Java. Offline, no API key, nothing executed or uploaded.\n\n**Make your existing app AI-ready in seconds. No rewrite, no risk.**\n\nlegacy2mcp is an OWASP Incubator Project that gives AI agents safe access to the applications you already have. Point it at a Python, JavaScript/TypeScript or Java codebase and it generates an MCP server, with guardrails built in, for just the parts you approve.\n\n``` php\nflowchart LR\n  A[\"Your codebase<br/>Python · JS/TS · Java\"] --> B[\"analyze<br/>entry points, flows,<br/>side effects\"]\n  B --> C{\"Risk per flow\"}\n  C -->|read-only| D[\"report.html<br/>you tick the tools\"]\n  C -->|low-risk write| D\n  C -->|high-risk| D\n  D -->|selections.json| E[\"generate<br/>config.yaml\"]\n  E --> F[\"MCP server<br/>schema-validated,<br/>audit-logged\"]\n  F --> G[\"AI agent /<br/>MCP client\"]\n```\n\n1. **Map** : finds every entry point (HTTP routes, CLI commands, scheduled jobs, queue consumers) and the business flow behind it.\n2. **Rate** : labels each flow read-only, low-risk write, or high-risk, with the file and line behind every reason.\n3. **Report** : proposes MCP tools, an agent setup with approval points, and a phased roadmap.\n4. **Generate** : builds a server for only the flows you approve. Read-only by default, every call schema-validated and audit-logged.\n\n- No hand-written MCP adapters for every endpoint\n- No dangerous operations slipping through unnoticed\n- Works with the code you already have\n\n**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](https://github.com/OWASP/legacy2mcp/blob/main/docs/security.md#data-flow-and-privacy) and the [analyze guide](https://github.com/OWASP/legacy2mcp/blob/main/docs/analyze.md).\n\nYou need Python 3.10+ and a local Python, JavaScript/TypeScript or Java project. No API key. Nothing in your project is run or uploaded.\n\n**1. Install**\n\n```\npip install \"legacy2mcp[analyze]\"\n```\n\n**2. Analyze your project**\n\n```\nlegacy2mcp analyze ./my-app --no-ai\n```\n\nThis creates a `legacy2mcp-analysis/` folder with `report.html` in it.\n\n**3. Review the report**\n\nOpen `legacy2mcp-analysis/report.html` in your browser. Every business flow is\nlabelled **read-only**, **low-risk write** or **high-risk**, with the file and\nline behind each label. Under **Proposed MCP tools**, tick the tools you want\n(read-only tools are ticked for you) and click **Export selections.json**.\n\n**4. Generate the server config**\n\n```\nlegacy2mcp generate ./legacy2mcp-analysis \\\n  --selections ~/Downloads/selections.json \\\n  --base-url https://staging.my-app.example\n```\n\n- `--selections` : the file you exported in step 3. Leave it out to use the\nread-only tools only.\n- `--base-url` : where your app is running, so the tools can call it.\n\nThis writes `config.yaml`. Write tools stay hidden unless you add `--allow-writes`.\n\n**5. Connect it to your AI client**\n\nCheck the tools, then add this to your MCP client's config (Claude Desktop, Cursor, VS Code, Claude Code):\n\n```\nlegacy2mcp inspect --config config.yaml\n{\n  \"mcpServers\": {\n    \"legacy2mcp\": {\n      \"command\": \"legacy2mcp\",\n      \"args\": [\"run\", \"--config\", \"/absolute/path/to/config.yaml\"]\n    }\n  }\n}\n```\n\nPer-client setup: [docs/clients.md](https://github.com/OWASP/legacy2mcp/blob/main/docs/clients.md).\n\n- 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.\n- A risk label and reasons for every flow, linked to the source line.\n- The proposed MCP tools, an agent setup with approval points on every write, and a phased roadmap.\n\nSee a [sample report from a real open-source app](https://github.com/OWASP/legacy2mcp/blob/main/docs/sample-report).\n\n- **Python:** Flask, FastAPI, Django, click/typer, argparse, Celery, APScheduler\n- **JavaScript / TypeScript:** Express, Next.js API routes, commander,\nnode-cron, BullMQ, amqplib, kafkajs\n- **Java:** Spring Boot (`@RestController` ,`@Controller` ,`@RequestMapping` ),\nJava Servlets (`@WebServlet` ,`WEB-INF/web.xml` ), JAX-RS (`@Path` )\n\nFull list, AI enrichment (optional, bring your own key) and every flag:\n[analyze guide](https://github.com/OWASP/legacy2mcp/blob/main/docs/analyze.md).\n\n- Nothing in the scanned repo is imported, executed or sent anywhere.\n- Generated servers are read-only unless you opt in to writes.\n- Every tool call is schema-validated before it reaches your backend and written to an audit log.\n- AI enrichment is off unless you provide a key; it never changes a risk level or which tools are selected.\n\nSee the [security model](https://github.com/OWASP/legacy2mcp/blob/main/docs/security.md).\n\nTip\n\nAlready have a SOAP service, database, REST API or website instead of a\ncodebase? `legacy2mcp init` connects to it directly. A page behind a login\nworks too: save it from the browser and pass it as `--html-file`. See the\n[CLI guide](https://github.com/OWASP/legacy2mcp/blob/main/docs/cli.md). RabbitMQ queues can be served too, with\nread-only peek and opt-in publish tools: see\n[Configuration](https://github.com/OWASP/legacy2mcp/blob/main/docs/configuration.md#point-it-at-a-rabbitmq-queue). A\nread-only [SAP RFC / BAPI adapter](https://github.com/OWASP/legacy2mcp/blob/main/docs/configuration.md#sap-rfc--bapi)\nexposes explicitly allowlisted functions when you provide the NW RFC SDK\nand a compatible `pyrfc` module.\n\n- [Analyze guide](https://github.com/OWASP/legacy2mcp/blob/main/docs/analyze.md) ·[CLI guide](https://github.com/OWASP/legacy2mcp/blob/main/docs/cli.md) ·[Configuration](https://github.com/OWASP/legacy2mcp/blob/main/docs/configuration.md) ·[How it works](https://github.com/OWASP/legacy2mcp/blob/main/docs/how-it-works.md)\n- [Clients](https://github.com/OWASP/legacy2mcp/blob/main/docs/clients.md) ·[Security model](https://github.com/OWASP/legacy2mcp/blob/main/docs/security.md) ·[Roadmap](https://github.com/OWASP/legacy2mcp/blob/main/docs/roadmap.md) ·[Changelog](https://github.com/OWASP/legacy2mcp/blob/main/CHANGELOG.md)\n- [Adding an adapter](https://github.com/OWASP/legacy2mcp/blob/main/docs/adding-an-adapter.md) ·[Adding an analyzer](https://github.com/OWASP/legacy2mcp/blob/main/docs/adding-an-analyzer.md)\n\n- **OWASP Slack:**[`#project-legacy2mcp`](https://owasp.org/slack/invite)\n- **Issues:**[https://github.com/OWASP/legacy2mcp/issues](https://github.com/OWASP/legacy2mcp/issues) ·\ngood starting points are labeled[`good first issue`](https://github.com/OWASP/legacy2mcp/labels/good%20first%20issue)\n- **Add a legacy technology:** help legacy2mcp reach more systems with a new[adapter](https://github.com/OWASP/legacy2mcp/blob/main/docs/adding-an-adapter.md) (mainframe, IBM i, LDAP, MQ, …) or a new[language analyzer](https://github.com/OWASP/legacy2mcp/blob/main/docs/adding-an-analyzer.md) (C#, PHP, Ruby, …). See the[`legacy-tech`](https://github.com/OWASP/legacy2mcp/labels/legacy-tech) issues.\n- **Contributing:** see[CONTRIBUTING.md](https://github.com/OWASP/legacy2mcp/blob/main/CONTRIBUTING.md) and the[Code of Conduct](https://github.com/OWASP/legacy2mcp/blob/main/CODE_OF_CONDUCT.md)\n- **Security issues:** report privately per the[security policy](https://github.com/OWASP/legacy2mcp/blob/main/SECURITY.md)\n\n- **[Balaji Venkatasubramaniyar](https://github.com/bvenkata)** : Project Creator and Lead Maintainer\n\n- **[J Jeffrey Shalom](https://github.com/jeffrey-theog06)** : Core Team Member (Java analyzer)\n- **[Rahul Jha](https://github.com/rahulsjha)** : Core Team Member (saved HTML pages, live database configs, HTTP transport)\n\nSee [AUTHORS](https://github.com/OWASP/legacy2mcp/blob/main/AUTHORS) and [MAINTAINERS.md](https://github.com/OWASP/legacy2mcp/blob/main/MAINTAINERS.md).\n\nUse GitHub's \"Cite this repository\" button ([CITATION.cff](https://github.com/OWASP/legacy2mcp/blob/main/CITATION.cff)), or:\n\n```\n@software{legacy2mcp,\n  author  = {Venkatasubramaniyar, Balaji},\n  title   = {OWASP legacy2mcp: Safe, Typed, Audit-Logged MCP Servers for Legacy Systems},\n  url     = {https://github.com/OWASP/legacy2mcp},\n  license = {Apache-2.0}\n}\n```\n\nApache 2.0. See [LICENSE](https://github.com/OWASP/legacy2mcp/blob/main/LICENSE).\n\n<sub>OWASP legacy2mcp · an</sub>", "url": "https://wpnews.pro/news/legacy-app-can-t-just-add-ai", "canonical_source": "https://github.com/OWASP/legacy2mcp", "published_at": "2026-12-02 23:41:47+00:00", "updated_at": "2026-12-02 23:46:27.786541+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools", "ai-safety"], "entities": ["OWASP", "legacy2mcp", "Python", "JavaScript", "TypeScript", "Java", "Claude Desktop", "Cursor"], "also_reported_by": [], "takeaway": "legacy2mcp analyze ./my-app --no-ai produces a report.html labeling each business flow read-only, low-risk write or high-risk with file and line, and legacy2mcp generate builds an MCP server from the exported selections.json that stays read-only unless --allow-writes is added.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/legacy-app-can-t-just-add-ai", "markdown": "https://wpnews.pro/news/legacy-app-can-t-just-add-ai.md", "text": "https://wpnews.pro/news/legacy-app-can-t-just-add-ai.txt", "jsonld": "https://wpnews.pro/news/legacy-app-can-t-just-add-ai.jsonld"}}