Package Information
Downloads: 1 weekly / 8 monthly
Latest Version: 0.1.1
Author: Anthropic
Documentation
n8n-nodes-agentsdk
This is an n8n community node that integrates Claude Agent SDK into n8n workflows with enhanced session management and MCP support.
Features
- Autonomous Agent Execution: Run Claude Agent SDK operations directly in n8n workflows
- Session Continuity: Resume conversations across workflow executions with
continueoperation - MCP Integration: Native support for Model Context Protocol servers
- Tool Control: Granular control over which Claude tools are allowed/disallowed
- Multiple Output Formats: Structured, messages, or plain text output
- Project Path Support: Execute operations in specific project directories
- Debug Mode: Comprehensive logging for troubleshooting
Installation
Community Nodes (Recommended)
- Go to Settings > Community Nodes in n8n
- Select Install
- Enter
@anthropic/n8n-nodes-agentsdk - Click Install
Manual Installation
# Navigate to n8n installation
cd ~/.n8n/nodes
# Clone repository
git clone https://github.com/anthropics/n8n-nodes-agentsdk.git
# Install dependencies
cd n8n-nodes-agentsdk
npm install
# Build
npm run build
# Restart n8n
Configuration
API Keys
Set your Anthropic API key as an environment variable:
export ANTHROPIC_API_KEY='your-api-key-here'
Or configure it in your n8n credentials settings.
MCP Servers (Optional)
To use MCP servers with Agent SDK:
- Create
.mcp.jsonin your project root or user home directory - Configure MCP servers (see MCP documentation)
- Agent SDK will automatically load configurations when running
Usage
Basic Query
- Add "Agent SDK" node to your workflow
- Select "Query" operation
- Enter your prompt
- Choose model (Sonnet/Opus)
- Configure output format
- Execute workflow
Continue Conversation
- Run initial query
- Add another Agent SDK node
- Select "Continue" operation
- Enter follow-up prompt
- Agent maintains conversation context
Advanced Configuration
Allowed/Disallowed Tools:
- Select which built-in Claude tools to enable/disable
- Disallowed tools take precedence over allowed
Project Path:
- Set working directory for Agent SDK operations
- Enables file access and command execution in specific locations
Additional Options:
- Debug Mode: Enable detailed logging
- Fallback Model: Automatic model switching on overload
- Max Thinking Tokens: Control internal reasoning tokens
- Permission Mode: Configure tool usage permissions
- System Prompt: Add custom context/instructions
Examples
Code Analysis Workflow
Webhook Trigger → Agent SDK (Query: "Analyze this codebase") → Slack (Send Results)
Automated Code Review
GitHub Trigger → Agent SDK (Query: "Review PR #123") → Create Issue (if issues found)
Database Schema Generator
HTTP Request (Get Requirements) → Agent SDK (Query: "Generate SQL schema") → PostgresSQL (Execute)
Comparison with claude-code Package
| Feature | claude-code | agent-sdk |
|---|---|---|
| Session Management | Basic | Enhanced |
| MCP Support | Limited | Native |
| Error Handling | Standard | Production-ready |
| Streaming | Yes | Improved |
| Performance | Good | Optimized |
Development
# Clone repository
git clone https://github.com/anthropics/n8n-nodes-agentsdk.git
cd n8n-nodes-agentsdk
# Install dependencies
npm install
# Build
npm run build
# Development mode (watch)
npm run dev
# Format code
npm run format
# Lint
npm run lint
# Link for local testing
npm link
n8n start
Troubleshooting
Build Errors
# Clean and rebuild
npm run build
Node Not Appearing in n8n
- Verify installation in
~/.n8n/nodes - Check n8n logs for errors
- Restart n8n completely
- Clear browser cache
API Key Issues
- Verify
ANTHROPIC_API_KEYenvironment variable - Check API key has proper permissions
- Ensure n8n has access to environment variables
Debug Mode
Enable "Debug Mode" in Additional Options to get detailed execution logs in n8n.
Resources
License
MIT
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Support
Version: 0.0.0-development
Last Updated: 2025-10-03