Documentation menu

Docs

MCP

NanoCodana speaks the Model Context Protocol: pass servers via mcpServers and their tools merge into the agent alongside the built-ins — same streaming, same approval rules.

const agent = NodeAgent({
  model,
  workingDirectory: process.cwd(),
  mcpServers: {
    github: {
      command: 'npx',
      args: ['-y', '@modelcontextprotocol/server-github'],
    },
  },
})
// The agent can now call the GitHub server's tools like any built-in.

Approval applies#

MCP tools go through the same gate as everything else — list their names in needsApproval (or match them in your predicate) and the stream pauses for a decision before they run.

When to reach for MCP#

Write a custom tool (the tools option) when the capability is yours and small. Connect an MCP server when the capability already exists as one — issue trackers, databases, browsers, internal platforms — and you'd rather adopt than re-implement.

MCP servers are processes with real credentials and real reach. Treat third-party servers like third-party code: read what they expose, and gate the risky tools.