{"versions":{"0.0.1":{"name":"@ag-ui/mcp-apps-middleware","author":{"name":"Markus Ecker"},"version":"0.0.1","publishConfig":{"access":"public"},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","sideEffects":false,"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"peerDependencies":{"@ag-ui/client":">=0.0.40","rxjs":"7.8.1"},"devDependencies":{"@types/node":"^20.11.19","rxjs":"7.8.1","tsup":"^8.0.2","typescript":"^5.3.3","vitest":"^2.0.0","@ag-ui/client":"0.0.42-alpha.3"},"scripts":{"build":"tsup","dev":"tsup --watch","clean":"rm -rf dist","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","link:global":"pnpm link --global","unlink:global":"pnpm unlink --global"},"_id":"@ag-ui/mcp-apps-middleware@0.0.1","description":"MCP Apps middleware for AG-UI that enables UI-enabled tools from MCP (Model Context Protocol) servers.","_integrity":"sha512-GndsrxBr12Ji/Ioa4zYALbmEGD7cglExIwL7wlco3/PVyqk1WsjybxRNyDj+p9NQh2HJ3s/ctEJWGxwVUyC+fw==","_resolved":"/private/var/folders/0t/pq2_7rn97834lcsvc_qy4t8r0000gn/T/3743d3d08919a71ca21c2ac6cb20bd50/ag-ui-mcp-apps-middleware-0.0.1.tgz","_from":"file:ag-ui-mcp-apps-middleware-0.0.1.tgz","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-GndsrxBr12Ji/Ioa4zYALbmEGD7cglExIwL7wlco3/PVyqk1WsjybxRNyDj+p9NQh2HJ3s/ctEJWGxwVUyC+fw==","shasum":"f80f240549ac5d31a8f19d1df5d0a1db647265c6","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@ag-ui/mcp-apps-middleware/-/mcp-apps-middleware-0.0.1.tgz","fileCount":9,"unpackedSize":78709,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD5gXECBL0ZesJjYL1J3+0kvxRbGuhvlJpKrgUhvoRhFwIhANcRH4wH3ZI7aeVTUpVJ69RX9LKJTq12ajZ6Tj0UUYcY"}],"size":15029},"_npmUser":{"name":"anonymous","email":"markus.ecker@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"markus.ecker@gmail.com"},{"name":"anonymous","email":"devops@copilotkit.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-apps-middleware_0.0.1_1764938388444_0.8436880567405862"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-12-05T12:39:48.591Z","publish_time":1764938388591,"_source_registry_name":"default","contributors":[]},"0.0.2":{"name":"@ag-ui/mcp-apps-middleware","author":{"name":"Markus Ecker"},"version":"0.0.2","publishConfig":{"access":"public"},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","sideEffects":false,"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"peerDependencies":{"@ag-ui/client":">=0.0.40","rxjs":"7.8.1"},"devDependencies":{"@types/node":"^20.11.19","rxjs":"7.8.1","tsup":"^8.0.2","typescript":"^5.3.3","vitest":"^2.0.0","@ag-ui/client":"0.0.42"},"scripts":{"build":"tsup","dev":"tsup --watch","clean":"rm -rf dist","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","link:global":"pnpm link --global","unlink:global":"pnpm unlink --global"},"_id":"@ag-ui/mcp-apps-middleware@0.0.2","description":"MCP Apps middleware for AG-UI that enables UI-enabled tools from MCP (Model Context Protocol) servers.","_integrity":"sha512-EMHm65hs3aNfoCpxZ1RYDLvZejmit0yipvzg39jwKrGTzqvB3CZuZUenDS9o2eWu2PZIvcFuvU15nEwH7SZb8A==","_resolved":"/private/var/folders/0t/pq2_7rn97834lcsvc_qy4t8r0000gn/T/e30a517851d414915b500930e7aa9962/ag-ui-mcp-apps-middleware-0.0.2.tgz","_from":"file:ag-ui-mcp-apps-middleware-0.0.2.tgz","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-EMHm65hs3aNfoCpxZ1RYDLvZejmit0yipvzg39jwKrGTzqvB3CZuZUenDS9o2eWu2PZIvcFuvU15nEwH7SZb8A==","shasum":"656847e8b8dee89a2bb4aa3ed28498433d9fe6b4","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@ag-ui/mcp-apps-middleware/-/mcp-apps-middleware-0.0.2.tgz","fileCount":9,"unpackedSize":78122,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDE5tPjrR5xT6tH25WvkCXNml9iaSD2uXavdh9BXEYS6AIgULuwyTFEInsXZ7mxcc5eeuh7sRPurX4OVJ5GypbAMoA="}],"size":15361},"_npmUser":{"name":"anonymous","email":"markus.ecker@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"markus.ecker@gmail.com"},{"name":"anonymous","email":"devops@copilotkit.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-apps-middleware_0.0.2_1768305462382_0.06318223350785312"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-13T11:57:42.527Z","publish_time":1768305462527,"_source_registry_name":"default","contributors":[]},"0.0.3":{"name":"@ag-ui/mcp-apps-middleware","author":{"name":"Markus Ecker"},"version":"0.0.3","publishConfig":{"access":"public"},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","sideEffects":false,"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0","rxjs":"7.8.1"},"peerDependencies":{"@ag-ui/client":">=0.0.40"},"devDependencies":{"@types/node":"^20.11.19","rxjs":"7.8.1","tsup":"^8.0.2","typescript":"^5.3.3","vitest":"^2.0.0","@ag-ui/client":"0.0.43"},"scripts":{"build":"tsup","dev":"tsup --watch","clean":"rm -rf dist","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","link:global":"pnpm link --global","unlink:global":"pnpm unlink --global"},"_id":"@ag-ui/mcp-apps-middleware@0.0.3","description":"MCP Apps middleware for AG-UI that enables UI-enabled tools from MCP (Model Context Protocol) servers.","_integrity":"sha512-Z+NZQXj4J+Y/2PLNsiyhNzRWFtTT2sAoC5dztoAlIsdfzvLvYEa52YGdHesNTN85JJqaIrYxQ8e31IBpKjrnoA==","_resolved":"/private/var/folders/0t/pq2_7rn97834lcsvc_qy4t8r0000gn/T/1a698e4249bcf7358c58f0c86badbe6f/ag-ui-mcp-apps-middleware-0.0.3.tgz","_from":"file:ag-ui-mcp-apps-middleware-0.0.3.tgz","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-Z+NZQXj4J+Y/2PLNsiyhNzRWFtTT2sAoC5dztoAlIsdfzvLvYEa52YGdHesNTN85JJqaIrYxQ8e31IBpKjrnoA==","shasum":"27a1c2976a3b48ae58ef1707251a1792d8725a28","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@ag-ui/mcp-apps-middleware/-/mcp-apps-middleware-0.0.3.tgz","fileCount":9,"unpackedSize":78122,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID33+0CFlJqcZAGfpgigDn9bnnbiC8ctEuF38R1ByO2fAiEAnbEuc3mTFgHrKZOckiCkjHTVVBeUsHETJRG4cGjOjD4="}],"size":15360},"_npmUser":{"name":"anonymous","email":"markus.ecker@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"markus.ecker@gmail.com"},{"name":"anonymous","email":"devops@copilotkit.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-apps-middleware_0.0.3_1768491893035_0.6495460920799365"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-15T15:44:53.182Z","publish_time":1768491893182,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"0.0.3"},"name":"@ag-ui/mcp-apps-middleware","time":{"created":"2025-12-05T12:39:59.879Z","modified":"2026-01-15T15:45:05.582Z","0.0.1":"2025-12-05T12:39:48.591Z","0.0.2":"2026-01-13T11:57:42.527Z","0.0.3":"2026-01-15T15:44:53.182Z"},"readme":"# @ag-ui/mcp-apps-middleware\n\nMCP Apps middleware for AG-UI that enables UI-enabled tools from MCP (Model Context Protocol) servers.\n\n## Installation\n\n```bash\nnpm install @ag-ui/mcp-apps-middleware\n# or\npnpm add @ag-ui/mcp-apps-middleware\n```\n\n## Usage\n\n```typescript\nimport { MCPAppsMiddleware } from \"@ag-ui/mcp-apps-middleware\";\n\nconst agent = new YourAgent().use(\n  new MCPAppsMiddleware({\n    mcpServers: [\n      { type: \"http\", url: \"http://localhost:3001/mcp\", serverId: \"weather-server\" }\n    ],\n  })\n);\n```\n\n## Features\n\n- Discovers UI-enabled tools from MCP servers\n- Injects tools into the agent's tool list\n- Executes tool calls and emits activity snapshots with resource URIs\n- Supports proxied MCP requests for frontend resource fetching\n\n## Configuration\n\n```typescript\ninterface MCPAppsMiddlewareConfig {\n  mcpServers?: MCPClientConfig[];\n}\n\ntype MCPClientConfig =\n  | { type: \"http\"; url: string; serverId?: string }\n  | { type: \"sse\"; url: string; headers?: Record<string, string>; serverId?: string };\n```\n\n### Server ID\n\nThe optional `serverId` field provides a stable identifier for the server. This is useful when:\n- Server URLs may change (e.g., different environments)\n- You want human-readable server identification\n- Frontend code needs to reference servers by name\n\nIf `serverId` is not provided, the server is identified by an MD5 hash of its configuration.\n\n## Activity Snapshot\n\nThe middleware emits activity snapshots with the following structure:\n\n```typescript\n{\n  type: \"ACTIVITY_SNAPSHOT\",\n  activityType: \"mcp-apps\",\n  content: {\n    result: MCPToolCallResult,     // Result from the tool execution\n    resourceUri: string,           // URI of the UI resource to fetch\n    serverHash: string,            // MD5 hash of server config\n    serverId?: string,           // Server ID (if configured)\n    toolInput: Record<string, unknown>  // Arguments passed to the tool\n  },\n  replace: true\n}\n```\n\nThe frontend should fetch the resource content via proxied MCP request using `resourceUri` and either `serverHash` or `serverId`.\n\n## Proxied MCP Requests\n\nThe middleware supports proxied MCP requests from the frontend. Pass a `ProxiedMCPRequest` in `forwardedProps.__proxiedMCPRequest`:\n\n```typescript\ninterface ProxiedMCPRequest {\n  serverHash: string;      // MD5 hash of server config\n  serverId?: string;     // Optional server ID for lookup\n  method: string;          // MCP method (e.g., \"resources/read\", \"tools/call\")\n  params?: Record<string, unknown>;\n}\n```\n\nServer lookup prefers `serverId` if provided, falling back to `serverHash`.\n\n## Exported Utilities\n\n```typescript\nimport {\n  MCPAppsActivityType,  // \"mcp-apps\" constant\n  getServerHash         // Generate server hash from config\n} from \"@ag-ui/mcp-apps-middleware\";\n```\n\n## License\n\nMIT","users":{}}