Custom MCP Servers
Add custom MCP servers to extend your chatbot with your own integrations.
Server Types
| Type | Description | Best For |
|---|---|---|
| HTTP | REST API-based server | Cloud services |
| stdio | Command-line based | Local tools |
Adding an HTTP Server
- Go to "Settings" > "Integrations"
- Click "Add Custom Server"
- Select "HTTP"
- Enter server details:
- Name
- URL
- Authentication (if required)
- Click "Test Connection"
- Click "Save"
HTTP Server Configuration
{
"name": "My Custom Server",
"type": "http",
"url": "https://your-server.example.com/mcp",
"headers": {
"Authorization": "Bearer your-api-key"
}
}
Adding a stdio Server
- Go to "Settings" > "Integrations"
- Click "Add Custom Server"
- Select "stdio"
- Enter server details:
- Name
- Command
- Arguments
- Click "Test"
- Click "Save"
stdio Server Configuration
{
"name": "Local Tool",
"type": "stdio",
"command": "python",
"args": ["-m", "my_mcp_server"]
}
Tool Discovery
After adding a server, WizChat discovers available tools:
- Server is queried for capabilities
- Tools are listed in the integration settings
- You can enable/disable specific tools
Configuring Tools
For each discovered tool:
- Click on the tool
- Configure parameters
- Set descriptions for the AI
- Enable/disable as needed
Server Requirements
Your MCP server must:
- Implement the MCP protocol
- Respond to capability queries
- Handle tool execution requests
- Return properly formatted responses
MCP Protocol Resources
Testing Custom Servers
Test Connection
- Click "Test Connection"
- Verify server responds
- Check tool discovery
Test Tools
- Use the chatbot test feature
- Ask questions that trigger your tools
- Verify correct responses
Error Handling
Common issues:
| Error | Cause | Solution |
|---|---|---|
| Connection failed | Server unreachable | Check URL and network |
| Auth failed | Invalid credentials | Verify API key/token |
| No tools found | Protocol issue | Check MCP implementation |
| Tool error | Execution failed | Check server logs |
Security Best Practices
- Use HTTPS for HTTP servers
- Rotate API keys regularly
- Limit tool permissions
- Monitor server access logs
- Validate all inputs
Example: Building a Custom Server
Python Example
from mcp import Server, Tool
server = Server("my-server")
@server.tool("get_data")
async def get_data(query: str) -> str:
# Your logic here
return f"Data for: {query}"
if __name__ == "__main__":
server.run()
TypeScript Example
import { Server, Tool } from '@modelcontextprotocol/sdk';
const server = new Server('my-server');
server.tool('get_data', async (query: string) => {
// Your logic here
return `Data for: ${query}`;
});
server.run();