connect mcp command integrates Private Connect with AI assistants (like Cursor, Claude Desktop, and other MCP-compatible tools) using the Model Context Protocol.
Usage
Actions
serve
Start MCP server for AI assistant communication
Show setup instructions for AI tools (default action)
Options
Hub server URL
Path to custom config file
Examples
Show Setup Instructions
Start MCP Server
- Reads JSON-RPC messages from stdin
- Implements MCP protocol
- Provides tools and resources to AI
- Writes responses to stdout
Available Tools
When connected, AI assistants have access to these tools:Service Management
list_services
List all services in the Private Connect networkArguments:
status: Filter by “all”, “online”, or “offline”
reach_service
Connect to a service and create a local tunnelArguments:
service: Service nameport: Local port (optional)
check_service
Run diagnostics on a serviceArguments:
service: Service name
expose_service
Expose a local service to the networkArguments:
target: Target to expose (e.g., “localhost:3000”)name: Service name
Environment Sharing
Create a share code for teammatesArguments:
name: Friendly name (optional)expires: Expiration (e.g., “24h”, “7d”)
get_connection_info
Get current agent and workspace info
get_connection_string
Get a connection string for a serviceArguments:
service: Service nameformat: “url”, “env”, or “json”
Agent Permission Broker
broker_check_file
Check if writing to a file is allowedArguments:
path: File path to check
broker_check_command
Check if running a command is allowedArguments:
command: Shell command to check
broker_write_file
Write content to a file (policy-enforced)Arguments:
path: File pathcontent: File content
broker_run_command
Run a shell command (policy-enforced)Arguments:
command: Shell commandworkingDir: Working directory (optional)
broker_get_policy
Get current security policy rules
Agent Orchestration
list_agents
List all agents in the workspaceArguments:
onlineOnly: Show only online agentscapability: Filter by capability
register_capabilities
Register capabilities this agent providesArguments:
capabilities: Array of capability objects
send_agent_message
Send a message to another agentArguments:
toAgentId: Target agent IDpayload: Message payload (JSON object)channel: Channel name (optional)type: “request”, “response”, or “event”
broadcast_message
Broadcast a message to all agentsArguments:
payload: Message payload (JSON object)channel: Channel name (optional)
get_agent_messages
Get messages sent to this agentArguments:
channel: Filter by channel (optional)unreadOnly: Show only unread messageslimit: Maximum messages to return
find_agents_by_capability
Find agents with a specific capabilityArguments:
capability: Capability to search for
create_session
Create an orchestration sessionArguments:
name: Session namettlMinutes: Time-to-live in minutesmetadata: Optional metadata (JSON object)
end_session
End an orchestration sessionArguments:
sessionId: Session ID to end
Available Resources
MCP resources provide read-only access to data:pconnect://services
List of all services in your network (JSON)
pconnect://status
Current agent connection status and info (JSON)
Example AI Prompts
Once configured, you can ask your AI assistant:Service Discovery
Service Connection
Service Health
Environment Sharing
Getting Connection Info
Policy-Enforced Operations
Multi-Agent Workflows
Configuration Examples
Cursor IDE
Create or edit~/.cursor/mcp.json:
Claude Desktop
macOS: Create or edit~/Library/Application Support/Claude/claude_desktop_config.json:
~/.config/Claude/claude_desktop_config.json:
Security Policies
The Agent Permission Broker enforces security policies defined in.connect/policy.yml:
Exit Codes
0- MCP server exited normally1- Agent not configured or MCP protocol error
Related Commands
connect up- Authenticate before using MCPconnect expose- Expose services accessible to AIconnect reach- Services AI can connect to
Troubleshooting
AI Can’t Connect to MCP Server
Verify the command path:“Agent not configured” Error
Authenticate first:MCP Server Not Responding
Test manually:Debug MCP Communication
Check your AI tool’s logs: Cursor:- View → Output → Select “MCP” from dropdown
- Check console logs in the app
Permission Denied Errors
If broker blocks operations:- Check policy:
.connect/policy.yml - Add allow rules for your use case
- Or set
default: allowfor development (not recommended for production)