Hey CrewAI community!
Sharing a working example of the new MCPServerAdapter integration that might be useful for anyone building sales or prospecting agents.
The Problem:
Brazilian government procurement portals (where ~$500B in tenders are published annually) are notoriously hostile to scraping: malformed PDFs, expired SSL certs, weekly layout changes. Standard Playwright/Selenium approaches break constantly.
What I Built:
An MCP server that abstracts all the dirty work. It uses Google Dorks to find cached versions of procurement notices, processes them through Llama-3 for structured extraction, and serves strictly typed JSON to the agent.
The MCPServerAdapter Integration:
python
from crewai import Agent, Task, Crew
from crewai.tools.mcp_tool import MCPToolAdapter
# Connect to the MCP server via stdio
mcp = MCPToolAdapter(
command="python",
args=["mcp_server.py"]
)
sdr_agent = Agent(
role="B2G Sales Hunter",
goal="Find procurement opportunities in Brazilian cities",
tools=mcp.get_tools(), # Discovers tools automatically!
verbose=True
)
```
**What the agent receives:**
```json
{
"orgao_comprador": "Prefeitura de Campinas",
"objeto_licitacao": "Contratacao de servicos de cloud computing",
"valor_estimado": "R$ 850.000,00",
"modalidade": "Pregao Eletronico"
}
```
The key architectural win is that the agent never touches a browser. All the messy extraction is encapsulated in the MCP server layer.
Full template with installation instructions on GitHub: https://github.com/guimaster97/crewai-gov-sales-agent
Happy to discuss the architecture or the MCP stdio integration if anyone is working on similar patterns!