MCP, both directions
The Model Context Protocol connects agents to tools. intellibrix
speaks it as a client and as a server, from @intellibrix/mcp.
Use a remote server’s tools
Section titled “Use a remote server’s tools”import { mcpTools } from '@intellibrix/mcp'
const { tools, close } = await mcpTools({ transport: 'stdio', command: 'npx', args: ['some-mcp-server'],})
brick.use(tools)// …laterawait close()Results from remote servers are tagged untrusted, so your approval policy
can treat them with suspicion.
Serve a brick to Claude Desktop, Cursor and others
Section titled “Serve a brick to Claude Desktop, Cursor and others”Every Program on a brick becomes an MCP tool.
import { serveMcp } from '@intellibrix/mcp'
await serveMcp(brick, { transport: 'stdio' })Or use the CLI on a module whose default export is a brick:
npx @intellibrix/cli mcp serve ./src/brick.tsRegister it with a client, for example with Claude Code:
claude mcp add words -- npx @intellibrix/cli mcp serve ./src/brick.ts.
- Logs go to stderr. On stdio transports stdout carries the protocol, so intellibrix keeps
logging off it. Set
INTELLIBRIX_LOG_STDERRto log JSON to stderr from your own code. - Gated tools are denied unless you pass
onToolApprovaltoserveMcp. Input from a remote caller is untrusted by definition. - Sampling and elicitation are supported, so a server can ask the client’s model for completions or ask the user for input.
See the mcp-server example.