MCP
The Model Context Protocol lets agents use tools served by other processes — and lets you expose your own tools to any MCP client.
Consume remote tools
MCPClient connects to one or more MCP servers and surfaces their tools as Redtuma ToolActions you can hand to an agent.
mcp.ts
import { MCPClient } from '@redtuma/mcp'
const mcp = new MCPClient({
servers: {
filesystem: { command: 'npx', args: ['-y', '@modelcontextprotocol/server-filesystem', '.'] },
},
})
const tools = await mcp.getTools()
const agent = new Agent({
id: 'assistant',
instructions: '...',
model: 'anthropic/claude-opus-4-8',
tools,
})Serve your tools
Expose your own tools (and agents) over MCP with MCPServer.
import { MCPServer } from '@redtuma/mcp'
const server = new MCPServer({ tools: { getWeather } })
await server.start()