MCP Support¶
janito supports the Model Context Protocol (MCP) for extending functionality with custom tools and servers.
What is MCP?¶
MCP is a protocol that allows AI models to connect to external tools and data sources. It provides a standardized way to:
- Discover available tools
- Execute tool calls
- Manage connections to multiple servers
Available Commands¶
| Command | Description |
|---|---|
/mcp add <name> stdio <command> |
Add a stdio transport service |
/mcp add <name> http <url> |
Add an HTTP transport service |
/mcp list |
List all configured services |
/mcp remove <name> |
Remove a service |
Stdio Transport¶
Use stdio transport for local processes.
Add a Stdio Service¶
With Quoted Command¶
HTTP Transport¶
Use HTTP transport for remote servers.
Add an HTTP Service¶
With Headers¶
Multiple Headers¶
/mcp add remote http https://api.example.com/mcp --header Authorization:Bearer xxx --header X-API-Key:yyy
List Services¶
Shows all configured MCP services and their status.
Remove a Service¶
Configuration File¶
Services are stored in ~/.janito/mcp_services.json.
stdio Example¶
{
"services": {
"myserver": {
"transport": "stdio",
"command": "python -m mcp.server",
"env": {}
}
}
}
HTTP Example¶
{
"services": {
"remote": {
"transport": "http",
"url": "https://api.example.com/mcp",
"headers": {
"Authorization": "Bearer xxx"
}
}
}
}
Examples¶
Filesystem MCP Server¶
GitHub MCP Server¶
HTTP API¶
Tips¶
- Start with stdio: Local stdio servers are simpler to set up
- Check service status: Use
/mcp listto see connected services - Remove unused: Remove services you no longer need
- Environment variables: Some servers may need environment variables set in the command
Troubleshooting¶
Connection Failed¶
- Verify the command/URL is correct
- Check if the server is running
- For stdio, check if the command is in your PATH
Service Not Responding¶
- Restart the service
- Check server logs
- Verify network connectivity (for HTTP)