Summary
Start and connect to a local Stdio Model Context Protocol (MCP) server. This extends AI model capabilities with custom tools and functions provided by MCP servers.- Needs Admin: False
- Version: 0
- Author: @Ne0nd0g
Arguments
command
- Description: The command or program to start the MCP server
- Required: True
- Type: String
args
- Description: Arguments to pass to the command
- Required: False
- Type: Array of Strings
Usage
Detailed Summary
Themcp-connect command launches a Stdio-based Model Context Protocol server and establishes a connection to it. MCP servers provide additional tools and capabilities that AI models can use during inference.
Model Context Protocol (MCP)
MCP is a standardized protocol for connecting AI models to external tools and data sources. When an MCP server is connected:- Models can discover available tools
- Tools can be invoked during chat or query operations
- Results are seamlessly integrated into responses
- Enhanced reasoning and action capabilities are available
Stdio MCP Requirements
Container Deployment If Sage runs in Docker:- Install MCP server dependencies in the Sage container
- Modify the Dockerfile to include required packages
- Place MCP server code inside the container
- Use container-internal paths in the command
- Install MCP server dependencies on the host
- Use host filesystem paths
- Ensure proper permissions for the Sage process
Mythic MCP Server
Sage includes the Mythic MCP server pre-installed at/opt/mythic_mcp/.
Connection Example
uv- Command to run (UV Python package runner)--directory- Working directory for the MCP server/opt/mythic_mcp/- Location of Mythic MCP coderun- UV subcommand to execute the servermain.py- MCP server entry pointmythic_admin- Mythic username for API accessSuperSecretPassword- Mythic user password127.0.0.1- Mythic server IP (not loopback if containerized)7443- Mythic server port
When running in a container, use the actual IP address instead of 127.0.0.1 or localhost for Mythic connectivity.
Custom MCP Servers
You can connect to any Stdio-based MCP server: Python MCP ServerTool Integration
Once connected, MCP tools become available to models: In Chat Sessions- Tools are automatically discovered
- Models can request tool usage
- Results are incorporated into conversation
- Single queries can use MCP tools
- Tool results appear in the response
- Enable with the
toolsparameter
Troubleshooting
Connection Failures- Verify command path is correct
- Check all dependencies are installed
- Ensure arguments are properly formatted
- Review MCP server logs for errors
- Confirm Sage process has execution permissions
- Check file paths are accessible
- Verify network access if MCP calls external services
- Ensure MCP server implements the protocol correctly
- Check server initialization completes successfully
- Verify tools are properly registered
Security Considerations
- MCP servers have access to Sage’s execution context
- Validate and trust MCP server code before connecting
- Limit MCP server permissions when possible
- Audit tool calls in production environments
- Consider network isolation for sensitive operations
Best Practices
- Test MCP connections in a development environment first
- Document required dependencies for your MCP servers
- Use environment variables for sensitive configuration
- Monitor MCP server resource usage
- Implement proper error handling in custom MCP servers