{"_id":"@dpopsuev/alef-adapter-mcp-registry","_rev":"2-27be48e4c4e756ade6f0cacd77c7567d","name":"@dpopsuev/alef-adapter-mcp-registry","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@dpopsuev/alef-adapter-mcp-registry","version":"0.0.1","_id":"@dpopsuev/alef-adapter-mcp-registry@0.0.1","maintainers":[{"name":"dpopsuev","email":"dpopsuev@redhat.com"}],"dist":{"shasum":"5a62b7e36b695e0ef38c64106e8c1c0e448d9887","tarball":"https://registry.npmjs.org/@dpopsuev/alef-adapter-mcp-registry/-/alef-adapter-mcp-registry-0.0.1.tgz","fileCount":25,"integrity":"sha512-uaPZ0ZFDuqugNEeFPwDWlFQkZ2xCAHEEx/fD8QP9utyOtKg0lXin86XwE35pyjp3frqdRL1bcio+1jUJicJdFQ==","signatures":[{"sig":"MEUCIQCjErJaco3Xbn12c3HNQjxTIP9D52MvI6lqGigBjtAHSQIgIRspgD+KqNOdyXek5AfCxiIoJZRsLWjPCuR0DuVNKgI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":148686},"main":"./src/index.ts","type":"module","_from":"file:dpopsuev-alef-adapter-mcp-registry-0.0.1.tgz","exports":{".":{"source":"./src/index.ts","default":"./src/index.ts"}},"scripts":{"test":"vitest --run"},"_npmUser":{"name":"dpopsuev","email":"dpopsuev@redhat.com"},"_resolved":"/tmp/219329ee3f4e977a20976de2f1cd3c47/dpopsuev-alef-adapter-mcp-registry-0.0.1.tgz","_integrity":"sha512-uaPZ0ZFDuqugNEeFPwDWlFQkZ2xCAHEEx/fD8QP9utyOtKg0lXin86XwE35pyjp3frqdRL1bcio+1jUJicJdFQ==","_npmVersion":"10.9.7","description":"MCP Registry discovery organ — search, install, and manage Model Context Protocol servers from the official registry.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"zod":"^4.4.3","@ai-sdk/mcp":"^1.0.42","@dpopsuev/alef-kernel":"0.0.1","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.6","@dpopsuev/alef-testkit":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/alef-adapter-mcp-registry_0.0.1_1782397823535_0.1706795225906068","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Deprecated — package renamed, do not install"}},"time":{"created":"2026-06-25T14:30:23.325Z","modified":"2026-06-25T15:43:27.609Z","0.0.1":"2026-06-25T14:30:23.736Z"},"description":"MCP Registry discovery organ — search, install, and manage Model Context Protocol servers from the official registry.","maintainers":[{"name":"dpopsuev","email":"dpopsuev@redhat.com"}],"readme":"# @dpopsuev/alef-organ-mcp-registry\n\nMCP Registry discovery organ — search, install, and manage Model Context Protocol servers from the official registry.\n\n## Features\n\n- **Search MCP Registry**: Query the official [MCP Registry](https://registry.modelcontextprotocol.io) to find available MCP servers\n- **Install MCP Servers**: Dynamically load MCP servers via stdio (npx) or HTTP transport\n- **List Loaded Servers**: View all currently loaded MCP organs and their tools\n\n## Tools\n\n### `mcp.search`\n\nSearch the MCP Registry for available MCP servers.\n\n**Parameters:**\n- `query` (string, required): Search query to find MCP servers (e.g. 'filesystem', 'github', 'sql')\n- `limit` (number, optional): Maximum number of results to return (default: 10)\n\n**Returns:**\n- `query`: The search query used\n- `count`: Number of servers found\n- `servers`: Array of server metadata including name, description, version, repository, and packages\n\n**Example:**\n```typescript\nawait agent.call(\"mcp.search\", { query: \"filesystem\", limit: 5 });\n```\n\n### `mcp.install`\n\nInstall and load an MCP server from npm or other package registry.\n\n**Parameters:**\n- `serverName` (string, required): Full server name from registry (e.g. 'io.github.owner/repo')\n- `transport` (enum: \"stdio\" | \"http\", required): Transport type\n  - `stdio`: For local MCP servers (uses npx by default)\n  - `http`: For remote HTTP-based MCP servers\n- `config` (object, optional):\n  - `command` (string): Command to run (default: 'npx' for stdio transport)\n  - `args` (array of strings): Arguments to pass to the command\n  - `url` (string): URL for HTTP transport (required for http transport)\n\n**Returns:**\n- `serverName`: The name of the installed server\n- `transport`: Transport type used\n- `toolCount`: Number of tools provided by the server\n- `tools`: Array of tool definitions\n\n**Example:**\n```typescript\n// Install from npm using npx (default)\nawait agent.call(\"mcp.install\", {\n  serverName: \"io.github.bytedance/mcp-server-filesystem\",\n  transport: \"stdio\"\n});\n\n// Install with custom command\nawait agent.call(\"mcp.install\", {\n  serverName: \"io.github.owner/custom-server\",\n  transport: \"stdio\",\n  config: {\n    command: \"npx\",\n    args: [\"-y\", \"@custom/mcp-server\"]\n  }\n});\n\n// Install HTTP server\nawait agent.call(\"mcp.install\", {\n  serverName: \"remote-server\",\n  transport: \"http\",\n  config: {\n    url: \"https://mcp.example.com\"\n  }\n});\n```\n\n### `mcp.list`\n\nList all currently loaded MCP organs and their tools.\n\n**Parameters:** None\n\n**Returns:**\n- `count`: Number of loaded MCP organs\n- `organs`: Array of loaded organs with their tools\n\n**Example:**\n```typescript\nawait agent.call(\"mcp.list\", {});\n```\n\n## Usage\n\n```typescript\nimport { createMcpRegistryOrgan } from \"@dpopsuev/alef-organ-mcp-registry\";\n\n// Create the organ\nconst mcpRegistry = createMcpRegistryOrgan({ cwd: process.cwd() });\n\n// Load it into your agent\nagent.load(mcpRegistry);\n\n// Now you can use the tools\nconst searchResults = await agent.call(\"mcp.search\", {\n  query: \"filesystem\",\n  limit: 10\n});\n\n// Install a server\nawait agent.call(\"mcp.install\", {\n  serverName: \"io.github.bytedance/mcp-server-filesystem\",\n  transport: \"stdio\"\n});\n\n// List loaded servers\nawait agent.call(\"mcp.list\", {});\n```\n\n## Development\n\n```bash\n# Run tests\nnpm test\n\n# Run tests in watch mode\nnpm run test:watch\n```\n\n## Architecture\n\nThe organ maintains an internal map of loaded MCP servers using `McpOrgan.stdio()` and `McpOrgan.http()` from the kernel. When you install a server:\n\n1. The organ checks if it's already loaded\n2. It creates an MCP client using the appropriate transport\n3. The MCP client discovers tools from the server\n4. The organ stores the loaded organ in its internal map\n5. The tools become available for use\n\n## API Reference\n\nThe MCP Registry API is documented at:\n- OpenAPI Spec: https://github.com/modelcontextprotocol/registry/blob/main/docs/reference/api/official-registry-api.md\n- Base URL: https://registry.modelcontextprotocol.io/v0\n\n## License\n\nMIT\n","readmeFilename":"README.md"}