physical-ai
v0.1.0
Published
MCPX - npm package manager for MCP (for both local and remote MCPs)
Maintainers
Readme
MCPX
MCPX is an npm package manager for MCP (Model Control Protocol), supporting both local and remote MCPs.
Installation
npm install mcpxUsage
import { MCPX } from 'mcpx';
// Initialize MCPX
const mcpx = new MCPX();
// Example: Install a package
mcpx.install('package-name')
.then(() => console.log('Package installed successfully!'))
.catch(err => console.error('Error installing package:', err));
// Example: Use a local MCP
const localMcp = mcpx.local('path/to/local/mcp');
await localMcp.run();
// Example: Connect to a remote MCP
const remoteMcp = mcpx.remote('https://example.com/mcp-endpoint');
await remoteMcp.connect();Features
- Manage MCP packages easily
- Support for both local and remote MCPs
- TypeScript support
- Simple, intuitive API
API Reference
MCPX Class
The main class for interacting with MCPX.
Methods
install(packageName: string, options?: InstallOptions): Promise<void>uninstall(packageName: string): Promise<void>list(): Promise<Package[]>local(path: string): LocalMCPremote(url: string): RemoteMCP
LocalMCP Class
For working with local MCPs.
Methods
run(options?: RunOptions): Promise<void>stop(): Promise<void>
RemoteMCP Class
For working with remote MCPs.
Methods
connect(options?: ConnectOptions): Promise<void>disconnect(): Promise<void>
License
MIT
