{"_id":"@aravinthan_p/appnest-ai-mcp","_rev":"2-a101d3ced28c59fd482024a904e4bb9c","name":"@aravinthan_p/appnest-ai-mcp","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@aravinthan_p/appnest-ai-mcp","version":"0.0.1","keywords":["appnest","mcp","modelcontextprotocol"],"_id":"@aravinthan_p/appnest-ai-mcp@0.0.1","maintainers":[{"name":"aravinthan_p","email":"aravinthan.prabakaran@surveysparrow.com"}],"bin":{"twigs-ai-mcp":"build/server.js"},"dist":{"shasum":"af45fedd235243af792adfb79f25de0c66d1f762","tarball":"https://registry.npmjs.org/@aravinthan_p/appnest-ai-mcp/-/appnest-ai-mcp-0.0.1.tgz","fileCount":14,"integrity":"sha512-IKcUrbDLcq9gFfMcNJtSIp6kM+VI+22C6vHVooSflModorGMMsQXQbNTwmSAXyqX248qf2PlRHlXjHXil3ylZA==","signatures":[{"sig":"MEYCIQDPVU6U7c9yvqqkK7EUZ9IKrhSh82emsmuFKMFCpfq+IgIhALuJ13YS6svMNQ4VLxdkckqZLewapD5UG3SfeyA0YExy","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":41787},"main":"build/server.js","type":"module","scripts":{"dev":"tsx src/server.ts","test":"echo \"Error: no test specified\" && exit 1","build":"tsc && chmod 755 build/server.js","start":"node build/server.js","inspect":"npx -y @modelcontextprotocol/inspector node build/server.js"},"_npmUser":{"name":"aravinthan_p","email":"aravinthan.prabakaran@surveysparrow.com"},"_npmVersion":"10.9.4","description":"Bridges appnest with MCP tools so any MCP client can generate appnest app","directories":{},"_nodeVersion":"22.21.1","dependencies":{"zod":"^3.25.76","sharp":"^0.33.5","dedent":"^1.6.0","dotenv":"^17.2.1","openai":"^5.12.1","remeda":"^2.32.0","adm-zip":"^0.5.16","js-yaml":"^4.1.0","@types/js-yaml":"^4.0.9","@modelcontextprotocol/sdk":"^1.17.2"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.3","cross-env":"7.0.3","typescript":"^5.9.2","@types/node":"^24.2.0"},"_npmOperationalInternal":{"tmp":"tmp/appnest-ai-mcp_0.0.1_1772701021167_0.1754360274642186","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"type":"module","name":"@aravinthan_p/appnest-ai-mcp","description":"Bridges appnest with MCP tools so any MCP client can generate appnest app","version":"0.0.2","main":"build/server.js","bin":{"appnest-ai-mcp":"build/server.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"chmod 755 build/server.js","dev":"node build/server.js","inspect":"npx -y @modelcontextprotocol/inspector node build/server.js","start":"node build/server.js"},"keywords":["appnest","mcp","modelcontextprotocol"],"dependencies":{"@modelcontextprotocol/sdk":"^1.17.2","@types/js-yaml":"^4.0.9","adm-zip":"^0.5.16","dedent":"^1.6.0","dotenv":"^17.2.1","js-yaml":"^4.1.0","openai":"^5.12.1","remeda":"^2.32.0","sharp":"^0.33.5","zod":"^3.25.76"},"devDependencies":{"@types/node":"^24.2.0","cross-env":"7.0.3","tsx":"^4.20.3","typescript":"^5.9.2"},"_id":"@aravinthan_p/appnest-ai-mcp@0.0.2","gitHead":"7ded564c8385d97ae1a2da6dc5f8ee1dcbdc7081","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-QudbZqfp96ab4k6Hv+PFVcYc6cKCC+0vpTMnuVRXqRDUjtPjJsmTsK0E1YotxtPDiEK36t2HXjc/VL3F18s9LA==","shasum":"af6af265e62c70420e7e4ffd19fe3640d2e34829","tarball":"https://registry.npmjs.org/@aravinthan_p/appnest-ai-mcp/-/appnest-ai-mcp-0.0.2.tgz","fileCount":7,"unpackedSize":25304,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDNEHgDXkuVZa2Pk9MvbfyM56L31WoqsbyYk5gfe7CCyAiEAuM8Q58+XgobWhMqGS+dP5saYqC/yakigYnnVCsPSHC8="}]},"_npmUser":{"name":"aravinthan_p","email":"aravinthan.prabakaran@surveysparrow.com"},"directories":{},"maintainers":[{"name":"aravinthan_p","email":"aravinthan.prabakaran@surveysparrow.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/appnest-ai-mcp_0.0.2_1773825128066_0.8375342242726136"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-05T08:57:00.769Z","modified":"2026-03-18T09:12:08.932Z","0.0.1":"2026-03-05T08:57:01.322Z","0.0.2":"2026-03-18T09:12:08.223Z"},"keywords":["appnest","mcp","modelcontextprotocol"],"description":"Bridges appnest with MCP tools so any MCP client can generate appnest app","maintainers":[{"name":"aravinthan_p","email":"aravinthan.prabakaran@surveysparrow.com"}],"readme":"# Appnest AI MCP\n\nModel Context Protocol (MCP) server that connects AI clients (Cursor, Claude Desktop, etc.) to **Appnest** workflows: scaffold base code, install tooling, and run the `appnest-engine` CLI.\n\n---\n\n## Requirements\n\n| Requirement | Details |\n|-------------|---------|\n| **Node.js** | 18+ (uses `fetch`, ESM). |\n| **MCP client** | Any client that launches MCP over **stdio** (e.g. Cursor MCP config). |\n| **`appnest-engine`** | On `PATH`, for `run_appnest_command` and for **hi appnest** (precheck, install-packages). |\n| **Network** | Clone/setup tools download zips from GitHub (`appnest-sample-basecode`, `appnest-sample-tools`). |\n| **Project folder** | Run the MCP with **cwd = your Appnest project root**, or pass explicit paths where tools support it. |\n\n### Environment variables\n\n| Variable | Purpose |\n|----------|---------|\n| `.env` | Loaded via `dotenv` (e.g. future API keys). |\n\n### Cursor / MCP config example\n\n```json\n{\n  \"mcpServers\": {\n    \"appnest\": {\n      \"command\": \"node\",\n      \"args\": [\"/absolute/path/to/appnest-sample-ai-mcp/build/server.js\"],\n      \"cwd\": \"/absolute/path/to/your-appnest-project\"\n    }\n  }\n}\n```\n\nUse **`cwd`** so `hi appnest` clones into the intended folder and `appnest-engine` runs in the right tree.\n\n#### Why did clone go to a different folder (e.g. `appnest-base`)?\n\nThe MCP server only knows two things:\n\n1. **`cwd` in mcp.json** — Node’s `process.cwd()` when tools run. If you omit `targetDir`, clone uses **this** folder.\n2. **`targetDir` in the tool call** — Whatever path the model passes. If the assistant picks `/.../appnest-base`, files go there—even if you had **`appnest-sample-apps`** open.\n\n**Fix:** Set **`\"cwd\"`** in MCP to **`/Users/.../appnest-sample-apps`** (your real project). Then say *“clone the Appnest basecode into this project”* or *“omit targetDir”* so it uses that cwd. Or say explicitly: *“targetDir must be …/appnest-sample-apps”*.\n\n### Checklist for a working run\n\n1. **`npm install`** in this repo (so `@modelcontextprotocol/sdk` and deps resolve).\n2. **`build/server.js`** exists and is executable (`npm run build`).\n3. MCP **`cwd`** = the Appnest project directory (especially for **hi_appnest**).\n4. **`appnest-engine`** on `PATH` when using **run_appnest_command** / **hi_appnest** (on Windows, global npm CLIs usually work via the `exec` path used in code).\n5. **Network** for clone/setup zips (GitHub).\n\n---\n\n## Tools\n\n| Tool | Purpose |\n|------|---------|\n| **hi_appnest** | Full onboarding: clone basecode → `setup_appnest_tools` → precheck → install-packages. |\n| **clone_appnest_basecode** | Download & extract official base zip into `targetDir` (default: cwd). |\n| **setup_appnest_tools** | Refresh `appnest-tools/` from the sample tools repo. |\n| **run_appnest_command** | Runs `appnest-engine run <command>` with optional `workingDirectory`. Allowed: `precheck`, `install-packages`, `run-all`, `zip-app`. |\n\n---\n\n## Development\n\n```bash\nnpm install\nnpm run build    # ensures server.js is executable\nnpm run inspect  # MCP Inspector (optional)\n```\n\n**Note:** The MCP server and tools live under `build/`, which is **tracked in git** so clones include a runnable server. Run `npm run build` after edits if you change `server.js` shebang/permissions.\n\n---\n\n## Issues found & fixes applied\n\n| Issue | Severity | Fix |\n|-------|----------|-----|\n| **`console.log` in `run_appnest_command`** | **Critical** | MCP stdio transport uses **stdout** for JSON-RPC. Logging to stdout **breaks** the protocol. Removed; use stderr only if needed. |\n| **Wrong zip extract folder name** | **High** | Code expected `appnest-basecode-main` but the repo zip expands to **`appnest-sample-basecode-main`**. Clone failed or behaved randomly. Now resolves the extracted folder dynamically. |\n| **`hi_appnest` called clone with `{}`** | **High** | `targetDir` was required; validation failed. `targetDir` is now optional (defaults to cwd); `hi_appnest` passes explicit `projectRoot`. |\n| **`run_appnest` schema** | **Medium** | Mixed JSON-Schema-style shape vs Zod (used elsewhere). Normalized to **Zod** + strict allowed commands (**command injection** hardening). |\n| **`precheck.exitCode`** | **Medium** | Tool results had no `exitCode`. Precheck failure detection was unreliable. Engine command now appends `__MCP_EXIT_CODE__:<n>` for parsing. |\n| **`sendEvent` in clone catch** | **Medium** | MCP callbacks may not provide `sendEvent`; could throw. Now optional (`sendEvent?.(...)`). |\n| **`npm run build` / `dev`** | **Medium** | `tsc` + `src/server.ts` were referenced but no `tsconfig` / `src` in tree. Scripts now match the **JS `build/`** layout. |\n| **`bin`: `appnest-ai-mcp`** | — | After `npm i -g` or via `npx`, you can run `appnest-ai-mcp` instead of `node build/server.js`. |\n\n### Remaining / architectural notes\n\n1. **`server._registeredTools`** — Private SDK surface for `callTool` chaining; may break on SDK upgrades. Prefer official APIs if the SDK adds tool-to-tool invocation.\n2. **Dependencies** — `openai`, `sharp`, `remeda` may be unused by current tools; trim when you confirm.\n3. **Non-empty `targetDir`** — Cloning into a folder that already has files can cause rename collisions; prefer empty project roots for first-time setup.\n4. **`build/`** — Tracked in the repo so `git clone` includes the MCP server.\n\n---\n\n## License / package\n\nPackage name: `@aravinthan_p/appnest-ai-mcp`. Adjust `package.json` metadata as needed for your registry.\n","readmeFilename":"README.md"}