Skip to main content

MCP

Model Context Protocol (MCP) enables CloudThinker to connect to custom tools and services. Use MCP to extend agent capabilities with your own integrations.

What is MCP?

MCP (Model Context Protocol) is an open protocol for connecting AI agents to external tools and data sources. It provides a standardized way to:
  • Expose tools that agents can call
  • Provide context and data to agents
  • Enable custom integrations with any service

Setup

1

Prepare MCP Server

Ensure your MCP server is running and accessible:
  • Supports Server-Sent Events (SSE) transport
  • Has a publicly accessible endpoint (or VPN access)
  • Returns proper MCP protocol responses
2

Create Connection

Navigate to Connections → MCP and click Add MCP Connection
3

Configure Basic Info

Enter connection details:
  • Name: Descriptive name for the connection
  • Prefix: Tool prefix (e.g., mytoolsmytools_function_name)
4

Configure Transport

Set up the connection transport:
  • Transport Type: Server-Sent Events
  • URL: Your MCP server endpoint
  • Timeout: Connection timeout (default: 5 seconds)
  • SSE Read Timeout: Event stream timeout (default: 30 seconds)
5

Add Environment Variables

Configure any required environment variables:
  • API keys
  • Authentication tokens
  • Custom configuration
6

Test & Create

Test the connection and save

Configuration Options

FieldDescriptionRequired
NameConnection display nameYes
PrefixTool name prefixYes
URLMCP server endpointYes
TimeoutConnection timeout (seconds)No (default: 5)
SSE Read TimeoutEvent stream timeout (seconds)No (default: 30)
Environment VariablesKey-value pairs for configurationNo

Example MCP Server

A simple MCP server that provides a weather lookup tool:
from mcp import Server, Tool

server = Server("weather-tools")

@server.tool()
async def get_weather(location: str) -> str:
    """Get current weather for a location."""
    # Your implementation here
    return f"Weather for {location}: Sunny, 72°F"

if __name__ == "__main__":
    server.run()
Once connected with prefix weather, agents can call:
weather_get_weather(location="San Francisco")

Use Cases

Custom Data Sources

Connect proprietary databases or APIs:
  • Internal metrics systems
  • Custom monitoring tools
  • Business intelligence platforms

Specialized Tools

Add domain-specific capabilities:
  • Custom compliance checks
  • Internal automation scripts
  • Legacy system integrations

External Services

Integrate third-party services:
  • Communication platforms
  • Ticketing systems
  • Cloud services not built-in

Best Practices

Security

  • Use HTTPS endpoints
  • Rotate API keys regularly
  • Implement proper authentication
  • Limit tool permissions

Reliability

  • Set appropriate timeouts
  • Implement retry logic
  • Monitor server health
  • Handle errors gracefully

Troubleshooting

  • Verify MCP server is running
  • Check network connectivity
  • Increase timeout values
  • Confirm firewall allows traffic
  • Verify prefix is set correctly
  • Check MCP server returns tool definitions
  • Ensure protocol version is compatible
  • Review server logs for errors
  • Verify environment variables are set
  • Check API keys are valid
  • Ensure server validates credentials correctly
  • Increase SSE read timeout
  • Check for proxy interference
  • Verify server sends keepalive events
  • Review network stability