MCP Extension for SillyTavern
This extension adds WebSocket-based tool execution support to SillyTavern, allowing external tools to be registered and executed through a standardized interface.
Features
WebSocket server for real-time communication
Tool registration and execution system
JSON Schema validation for tool definitions
Real-time execution status updates
Configurable logging and WebSocket settings
Web-based settings UI integrated into SillyTavern
Related MCP server: Modular MCP Server & Client
Installation
Method 1: Web Interface (Recommended)
See INSTRUCTIONS.md for step-by-step instructions on installing through SillyTavern's web interface.
Method 2: Manual Installation
Clone this repository into your SillyTavern plugins directory:
cd /path/to/SillyTavern/plugins git clone https://github.com/CG-Labs/SillyTavern-MCP-Extension.git mcp-extensionInstall dependencies:
cd mcp-extension npm installRestart SillyTavern
Configuration
The extension can be configured through the SillyTavern UI under Settings > Extensions > MCP Extension.
Available Settings
WebSocket Port: The port number for the WebSocket server (default: 5005)
Log Level: Logging verbosity level (debug, info, warn, error)
Usage
Registering a Tool
To register a tool, send a WebSocket message with the following format:
Executing a Tool
To execute a registered tool, send a WebSocket message with the following format:
Execution Status Updates
The extension broadcasts execution status updates to all connected clients:
Execution Started
Execution Completed
Execution Failed
Error Codes
INVALID_NAME: Invalid tool nameINVALID_SCHEMA: Invalid tool schemaINVALID_URI: Invalid resource URIINVALID_HANDLER: Invalid handler implementationINVALID_ARGUMENTS: Invalid tool argumentsTOOL_EXISTS: Tool already registeredTOOL_NOT_FOUND: Tool not foundTOOL_EXECUTION_FAILED: Tool execution failedSERVER_ERROR: Internal server error
Development
Project Structure
Adding New Tools
To add a new tool:
Connect to the WebSocket server
Register your tool with a schema
Listen for execution requests
Handle execution and return results
Example tool implementation:
Contributing
Fork the repository
Create a feature branch
Commit your changes
Push to the branch
Create a Pull Request
Support
If you encounter any issues or have questions:
Check the GitHub Issues for existing problems
Create a new issue if your problem hasn't been reported
Join the SillyTavern Discord community for support
License
MIT License - see LICENSE file for details