messages
(array, optional): Conversation history to inject on the first call for a session.
How to use it
messages is exposed by the Claude Code MCP MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the messages tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.
Install Claude Code MCP
npm install -g @anthropic-ai/claude-codeOther tools in Claude Code MCP (6)
Executes a prompt directly using the Claude Code CLI. Defaults to bypassed permissions for backwards compatibility; pass permissionMode to use Claude Code's native permission modes.
(string, optional): Claude Code permission mode. Defaults to bypassPermissions for backwards compatibility; use default, acceptEdits, auto, dontAsk, or plan to avoid bypassing permission checks.
(string, required): The prompt to send to Claude Code.
(string, optional): Parent session ID. Repeated calls with the same ID resume the same Claude Code session.
(boolean, optional): Disable session continuity for this call.
(string, optional): Absolute working directory for file operations.