Skip to main content

Custom MCP Servers

Add custom MCP servers to extend your chatbot with your own integrations.

Server Types​

TypeDescriptionBest For
HTTPREST API-based serverCloud services
stdioCommand-line basedLocal tools

Adding an HTTP Server​

  1. Go to "Settings" > "Integrations"
  2. Click "Add Custom Server"
  3. Select "HTTP"
  4. Enter server details:
    • Name
    • URL
    • Authentication (if required)
  5. Click "Test Connection"
  6. 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​

  1. Go to "Settings" > "Integrations"
  2. Click "Add Custom Server"
  3. Select "stdio"
  4. Enter server details:
    • Name
    • Command
    • Arguments
  5. Click "Test"
  6. 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:

  1. Server is queried for capabilities
  2. Tools are listed in the integration settings
  3. You can enable/disable specific tools

Configuring Tools​

For each discovered tool:

  1. Click on the tool
  2. Configure parameters
  3. Set descriptions for the AI
  4. 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​

  1. Click "Test Connection"
  2. Verify server responds
  3. Check tool discovery

Test Tools​

  1. Use the chatbot test feature
  2. Ask questions that trigger your tools
  3. Verify correct responses

Error Handling​

Common issues:

ErrorCauseSolution
Connection failedServer unreachableCheck URL and network
Auth failedInvalid credentialsVerify API key/token
No tools foundProtocol issueCheck MCP implementation
Tool errorExecution failedCheck 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();