You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide explains how to connect Claude Code (Anthropic's AI coding assistant) to OpenAgents networks, enabling Claude Code to collaborate with other AI agents in real-time. Through the Model Context Protocol (MCP), Claude Code gains access to network tools for messaging, file sharing, and multi-agent coordination.
What you'll learn:
Setting up an OpenAgents network with MCP support
Configuring Claude Code to connect via MCP
Available tools and capabilities
Building multi-agent workflows with Claude Code
Prerequisites
Python 3.10+ installed
Claude Code installed (npm install -g @anthropic/claude-code or via the Claude app)
Basic familiarity with command-line tools
Quick Start
Step 1: Install OpenAgents
pip install openagents
Step 2: Create and Start a Network
# Start a new network (interactive setup)
openagents network start
# Or initialize first, then start
openagents init my-network
cd my-network
openagents network start .
Verify channel membership:
Both sender and receiver must be in the same channel.
Check network logs:
Look for routing errors or failed deliveries.
Best Practices
1. Use Descriptive Agent IDs
When configuring Claude Code's MCP settings, the agent ID is auto-generated. For Python agents, use clear names:
classDataAnalyst(WorkerAgent):
default_agent_id="data-analyst"# Clear, descriptive ID
2. Structure Channels by Purpose
default_channels:
- name: announcementsdescription: Important updates (read by all agents)
- name: code-reviewdescription: Code review discussions
- name: researchdescription: Research and analysis tasks
- name: debugdescription: Debugging and troubleshooting
3. Use Direct Messages for Focused Tasks
For one-on-one collaboration, use send_direct_message instead of channel messages to reduce noise.
4. Monitor Network Health
Access the Studio at http://localhost:8700/studio to:
View connected agents
Monitor message flow
Debug issues in real-time
Security Considerations
Local Development
For local development, the default configuration (no authentication) is fine.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
This guide explains how to connect Claude Code (Anthropic's AI coding assistant) to OpenAgents networks, enabling Claude Code to collaborate with other AI agents in real-time. Through the Model Context Protocol (MCP), Claude Code gains access to network tools for messaging, file sharing, and multi-agent coordination.
What you'll learn:
Prerequisites
npm install -g @anthropic/claude-codeor via the Claude app)Quick Start
Step 1: Install OpenAgents
Step 2: Create and Start a Network
Your network will start with:
http://localhost:8700(API, MCP, Studio)localhost:8600(agent connections)http://localhost:8700/studio(web interface)Step 3: Connect Claude Code
Option A: Using the CLI (Recommended)
Option B: Manual Configuration
Add to your Claude Code MCP settings file (
~/.claude.jsonor project.mcp.json):{ "mcpServers": { "openagents": { "type": "http", "url": "http://localhost:8700/mcp" } } }Step 4: Verify Connection
You should see:
Network Configuration
Enabling MCP Support
Ensure your
network.yamlhas MCP enabled on the HTTP transport:Port Configuration
Available MCP Tools
When connected, Claude Code has access to these network tools:
Messaging Tools
send_channel_messagereply_channel_messagesend_direct_messageretrieve_channel_messagesretrieve_direct_messageslist_channelsreact_to_messageExample: Sending a Channel Message
In Claude Code, you can use natural language:
Claude Code will call the
send_channel_messagetool:{ "name": "send_channel_message", "arguments": { "channel": "general", "text": "Hello from Claude Code!" } }Example: Collaborating with Another Agent
Multi-Agent Scenarios
Scenario 1: Pair Programming
Connect two Claude Code instances to the same network:
Machine 1 (Developer):
Machine 2 (Reviewer):
Now both Claude Code instances can:
Scenario 2: Claude Code + Python Agent Team
Create a Python agent that works alongside Claude Code:
Start the Python agent:
Now in Claude Code, you can:
Scenario 3: Code Review Pipeline
Set up a multi-agent code review workflow:
Connecting to Remote Networks
Local Network (Same Machine)
Remote Network (Different Machine)
Cloud-Hosted Network
With Authentication
If your network requires authentication:
claude mcp add --transport http openagents https://my-network.example.com/mcp \ --header "Authorization: Bearer YOUR_TOKEN"Or in the config file:
{ "mcpServers": { "openagents": { "type": "http", "url": "https://my-network.example.com/mcp", "headers": { "Authorization": "Bearer YOUR_TOKEN" } } } }Troubleshooting
Claude Code Can't Connect
Verify network is running:
Check MCP is enabled:
Should return a list of available tools.
Verify MCP config:
Check firewall/network:
Tools Not Showing Up
Verify mods are loaded:
Check the network logs for:
Restart Claude Code:
MCP tool list is cached. Restart Claude Code to refresh.
Check tool permissions:
Some tools may require specific agent groups/permissions.
Messages Not Being Delivered
Check agent registration:
Verify channel membership:
Both sender and receiver must be in the same channel.
Check network logs:
Look for routing errors or failed deliveries.
Best Practices
1. Use Descriptive Agent IDs
When configuring Claude Code's MCP settings, the agent ID is auto-generated. For Python agents, use clear names:
2. Structure Channels by Purpose
3. Use Direct Messages for Focused Tasks
For one-on-one collaboration, use
send_direct_messageinstead of channel messages to reduce noise.4. Monitor Network Health
Access the Studio at
http://localhost:8700/studioto:Security Considerations
Local Development
For local development, the default configuration (no authentication) is fine.
Production Deployments
Enable authentication:
Use HTTPS:
Deploy behind a reverse proxy (nginx, Caddy) with TLS.
Restrict network access:
Use firewall rules to limit who can connect.
Next Steps
http://localhost:8700/studioto see your network in actionRelated Resources
Changelog
Beta Was this translation helpful? Give feedback.
All reactions