Loading...
Loading...
Learn how to use OmniMCP with practical, real-world examples. From basic connections to advanced AI integrations, find the code you need to get started.
Connect to an MCP server using stdio transport
import { MCPClient } from '@omnimcp/client';
// Create and connect to an MCP server
const client = new MCPClient();
await client.connect({
type: 'stdio',
options: {
command: 'python',
args: ['my-mcp-server.py']
}
});
// Discover available tools
console.log('Available tools:', Array.from(client.tools.keys()));
// Call a tool
const result = await client.callTool('search', {
query: 'Model Context Protocol'
});
// Disconnect when done
await client.disconnect();
Install OmniMCP
npm install @omnimcp/client
Copy the example code
Paste it into your project and customize as needed
Run your code
Make sure your MCP server is running first