How to build an AI Agent with CrewAI and the ClickHouse MCP server

✅ LiteAgent: MCP Tool User
Status: Completed
├── 🔧 Using list_databases (1)
└── 🧠 Thinking...
╭────────────────────────────────────────────────────────── LiteAgent Completion ──────────────────────────────────────────────────────────╮
│                                                                                                                                          │
│  LiteAgent Completed                                                                                                                     │
│  Name: MCP Tool User                                                                                                                     │
│  id: af96f7e6-1e2c-4d76-9ed2-6589cee4fdf9                                                                                                │
│  role: MCP Tool User                                                                                                                     │
│  goal: Utilize tools from an MCP server.                                                                                                 │
│  backstory: I can connect to MCP servers and use their tools.                                                                            │
│  tools: [CrewStructuredTool(name='list_databases', description='Tool Name: list_databases                                                │
│  Tool Arguments: {'properties': {}, 'title': 'DynamicModel', 'type': 'object'}                                                           │
│  Tool Description: List available ClickHouse databases'), CrewStructuredTool(name='list_tables', description='Tool Name: list_tables     │
│  Tool Arguments: {'properties': {'database': {'anyOf': [], 'description': '', 'enum': None, 'items': None, 'properties': {}, 'title':    │
│  '', 'type': 'string'}, 'like': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': '', 'enum': None,      │
│  'items': None, 'properties': {}, 'title': ''}, 'not_like': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None,           │
│  'description': '', 'enum': None, 'items': None, 'properties': {}, 'title': ''}}, 'required': ['database'], 'title': 'DynamicModel',     │
│  'type': 'object'}                                                                                                                       │
│  Tool Description: List available ClickHouse tables in a database, including schema, comment,                                            │
│  row count, and column count.'), CrewStructuredTool(name='run_select_query', description='Tool Name: run_select_query                    │
│  Tool Arguments: {'properties': {'query': {'anyOf': [], 'description': '', 'enum': None, 'items': None, 'properties': {}, 'title': '',   │
│  'type': 'string'}}, 'required': ['query'], 'title': 'DynamicModel', 'type': 'object'}                                                   │
│  Tool Description: Run a SELECT query in a ClickHouse database')]                                                                        │
│  verbose: True                                                                                                                           │
│  Tool Args:                                                                                                                              │
│                                                                                                                                          │
│                                                                                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

- [Prerequisites](#prerequisites)- [Install libraries](#install-libraries)- [Setup credentials](#setup-credentials)- [Initialize MCP server and CrewAI agent](#initialize-mcp-and-agent)

Was this page helpful?